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] Port gazebo launch scripts to ROS2 #962

Merged
merged 3 commits into from
Aug 14, 2019

Conversation

shiveshkhaitan
Copy link

@shiveshkhaitan shiveshkhaitan commented Jul 19, 2019

Port gazebo, gzserver and gzclient scripts from ROS1 to launch files in ROS2.

Example usage:
ros2 launch gazebo_ros gazebo.launch.py verbose:=true pause:=true Timer:=true

ros2 launch gazebo_ros gzserver.launch.py verbose:=true pause:=true

ros2 launch gazebo_ros gzclient.launch.py verbose:=true Timer:=true

This depends on #925

@chapulina chapulina added the ros2 label Jul 24, 2019
@chapulina
Copy link
Contributor

@osrf-jenkins run tests please

Copy link
Contributor

@chapulina chapulina left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

#925 is merged and backported to dashing. I rebased this branch so it can use GazeboRosPaths.

It's working for me, I just have some suggestions. We also need a migration guide.

DeclareLaunchArgument('Cessna', default_value='false',
description='Set "true" to start gzclient with Cessna GUI plugin'),
DeclareLaunchArgument('Keyboard', default_value='false',
description='Set "true" to start gzclient with Keyboard GUI plugin'),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of exposing these 3 GUI plugins as boolean options, it would be more flexible to let the user pass the full plugin name as a string. This way, they can also choose custom plugins. What do you think?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The problem is that one argument only takes one value. Users cannot assign a list of plugins to an argument

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Together with @sloretz, we found out about the shell=True option, which lets us pass the whole command as a single string. Using that, I have some suggestions on 5721646 .

The last thing I'd like to add would be gui and server arguments to gazebo.launch.py so that users can conditionally include gzclient and gzserver, i.e.:

ros2 launch gazebo_ros gazebo.launch.py gui:=false

I found documentation implying that IncludeLaunchDescription can be conditionally included but I didn't figure out exactly how.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It turns out conditional includes are not possible yet: ros2/launch#303. We could add a note to the code pointing to that issue.

This PR looks good to me once the changes to use shell=True are in.

gazebo_ros/launch/gzserver.launch.py Outdated Show resolved Hide resolved
gazebo_ros/launch/gzclient.launch.py Show resolved Hide resolved
gazebo_ros/launch/gzserver.launch.py Outdated Show resolved Hide resolved
Copy link
Contributor

@chapulina chapulina left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Merging! We just need a migration guide

@chapulina chapulina merged commit bf0ba60 into ros-simulation:dashing Aug 14, 2019
shiveshkhaitan added a commit to shiveshkhaitan/gazebo_ros_pkgs that referenced this pull request Aug 15, 2019
* [ros2] Port gazebo launch scripts to ROS2

* Add gdb and valgrind option

* Use shell command for extra gazebo args
antarikshnarain added a commit to antarikshnarain/gazebo_ros_pkgs that referenced this pull request Jul 7, 2020
* [ros2] Port elevator to ROS2

