How ifra-cranfield/ros2_robotsimulation works
Main Components Identification
• ROS2 Core Environment – Representing the ROS2 Foxy runtime and core communication (topics, parameters, services, actions).
• Robot Simulation Packages – These are grouped by robot manufacturer and type. For each robot (e.g., ABB IRB120, ABB IRB1200, ABB IRB6640, UR3, UR5, UR10, Fanuc CR35iA, Kuka LBRiiwa, Panda), you have two main subpackages:
– Gazebo simulation package (often labeled xxx_ros2_gazebo) which contains configuration files, launch scripts, meshes, URDF/XACRO files, and world files used to simulate the physical robot.
– MoveIt2 control package (often labeled xxx_ros2_moveit2) which contains configuration and launch files relating to planning, kinematics, controller integration, and visualization.
• ROS2 Action & Data Infrastructure:
– ros2_data: Contains custom message and action specification files.
– ros2_actions: Contains action servers (written in C++ and Python) that translate external commands into robot movements.
– ros2_execution: Orchestrates the sequencing of commands across different action servers using input program (TXT files) and provides a higher-level control logic.
– ros2_grasping: Provides additional functionality related to grasping (attaching/detaching objects, spawning them in simulation).
• Supporting Components:
– “include” directory contains shared code (e.g., an improved move_group_interface) which likely wraps or adapts MoveIt2 APIs to support multiple robots.
Relationships and Interactions
• At the Heart: The ROS2 core manages communication between nodes spread across all packages.
• Simulation and Control:
– Each robot-specific simulation package (Gazebo) runs a ROS2 node that simulates physics and robot dynamics.
– The corresponding MoveIt2 package provides planning and motion execution functionalities which communicate with the Gazebo nodes (often via ROS2 controllers and ros2_control interfaces).
• Action Execution Flow:
– The ros2_execution package acts as an orchestrator that reads a sequence of actions from an input file.
– It sends requests (commands) to the various action servers defined in ros2_actions.
– These action servers use the definitions from ros2_data to trigger robot motions.
– Feedback from robot movement, simulation state, and any grasping events (facilitated by ros2_grasping) are circulated back to the orchestration level.
Architectural Patterns and Design Principles
• Modularity: The entire repository is modular—each robot simulation is self-contained and follows a similar structure, easing expansion.
• Separation of Concerns:
– Simulation is separated from planning/control.
– Execution sequencing, action servers, and custom data definitions are neatly split into separate packages.
• Reusability: The enhanced move_group_interface (in include) implies an effort toward creating common utilities that work across different robot simulations.
• Consistency: All packages follow common naming and directory conventions, making the system scalable and maintainable.
Technologies, Frameworks, and Libraries
• ROS2 Foxy: The underlying middleware that connects all nodes.
• Gazebo: For realistic physics simulation.
• MoveIt2: For motion planning and manipulation control.
• ROS2 Control and Controllers: For managing low-level actuation.
• xacro/URDF: For robot model description.
• C++ and Python: For action servers (ros2_actions) and execution scripts (ros2_execution).
Essential Elements
• “ROS2 Core / Middleware”
• “Robot Simulation (Gazebo)” with subcomponents per robot type.
• “Robot Motion Control (MoveIt2)” per simulation package.
• “ROS2 Data Definitions (ros2_data)”
• “Action Servers (ros2_actions)”
• “Execution Sequencer (ros2_execution)”
• “Grasping Module (ros2_grasping)”
• “Shared Utilities (include)”
• Feedback loops from simulation back to execution.
• Control signals from MoveIt2 to ROS2 Control that interact with Gazebo nodes.