In this section we are going to learn how to start the robot from the terminal. In the next section we will create a launch file for the robot.

Use the following command to run the robot_state_publisher node from the terminal:

ros2 run robot_state_publisher robot_state_publisher --ros-args -p robot_description:="$(xacro my_robot.urdf.xacro)"

Use this command to launch Gazebo from the launch file:

ros2 launch gazebo_ros gazebo.launch.py

Use the following command to spawn the robot in Gazebo:

ros2 run gazebo_ros spawn_entity.py -topic robot_description -entity my_robot