diff --git a/example_1/doc/ros2_control_demo_example_1.png b/example_1/doc/ros2_control_demo_example_1.png new file mode 100644 index 000000000..e39508112 Binary files /dev/null and b/example_1/doc/ros2_control_demo_example_1.png differ diff --git a/example_1/doc/userdoc.rst b/example_1/doc/userdoc.rst index b14705c52..1e21efe9b 100644 --- a/example_1/doc/userdoc.rst +++ b/example_1/doc/userdoc.rst @@ -21,6 +21,77 @@ The *RRBot* URDF files can be found in the ``description/urdf`` folder. .. include:: ../../doc/run_from_docker.rst + +RRBot Architecture Overview +--------------------------- + +.. image:: ros2_control_demo_example_1.png + :width: 600 + :align: center + :alt: ROS 2 Control Demo Example 1 Architecture Overview + +This section provides an overview of how **ROS2 Control** components interact in *Example 1 (RRBot System Position Only)*. It summarizes the relationship between the hardware interface, controllers, and the robot’s URDF. + +A custom hardware interface ``RRBotSystemPositionOnlyHardware`` is implemented in: +``ros2_control_demo_example_1/rrbot_hardware_interface.cpp`` + +This hardware plugin: + +- Inherits from ``hardware_interface::SystemInterface`` +- Defines how to **read joint positions** (from hardware, simulated here) +- Defines how to **write commands** (set joint positions) +- Is registered in a ``plugin.xml`` file so the **ResourceManager** can load it + +From the UML: + +- ``hardware_interface::SystemInterface`` → implemented by the RRBot hardware plugin +- ``hardware_interface::ResourceManager`` → manages your hardware plugin after loading it + +The robot description is defined in: +``rrbot.urdf.xacro`` + +The URDF contains: + +- Links and joints of the robot +- A ```` tag specifying which hardware plugin to load + +When launched, **ros2_control** reads this URDF and knows: + +- Which joints exist +- Which hardware plugin provides those joints + +From the UML: + +- ``robot_config (URDF)`` → parsed into **``hardware_interface::HardwareInfo``** and passed to **ResourceManager** + +The ``controller_manager::ControllerManager`` is the core ROS2 node. + +Responsibilities: + +- Loads your hardware plugin (via **ResourceManager**) +- Loads and manages controllers (defined in a YAML config file) + +From the UML: + +- ``controller_manager::ControllerManager`` → central node +- Uses ``controllers_config (YAML)`` and ``robot_config (URDF)`` to configure everything + +**Forward Command Controller** + +- ``forward_position_controller`` (from ``forward_command_controller`` package) +- Directly forwards position commands to the hardware interface + +**Joint State Broadcaster** + +- Publishes ``/joint_states`` +- Allows visualization of the robot in RViz + +From the UML: + +- ``controller_interface::ControllerInterface`` → base class for controllers +- ``forward_command_controller::ForwardCommandController`` → used in this demo +- ``joint_state_broadcaster::JointStateBroadcaster`` → publishes joint states + Tutorial steps -------------------------- @@ -501,3 +572,14 @@ Controllers from this demo * ``Joint State Broadcaster`` (`ros2_controllers repository `__): :ref:`doc ` * ``Forward Command Controller`` (`ros2_controllers repository `__): :ref:`doc ` * ``Joint Trajectory Controller`` (`ros2_controllers repository `__): :ref:`doc ` + + + +Additional Resources for this demo +---------------------------------- +* `UML Class Diagram of example_1 `__ a visual representation of the RRBot hardware interface architecture. + +* `Summary Explanation of example_1 `__ a step-by-step explanation of the demo’s architecture and component interaction. + + +