Skip to content

ROS 2 Migration: Launch Scripts

Shivesh Khaitan edited this page Aug 21, 2019 · 1 revision

Overview

The functionalities of gazebo_ros scripts in ROS1 (gazebo, gzclient, gzserver, debug, gdbrun, perf, libcommon.sh) are been offered by launch scripts gazebo.launch.py, gzserver.launch.py and gzclient.launch.py in ROS2.

Example Migration

ROS1

rosrun gazebo_ros gazebo

ROS2

ros2 launch gazebo_ros gazebo.launch.py

ROS1

rosrun gazebo_ros gzserver

ROS2

ros2 launch gazebo_ros gzserver.launch.py

ROS1

rosrun gazebo_ros gzclient

ROS2

ros2 launch gazebo_ros gzclient.launch.py

ROS1

rosrun gazebo_ros debug

ROS2

ros2 launch gazebo_ros gzserver.launch.py gdb:=true 

In ROS2, gzclient script also supports gdb

ros2 launch gazebo_ros gzclient.launch.py gdb:=true 

or

ros2 launch gazebo_ros gazebo.launch.py gdb:=true 

ROS1

rosrun gazebo_ros perf

ROS2

ros2 launch gazebo_ros gzserver.launch.py valgrind:=true 

Similar to gdb, valgrind can also be run with gazebo and gzserver

Arguments Usage

For all other arguments to be passed to gazebo, gzclient or gzserver command, launch_arguments are available in the respective scripts.

ros2 launch gazebo_ros gazebo.launch.py world:=actor.world verbose:=true

By default, the system plugins are loaded in gzserver. To load without them

ros2 launch gazebo_ros gazebo.launch.py init:=false factory:=false

extra_gazebo_args is a special argument which allows any gazebo argument to be passed as it is passed to the usual gazebo command

Example Usage

extra_gazebo_args

ros2 launch gazebo_ros gazebo.launch.py extra_gazebo_args:="--verbose --pause"
You can’t perform that action at this time.