ROS 2 (Robot Operating System 2) is an open-source development platform for robots that provides a collection of tools, libraries, and conventions for building complex robotic systems. It is an evolution of ROS 1, designed to overcome the limitations of its predecessor and address new needs in the field of robotics. ROS 2 enhances aspects such as real-time communication, security, reliability, and scalability, using a middleware based on DDS (Data Distribution Service) that facilitates interoperability and performance in distributed systems. Additionally, ROS 2 is highly modular and flexible, allowing developers to integrate different components and adapt to various environments and robotic applications.
- Main source: ROS Humble Tutorials
Study all the contents:
The main source link provides a portal that will help you understand everything about ROS 2, from what it is and how to install it, to tutorials ranging from beginner to advanced levels of usage. The most important details and concepts are:
DDS-Based Architecture: Utilizes DDS (Data Distribution Service) for communication between nodes, enhancing flexibility, scalability, and real-time capability.
Modularity and Flexibility: ROS 2 is designed to be modular, allowing developers to choose and integrate components according to the specific needs of their application.
Security: ROS 2 introduces security features such as authentication, authorization, and encryption to secure communication between nodes.
Compatibility with Distributed Systems: Designed to operate in distributed systems, facilitating operation across multiple machines and heterogeneous environments.
Interoperability: Facilitates integration with other systems and technologies, enabling developers to build more robust and versatile solutions.
Runs a node from a specific package.
ros2 run <package_name> <executable_name>
Lists all active nodes in the system.
ros2 node list
Displays information about a specific node.
ros2 node info <node_name>
Lists all active topics.
ros2 topic list
Displays messages being published on a topic.
ros2 topic echo <topic_name>
Publishes a message on a topic.
ros2 topic pub <topic_name> <message_type> <message_data>
Lists all available services.
ros2 service list
Calls a service with a specific request.
ros2 service call <service_name> <service_type> <request>
Displays the type of a service.
ros2 service type <service_name>
Lists all parameters of a node.
ros2 param list
Gets the value of a specific parameter.
ros2 param get <node_name> <parameter_name>
Sets the value of a parameter.
ros2 param set <node_name> <parameter_name> <value>
Lists all available actions.
ros2 action list
Sends a goal to an action.
ros2 action send_goal <action_name> <goal_data>
Displays details of an action.
ros2 action show <action_name>
Compiles the packages in the workspace.
colcon build
Runs the tests for the packages.
colcon test
Displays the test results.
colcon test-result
These aspects and commands form the foundation of working with ROS 2, enabling developers to effectively manage nodes, topics, services, parameters, and actions within their robotic systems.