Gazebo | Ignition | Community
Ask Your Question
1

Gazebo crashes if a plugin parameter has an empty value

asked 2013-01-07 07:18:29 -0600

Johannes Meyer gravatar image

updated 2013-01-07 12:02:43 -0600

For our quadrotor simulation package hector_quadrotor we are using some custom Gazebo plugins with a couple of parameters. Most of them have a default value and as I would like to use xacro macro parameters for some of them I would like to support empty strings or empty tags in the plugin's SDF definitions.

However, the plugin causes a segfault in gzserver as the Element::GetValueString() access the empty pointer returned by Element::GetValue(). Is there a special reason why GetValueString() and the other type specific getter functions do not return an empty string or the default constructed values if the parameter value is empty? Of course a simple workaround to circumvent the segfault would be to check if GetValue() returns a null pointer before calling GetValueString().

See http://tu-darmstadt-ros-pkg.googlecode.com/svn/trunk/hectorquadrotor/hectorquadrotorgazeboplugins/src/quadrotorsimplecontroller.cpp for an example use case. I am using Gazebo 1.0.2, the version that currently comes with ROS fuerte. But from the source code on BitBucket, the described behaviour should be the same for all versions up to 1.3.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2013-01-07 18:17:36 -0600

hsu gravatar image

updated 2013-01-07 18:23:10 -0600

filed a ticket.

Is it the case that Element::value is null in this line?

edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2013-01-07 07:18:29 -0600

Seen: 349 times

Last updated: Jan 07 '13