Overview
ROS2 provides a rich command-line interface for interacting with the robot system. This page covers common ROS2 commands used in the TurtleBot3 development environment.Basic commands
Check ROS2 installation
Get help
Node commands
Nodes are executable programs that perform computation.List running nodes
Node information
- Subscribers
- Publishers
- Services
- Actions
Run a node
Topic commands
Topics are named buses over which nodes exchange messages.List active topics
/cmd_vel- Velocity commands/odom- Odometry data/scan- Laser scan data/imu- IMU data/joint_states- Joint states
List topics with types
Topic information
- Message type
- Publisher count
- Subscription count
Echo topic messages
Show message rate
average rate: 5.000
Publish to topic
Service commands
Services provide request/reply interactions.List services
List services with types
Service information
Find services by type
Call a service
Parameter commands
Parameters are node configuration values.List parameters
Get parameter value
Set parameter value
Dump parameters to file
Load parameters from file
Action commands
Actions are for long-running tasks with feedback.List actions
/navigate_to_pose/follow_path/compute_path_to_pose
Action information
Send action goal
Package commands
List installed packages
List TurtleBot3 packages
Find package executables
Show package prefix (install location)
Launch commands
Run a launch file
Pass arguments to launch file
Interface commands
Interface commands show message/service/action definitions.List message types
Show message definition
Show package interfaces
Bag commands
Bag files record and replay ROS2 data.Record topics
Record all topics
Play bag file
Bag information
Doctor command
Diagnose ROS2 setup issues.- Network configuration
- System setup
- ROS2 environment
Full report
Daemon commands
Manage the ROS2 daemon.Stop daemon
Start daemon
Restart daemon
ros2 commands are slow or hanging.
Common workflows
Inspect running system
Debug robot not moving
Monitor sensor data
Record and replay
Environment variables
Key ROS2 environment variables:| Variable | Value | Purpose |
|---|---|---|
ROS_DISTRO | jazzy | ROS2 distribution |
ROS_DOMAIN_ID | 30 | Network isolation |
RMW_IMPLEMENTATION | rmw_cyclonedds_cpp | DDS implementation |
ROS_LOCALHOST_ONLY | 0 or 1 | Restrict to localhost |
Check environment
Tips and tricks
Auto-completion
PressTab to auto-complete commands:
Command history
Search previous commands withCtrl+R:
Compact output
Multiple domains
Run multiple robot systems by changingROS_DOMAIN_ID: