How frankarobotics/franka_ros2 works
Project type and purpose
• This is a multi‐package ROS 2 integration repository (“franka_ros2”) providing hardware drivers, controllers, message definitions, simulation glue, and MoveIt! configuration for the Franka Research robotic arm.
• Its goal is to expose libfranka functionality as ROS 2 nodes, services, actions, and topics, support both real and simulated robots (Gazebo and Ignition), and enable motion planning via MoveIt!.
High-level file-structure analysis
• Top-level build orchestration:
• Dockerfile, docker‐compose.yml, .devcontainer/ → containerized dev/build environment.
• Jenkinsfile, .github/workflows/ci.yml → CI pipeline.
• ROS 2 packages:
• franka_msgs → custom ROS 2 message/service/action definitions.
• franka_hardware → ROS 2 Control hardware interface and action server.
• franka_gripper → gripper action server and fake state publisher.
• franka_robot_state_broadcaster → state‐publisher node for robot_state.
• franka_semantic_components → C++ semantic interfaces (Cartesian pose, velocity, state).
• franka_example_controllers → sample controllers (joint/cartesian) as ROS 2 Control plugins.
• franka_bringup → launch files and configurations to start the robot.
• franka_fr3_moveit_config → MoveIt! config & planners.
• franka_gazebo & franka_gazebo/franka_ign_ros2_control → simulation‐specific launch files, Ignition/Gazebo control plugins.
• integration_launch_testing → end‐to‐end launch tests in Python.
a. Container/host environment
• Docker/DevContainer encapsulating ROS 2 Humble, colcon build, libfranka, dependencies.
b. ROS 2 DDS communication mesh
• Nodes communicate over topics, actions, and services.
c. Hardware abstraction layer
• franka_hardware (implements ros2_control HardwareInterface)
• Action servers exposing real‐time commands to arm & gripper.
d. Semantic & state layers
• franka_robot_state_broadcaster publishes sensor_state → topics
• franka_semantic_components subscribe to state and offer high‐level interfaces.
e. Controllers
• franka_example_controllers loaded via ros2_control → subscribe to state, publish commands.
f. Motion planning
• franka_fr3_moveit_config (MoveGroup node → planning pipelines → execution via ros2_control).
g. Simulation
• franka_gazebo / ign plugin replacing hardware with Gazebo/IGN System plugin.
h. Integration tests
• launch_testing harness invoking brings‐up, controllers, services, verifying end‐to‐end behavior.
Relationships & data-flow
• User/API layer (ros2 launch CLI or RViz) → Launch files in franka_bringup and MoveIt! → brings up nodes
• franka_hardware ↔ libfranka (UDP/TCP driver) → robotic arm hardware
• franka_gripper → Franka gripper driver or fake publisher
• ros2_control controller manager loads example controllers → command interfaces → hardware interface
• franka_robot_state_broadcaster subscribes to hardware interface topics → republishes on standard /joint_states or custom topics
• franka_semantic_components subscribe to state topics → provide semantic messages to application code
• MoveGroup node → planning requests → action to execute trajectory → publishes commands to controller_manager
• In simulation mode, hardware interface is replaced by franka_gazebo/franka_ign_ros2_control plugin
• All inter‐node comms use ROS 2 topics/services/actions over DDS
Architectural patterns & principles
• Modular ROS 2 node‐per‐responsibility pattern (separation of concerns)
• Plugin architecture via ros2_control for runtime‐loadable controllers
• Message‐driven, decoupled via DDS (topic/action/service)
• DevOps via containerization (Docker/DevContainer) and CI pipelines
• Test‐driven integration via launch_testing