* [ros2] Fix test for diff drive (ros-simulation#951)

* use c_str() (ros-simulation#950) (ros-simulation#954)

Signed-off-by: Karsten Knese <[email protected]>

* [ros2] Port projector to ROS2 (ros-simulation#956)

* [ros2] Port projector to ROS2

* fix small typo

* [ros2] Port planar move to ROS2 (ros-simulation#958)

* [ros2] Port planar move to ROS2

* Add test for pose conversion

* [ros2] Add ackermann drive plugin (ros-simulation#947)

* [ros2] Add ackermann drive plugin

* Minor fixes

Use gazebo database model

* Update example usage

* Fix TF for demo

* changelog

* 3.3.2

* [ros2] Port harness to ROS2 (ros-simulation#944)

* [ros2] Port hand of god to ROS2 (ros-simulation#957)

* [ros2] Port hand of god to ROS2

* Minor fixes

* [ros2] Port model states to ROS2 (ros-simulation#968)

* [ros2] Port model states to ROS2

* remove unported code

Signed-off-by: Louise Poubel <[email protected]>

* Add Gazebo builtin plugins to LD_LIBRARY_PATH (ros-simulation#974)

* Add Gazebo builtin plugins to LD_LIBRARY_PATH

Signed-off-by: Louise Poubel <[email protected]>

* cross-platform

Signed-off-by: Louise Poubel <[email protected]>

* [ros2] Fix tests on Dashing (ros-simulation#953)

* [ros2] Fix camera triggered test on Dashing

backport remove noe fix and re-enable distortion tests

* improve robustness of joint state pub test

Signed-off-by: Louise Poubel <[email protected]>

* Fix for multiple video plugins (ros-simulation#898) (ros-simulation#937)

* Fix for multiple video plugins (ros-simulation#898)

* Fix crash on shutdown

* Fix gazebo node destructor

* [ros2] Port bumper sensor to ROS2 (ros-simulation#943)

* [ros2] Port bumper sensor to ROS2

* Add author name

* Minor fixes and add contact msg conversion

* Remove unused header includes

* [ros2] Port gazebo_ros_path plugin to ROS2 (ros-simulation#925)

* [ros2] Port gazebo_ros_path plugin

* Minor fixes

* Change plugin launch file to python script

* Fix for flake8 test

* set gazebo library dirs (ros-simulation#963)

Signed-off-by: Karsten Knese <[email protected]>

* [ros2] Port Link states to ROS2 (ros-simulation#969)

* [ros2] Port model states to ROS2

* [ros2] Port link states to ROS2

* Change usage of body -> link

* Remove link_states from .ros1_unported

* fix video test

Signed-off-by: chapulina <[email protected]>

* [ros2] Port joint pose trajectory to ROS2 (ros-simulation#955)

* [ros2] Port joint pose trajectory to ROS2

* Add conversion tests

Minor fixes

* [ros2] Port gazebo launch scripts to ROS2 (ros-simulation#962)

* [ros2] Port gazebo launch scripts to ROS2

* Add gdb and valgrind option

* Use shell command for extra gazebo args

* [ros2] Port vacuum gripper to ROS2 (ros-simulation#960)

* [ros2] Port vacuum gripper to ROS2

* Fix gripper forces

* Add option to set max_distance

Change SetForce -> Add Force

* [ros2] Port spawn model to ROS2 (ros-simulation#948)

* [ros2] Port spawn model to ROS2

* Delete .ros1_unported files

* Fixes and add demo

Change spawn_model to spawn_entity

* Rename demo launch and add checks for service

* Fix reading xml file from param and model states

* remove diplicate

Signed-off-by: Louise Poubel <[email protected]>

* Use gazebo launch file

* Change topic behaviour

* [ros2] Spawn <plugin> without <ros> (ros-simulation#983)

Signed-off-by: Louise Poubel <[email protected]>

* [ros2] Backport depth camera to dashing (ros-simulation#967)

* [ros2] Backport depth camera to dashing

* don't install header that will be removed

Signed-off-by: Louise Poubel <[email protected]>

* fix linting error

Signed-off-by: Louise Poubel <[email protected]>

* Address reviews on ros-simulation#868 (ros-simulation#972)

* [ros2] World plugin to get/set entity state services (ros-simulation#839)

remove status_message

* [ros2] Port time commands (pause / reset) (ros-simulation#866)

* [ros2] Migration of get/set world, model, joint, link, light properties

* Trying to pass CI test, try n1.

* clean up some linter warnings

* Requested changes in review, unfinished

* Fix uncrustify

* Address reviews

* more tests, joint types

Signed-off-by: Louise Poubel <[email protected]>

* Revert changes to GetModelProperties message

Document gazebo_ros_properties header

* Convert msgs pose to math pose and use it on SetCoG

Signed-off-by: Louise Poubel <[email protected]>

* [ros2] Adding GPS plugin (ros-simulation#982)

* Adding gps plugin sensor

* Adding test for the gps plugin

* Adding GPS world demo and other small text corrections

* [ros2] Adding option to select the frame where the force will be applied (ros-simulation#978)

* Adding option to select the frame where the force will be applied

A new parameter was added on the plugin with the options 'world' and 'link' frame.
The default value is 'world'.
Internally the AddRelativeForce() and torque functions are used instead of the AddForce() when the body option is selected.

* Modifying force test for the 'world' frame, and adding test for the force on the 'link' frame

The new world file starts with the box rotated.

* Fix cpplint and uncrustify on force plugin files

* Removing OnUpdateRelative() from the force plugin

This function could potentially break the ABI, therefore is been removed.

* body -> link, warn -> info, more examples

Signed-off-by: Louise Poubel <[email protected]>

* [backport] Backport multicamera to dashing (ros-simulation#984)

* [backport] Backport multicamera to dashing

* fix test - use correct world

Signed-off-by: Louise Poubel <[email protected]>

* Add maintainer (ros-simulation#985)

Signed-off-by: Louise Poubel <[email protected]>

* [ros2] Conditional launch includes (ros-simulation#979)

* [ros2] Conditional launch includes

Signed-off-by: Louise Poubel <[email protected]>

* remove unused import

Signed-off-by: Louise Poubel <[email protected]>

* changelog

Signed-off-by: Louise Poubel <[email protected]>

* 3.3.3

* [ros2] Uncommenting bond option on spawn_entity (wait Ctrl+C then remove entity) (ros-simulation#986)

* Uncommenting bond option on spawn_entity (wait Ctrl+C then remove entity)

Instead of waiting for a shutdown callback to be created in rclpy,
we can use the try/except to get the SIGINT signal, then delete the entity.

* Message formatting

Signed-off-by: Louise Poubel <[email protected]>

* linter 😅

Signed-off-by: Louise Poubel <[email protected]>

* [ros2] Remove ported / deprecated (ros-simulation#989)

Signed-off-by: Louise Poubel <[email protected]>

* Remove ROS-specific arguments before passing to argparse (ros-simulation#994)

This resolves argparse errors when trying to launch the spawn_entity script as a ROS node.

For example, a launch file like the following wouldn't work without this change:

    <launch>
      <arg name="model_urdf" default="$(find-pkg-share mymodels)/urdf/ball.urdf" />
      <node
        pkg="gazebo_ros"
        exec="spawn_entity.py"
        name="spawner"
        args="-entity foo -file /path/to/my/model/foo.urdf" />
    </launch>

Signed-off-by: Jacob Perron <[email protected]>

* fix multi_camera_plugin on windows (ros-simulation#999)

* changelog

Signed-off-by: Louise Poubel <[email protected]>

* 3.3.4

* Update changelogs

* 3.4.0

* generate a .dsv file for the environment hook

* Update changelogs

* 3.4.1

* changelog

Signed-off-by: Louise Poubel <[email protected]>

* 3.4.2

* fix pathsep for windows (ros-simulation#1028)

* Image publishers use SensorDataQoSProfile (ros-simulation#1031)

All other sensor publishers were updated previously to use the same profile (ros-simulation#926).
I'm not sure if the image publishers were overlooked or the image_transport API didn't
support setting the QoS profile at the time.

Signed-off-by: Jacob Perron <[email protected]>

* [backport][ros2] make transient local reliable (ros-simulation#1033) (ros-simulation#1036)

* [ros2] make transient local reliable (ros-simulation#1033)

* make transient local reliable

Signed-off-by: Karsten Knese <[email protected]>

* fix master

Signed-off-by: Karsten Knese <[email protected]>

* add launch test

Signed-off-by: Karsten Knese <[email protected]>

* make it actual latched

Signed-off-by: Karsten Knese <[email protected]>

* alpha sort

Signed-off-by: Karsten Knese <[email protected]>

* add launch_test dependency

Signed-off-by: Karsten Knese <[email protected]>

* more dependencies

Signed-off-by: Karsten Knese <[email protected]>

* remove debug print

Signed-off-by: Karsten Knese <[email protected]>

* is_initialized -> ok

Signed-off-by: Karsten Knese <[email protected]>

* Update gazebo_ros/test/entity_spawner.test.py

Co-Authored-By: chapulina <[email protected]>

* use erase-remove idiom

Signed-off-by: Karsten Knese <[email protected]>

* use ReadyToTest()

Signed-off-by: Karsten Knese <[email protected]>

Co-authored-by: chapulina <[email protected]>

* Set timeout and call gzserver directly

Signed-off-by: Louise Poubel <[email protected]>

Co-authored-by: chapulina <[email protected]>

* changelog

Signed-off-by: Louise Poubel <[email protected]>

* 3.4.3

* Measure IMU orientation with respect to world (ros-simulation#1058)

Report the IMU orientation from the sensor plugin with respect to the world frame.
This complies with convention documented in REP 145: https://www.ros.org/reps/rep-0145.html

In order to not break existing behavior, users should opt-in by adding a new SDF tag.

Co-authored-by: Jacob Perron <[email protected]>

* Measure IMU orientation with respect to world (dashing) (ros-simulation#1065)

Report the IMU orientation from the sensor plugin
with respect to the world frame.
This complies with convention documented in REP 145:
https://www.ros.org/reps/rep-0145.html

In order to not break existing behavior,
users should opt-in by adding a new SDF tag.

Co-authored-by: Jacob Perron <[email protected]>

* wait for service with variable timeout (ros-simulation#1090)

* wait for service with variable timeout

Signed-off-by: Karsten Knese <[email protected]>

Co-authored-by: chapulina <[email protected]>

* Backport Gazebo11/Bionic fix for boost variant (ros-simulation#1102)

* Backport Gazebo11/Bionic fix for boost variant (ros-simulation#1103)

* Prepare changelogs

* 3.3.5

* Prepare changelogs

* 3.4.4

* [eloquent] Fix Windows build. (ros-simulation#1077)

* Adding Windows bringup.

* Remove unported gazebo_ros_control (ros-simulation#1108)

Signed-off-by: Louise Poubel <[email protected]>

* use target include directories (ros-simulation#1040)

Signed-off-by: Karsten Knese <[email protected]>
Co-authored-by: Louise Poubel <[email protected]>

* Apply acceleration until both left and right reach targetspeed (ros-simulation#1009)

Co-authored-by: Louise Poubel <[email protected]>

* Fix all Foxy tests

Signed-off-by: Louise Poubel <[email protected]>

* uncrustifyyyyyy

Signed-off-by: Louise Poubel <[email protected]>

* changelog

Signed-off-by: Louise Poubel <[email protected]>

* 3.5.0

Co-authored-by: Shivesh Khaitan <[email protected]>
Co-authored-by: chapulina <[email protected]>
Co-authored-by: Karsten Knese <[email protected]>
Co-authored-by: alexfneves <[email protected]>
Co-authored-by: Jacob Perron <[email protected]>
Co-authored-by: Jonathan Noyola <[email protected]>
Co-authored-by: Jose Luis Rivero <[email protected]>
Co-authored-by: Dirk Thomas <[email protected]>
Co-authored-by: Steven Peters <[email protected]>
Co-authored-by: Sean Yen <[email protected]>
Co-authored-by: scgroot <[email protected]>
description='Set "true" to increase messages written to terminal.'),
DeclareLaunchArgument('help', default_value='false',
description='Set "true" to produce gzserver help message.'),
DeclareLaunchArgument('pause', default_value='false',
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Note, in ROS 1 the launch argument name is "paused". I'm not sure why it changed in ROS 2, but maybe we can document this difference somewhere on a migration page.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm referring to the empty_world.launch file, but I guess this isn't really an exact equivalent to gzserver.launch.py, they just happen to both offer launch args for pausing.

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

Successfully merging this pull request may close these issues.

3 participants