You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I develop a custom system plugin in whose Load() I need to use some ROS node-related stuff. Therefore I concluded I have to first load the gazebo_ros_api_plugin, let it call ros::init, and then load my own plugin.
However, the current gzserver implementation adds the two plugins from this package always at the very end of the list of the loaded system plugins. Luckily, somebody has added the checks to make sure the plugins are not loaded twice.
So I tried to pass a command line like gzserver -s /.../libgazebo_ros_api_plugin.so -s /.../libmy_plugin.so.
And then I found out the checks that should avoid duplicate loading are not working properly, since this command-line issues in calling gzserver -s ros_api -s my_plugin -s ros_api (shortened for clarity). I specifically refer to lines 10 and 16 in indigo-devel branch.
if [ `expr "$final" : '.*libgazebo_ros_paths_plugin\.$EXT.*'` -eq 0 ]
The subshell always returns 0, because the $EXT gets never "translated", and that is because the expression is enclosed in single quotes.
Enclosing the expression in double quotes solves the problem for me.
Am I correct with my explanation, and can you confirm this bug?
Another two points:
I saw a recommendation to use expr "x$final" instead of expr "$final" to avoid the possibility where $final contains something expr could interpret as its own operator; however I don't know if these double quotes are not sufficient
The regular expressions for the two plugins are non-coherent - in the first one, underscores are not escaped, and in the other one they are. I think correct is not to escape them, since underscore is IMO not a special regex character.
The text was updated successfully, but these errors were encountered:
peci1
added a commit
to peci1/gazebo_ros_pkgs
that referenced
this issue
Sep 15, 2014
I develop a custom system plugin in whose Load() I need to use some ROS node-related stuff. Therefore I concluded I have to first load the gazebo_ros_api_plugin, let it call ros::init, and then load my own plugin.
However, the current gzserver implementation adds the two plugins from this package always at the very end of the list of the loaded system plugins. Luckily, somebody has added the checks to make sure the plugins are not loaded twice.
So I tried to pass a command line like
gzserver -s /.../libgazebo_ros_api_plugin.so -s /.../libmy_plugin.so
.And then I found out the checks that should avoid duplicate loading are not working properly, since this command-line issues in calling
gzserver -s ros_api -s my_plugin -s ros_api
(shortened for clarity). I specifically refer to lines 10 and 16 in indigo-devel branch.The subshell always returns 0, because the
$EXT
gets never "translated", and that is because the expression is enclosed in single quotes.Enclosing the expression in double quotes solves the problem for me.
Am I correct with my explanation, and can you confirm this bug?
Another two points:
expr "x$final"
instead ofexpr "$final"
to avoid the possibility where$final
contains something expr could interpret as its own operator; however I don't know if these double quotes are not sufficientThe text was updated successfully, but these errors were encountered: