ROS2 commands record

Overview

The blog collects some useful ROS2 commands.

Workspace

1# Source setup
2source /opt/ros/<ros2-distro>/setup.bash
3# Create workspace
4mkdir -p ~/ros2_ws/src
5# build workspace
6colcon build
7# Source workspace
8source ~/ros2_ws/install/setup.bash
9ros2 launch <package_name> <launch_file_name>

Node and Topic

1ros2 node list
2ros2 node info /<node_name>
3ros2 topic list
4ros2 topic info /<topic_name>
5ros2 topic echo /<topic_name>
6ros2 service call /<service_name> <service_type> "<request_data>"

Rosbag

1ros2 bag record -a
2ros2 bag play <bag_file_name>.db3

RViz

1# Install
2sudo apt-get install ros-<distro>-rviz2
comments powered by Disqus