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

[ros2] gazebo doesn't pick up the "out:=/scan" from turtlebot3 world file #991

Closed
mkhansenbot opened this issue Sep 6, 2019 · 12 comments
Closed

Comments

@mkhansenbot
Copy link

Sometime this week a change has merged somewhere in ROS2 source (using ros2.repos master file), that seems to have broken Gazebo ability to rename the turtlebot3 topics like "/scan" and "/imu" (see here: https://github.com/ROBOTIS-GIT/turtlebot3_simulations/blob/ros2/turtlebot3_gazebo/models/turtlebot3_waffle/model-1_4.sdf#L160)

Now we don't see those topics but we see default ones like "/turtlebot3_laserscan/out" instead of "/scan"

Maybe this is related to the "--ros-args" changes that merged upstream? Just a guess.

To reproduce:

  1. build ros2 from source using ros2.repos file.
  2. build latest ros2 branch of gazebo_ros_pkgs
  3. git clone https://github.com/ROBOTIS-GIT/turtlebot3_simulations.git
  4. export GAZEBO_MODEL_PATH=~/turtlebot3_simulations/turtlebot3_gazebo/models
  5. gazebo --verbose -s libgazebo_ros_init.so ~/turtlebot3_simulations/turtlebot3_gazebo/worlds/turtlebot3_worlds/waffle.model
  6. Wait for simulation to load
  7. In another window run ros2 topic echo /scan (nothing will echo)
  8. ros2 topic list will not show the /scan topic, but will show /turtlebot3_laserscan/out instead
@crdelsey
Copy link

crdelsey commented Sep 6, 2019

It looks like it is related to ros2/rcl#491

@chapulina
Copy link
Contributor

chapulina commented Sep 6, 2019

I think from Eloquent we may need to use this in the SDF: <argument>-r ~/out:=scan</argument>. If that works, we should update all our examples and docs.

@crdelsey
Copy link

crdelsey commented Sep 7, 2019

That doesn't seem to be sufficient. I'm still seeing the output on /laserscan/out instead of scan

@chapulina
Copy link
Contributor

Oh sorry, maybe this?

<argument>--ros-args -r ~/out:=scan</argument>

I hope we don't need this 😓

<argument>--ros-args</argument>
<argument>-r</argument>
<argument>~/out:=scan</argument>

@mkhansenbot
Copy link
Author

Only that last method works :(

@chapulina
Copy link
Contributor

Ok, thanks for testing. I can add a new <remapping> element which prepends --ros-args and -r under the hood for convenience.

@orduno
Copy link

orduno commented Sep 10, 2019

Since these <argument>s are all scoped within <ros>, should prepending of --ros-args happen to any <argument> and include an additional -r for any <remapping>?

          <plugin name="my_imu_plugin" filename="libgazebo_ros_imu_sensor.so">
            <ros>
              <argument>~/out:=imu</argument>
            </ros>
          </plugin>

@chapulina
Copy link
Contributor

@orduno , yes, that's the current workaround.

When I have some time I want to automatically prepend --ros-args for all <argument> tags, and handle remappings separately through a <remapping> element.

Also note that upstream will soon be updated to support the old method with warnings, which should ease the transition. See ros2/rcl#495 (comment).

@shivaang12
Copy link

I also noticed the same behavior with imu when I changed <argument>~/out:=imu</argument> to <argument>--ros-args --remap ~/out:=imu</argument>.

@mikaelarguedas
Copy link

See #1011 for an attempt at implementing the <remapping> tag

Tested on turtlebot3 burger at ROBOTIS-GIT/turtlebot3_simulations@dc80aa5

@chapulina
Copy link
Contributor

Fixed in #1011 for Eloquent, thanks @mikaelarguedas ! I think it's a good idea to backport the <remapping> tag to Dashing, update all examples and make that the recommended pattern. If anyone is up for submitting a PR that would be appreciated 😊

@chapulina
Copy link
Contributor

I think it's a good idea to backport the tag to Dashing, update all examples and make that the recommended pattern.

At least one user is mixing dashing and eloquent and getting bad results: osrf/gazebo_tutorials#104.

Dashing still has one year of support. We could backport the remapping tag to ease users' lives.

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

6 participants