Developing and Deploying Advanced ROS2 Services and Actions for Robot Control
24 March 2024
This project stands as a culmination of the skills and knowledge acquired in the ROS2 Basics course, applied to both a simulated and a real-world scenario using the Turtlebot3 robot. It highlights the transition from simulation to real-world application, involving the development of ROS2 services and actions to control the robot’s navigation in a given environment. The project underscores the capability to operate the robot remotely, executing tasks in Barcelona, Spain, from a simulation environment, thereby showcasing the power of ROS2 in robotics development.
The project’s execution was divided into two primary tasks, each focusing on different aspects of robot control through ROS2.
Simulation Setup: Commenced with launching the Turtlebot3 robot simulation in Gazebo, preparing the ground for developing navigation services.
Service Development: Created a ROS2 service server in C++ (direction_service.cpp
) that receives laser data from the Turtlebot3 and analyzes it to determine the safest direction for the robot to move, enhancing its obstacle avoidance capabilities.
Integration with Patrol Behavior: Modified the existing patrol behavior script (patrol_with_service.cpp
) to include calls to the newly developed ROS2 service, allowing for dynamic obstacle avoidance based on real-time sensor data. After successfully testing the navigation node in simulation, it was deployed to the real robot.
Action Server Creation: Developed an action server (go_to_pose_action.cpp
) that accepts goal positions and navigates the Turtlebot3 to these locations using odometry and velocity commands, showcasing advanced robot control techniques.
Real-world Deployment: After rigorous testing in the simulation, the project was deployed to control a real Turtlebot3 robot. This involved remote connection and operation, demonstrating the practical application of ROS2 actions and services beyond a simulated environment.
The project successfully demonstrated the application of ROS2 services and actions in controlling the Turtlebot3 robot, both in simulation and in a real-world environment. It highlighted the capability of ROS2 to facilitate complex robotics operations, including navigation and obstacle avoidance, in diverse environments.