Transitioning to ROS2 Components for Enhanced Modularity and Efficiency
10 April 2024
This project explores the advanced programming paradigm introduced in ROS2, focusing on converting traditional ROS2 nodes into components for a more modular and efficient design. The RB1 robot, simulated within a warehouse environment, serves as the platform for this exploration. Through the conversion of previously developed nodes into components, this project not only demonstrates the practicality of component-based programming in ROS2 but also evaluates the advantages and limitations of this approach in comparison to traditional node-based programming.
The development process is structured around the conversion of existing ROS2 nodes from this previous entry into components, specifically focusing on the tasks of pre-approaching and attaching the RB1 robot to a warehouse shelf.
The project initiates by creating a new branch named composition
in the existing repository and introducing a new ROS2 package called my_components
. The first step involves converting the pre_approach.cpp
node into a new component named PreApproach
, which facilitates the robot’s initial movement towards the shelf.
Following the initial pre-approach phase, two new components, AttachServer
and AttachClient
, are developed to manage the final attachment process.
/approach_shelf
service, triggering the robot’s final approach to attach to the shelf using the manual-composition approach./approach_shelf
service, enabling the robot to initiate the final approach and attachment using the run-time composition approach.A launch file, attach_to_shelf.launch.py
, is created to facilitate the execution of these components, illustrating the practical deployment of component-based programming in ROS2.
Through the conversion of traditional nodes into ROS2 components, this project showcases a great example of programming modularity and efficiency. The RB1 robot’s successful shelf attachment within the simulated warehouse environment validates the effectiveness of component-based programming in ROS2, highlighting its potential for future robotic applications.