-
Notifications
You must be signed in to change notification settings - Fork 154
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
Simulated laser scanner does not respect namespace/prefix #65
Comments
This was surprisingly tricky so solve. It took me 2 hours to figure out what the heck my colleague meant by the comment above, and more importantly, how to solve it: <!-- no prefix, plugin always uses a tf_prefix (if none is set it uses robotNamespace) --> But finally I figured it out. So the problem is that the gazebo_ros_laser plugin does the following:
The robotNamespace gets automatically set if you start the spawn_model node inside a namespace. In this case, if we just add I have just pushed a couple of commits that allow you to properly set the tf prefix. You can try it like this:
If you want to enable that behavior in your own launch file, just use the xacro arg with the catchy name of And as a demonstration of what I mean with the "pushing into namespaces" problem, I've pushed this commit to my personal fork (just for demonstration purposes, I'm not going to merge it): This is the line where I make sure not to prepend the prefix twice: mintar@c91a543#diff-025925fc4708d226851d15a6422fb336R43 ... because we're operating inside a namespace: mintar@c91a543#diff-025925fc4708d226851d15a6422fb336R30 Feel free to reopen this issue if it's not solved by those commits. |
In gazebo_plugins 2.9.2, the behavior of the gazebo_ros_laser plugin was changed in this commit: ros-simulation/gazebo_ros_pkgs@34b2c27 It now no longer prepends the robotNamespace if the parameter tf_prefix is empty. Since tf_prefix has been deprecated for a long time, we always leave it empty. The change in gazebo_plugins means that #65 no longer happens, and we have to prepend the prefix ourselves (just like with the other plugins). This reverts commit ba02a68 and applies the following additional diff: - <!-- no prefix, plugin always uses a tf_prefix (if none is set it uses robotNamespace) --> - <frameName>${link}</frameName> + <frameName>${prefix}${link}</frameName>
We are using our MIR in the namespace
mir_
and initially had some issues with the navigation in simulation.More precisely, the laser scan results on
/scan
are still in the framefront_laser_link
rather thanmir_front_laser_link
and later on in the navigation stack this causesamcl
to not publish the transformation betweenmir_odom_comb
andmap
.These messages are published by Gazebo using the
libgazebo_ros_laser
plugin. To work with a prefixed MIR, we had to change the frame configuration of the plugin to this:to make it use the prefix for the frame in the published messages.
Is this, how it's supposed to be or is there another, better way to resolve this?
The text was updated successfully, but these errors were encountered: