Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[gazebo_ros] gzserver doesn't recognize libgazebo_ros_api_plugin was already given in CLI params #246

Closed
peci1 opened this issue Sep 15, 2014 · 1 comment

Comments

@peci1
Copy link
Contributor

peci1 commented 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.

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.
peci1 added a commit to peci1/gazebo_ros_pkgs that referenced this issue Sep 15, 2014
peci1 added a commit to peci1/gazebo_ros_pkgs that referenced this issue Oct 13, 2014
scpeters added a commit that referenced this issue Oct 13, 2014
@scpeters
Copy link
Member

closed by #247

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants