Skip to content

Latest commit

 

History

History
110 lines (70 loc) · 2.08 KB

ShellCommands.md

File metadata and controls

110 lines (70 loc) · 2.08 KB

ShellCommands

Basic Shell Commands for ROS 2

This document provides a list of essential shell commands for working with ROS 2 (Robot Operating System 2). These commands are commonly used for running nodes, building packages, and interacting with topics, services, and other components within the ROS 2 environment.

1. Managing Nodes

To run a node from a specific package:

ros2 run <package_name> <node_name>

To list all active nodes:

ros2 node list

To get detailed information about a specific node:

ros2 node info /<node_name>

2. Working with Topics

To list all active topics:

ros2 topic list

To get information about a specific topic, including its datatype and publisher/subscriber count:

ros2 topic info /<topic_name>

To view the data being published to a topic:

ros2 topic echo /<topic_name>

To display information about the datatype of a topic:

ros2 interface show <Type>

3. Working with Services

To list all active services:

ros2 service list

To get the type of a specific service:

ros2 service type /<service_name>

To call a service:

ros2 service call /<service_name> <service_type> '{<args>}'

4. Building ROS 2 Packages

To build all packages in your workspace:

colcon build

For incremental builds (useful when working on files without creating new ones):

colcon build --symlink-install

🚨 Note: --symlink-install cannot be used after adding custom messages


5. Visualizing ROS 2 Graph

To visualize all active nodes and their connections in a graph format:

rqt_graph

6. Converting Xacro to URDF

To convert a Xacro file to URDF:

ros2 run xacro xacro <xacro_path> > <urdf_path>

Summary

These commands provide the foundation for interacting with ROS 2 systems, enabling you to run nodes, build and manage packages, and interact with topics and services. For more detailed information on each command, use the --help option with the command, e.g., ros2 topic --help.