diff --git a/docs/icub-ergocub_ros2/index.md b/docs/icub-ergocub_ros2/index.md index 0168d8696..73bf4a1df 100644 --- a/docs/icub-ergocub_ros2/index.md +++ b/docs/icub-ergocub_ros2/index.md @@ -1,32 +1,43 @@ -# Using `iCub` and `ergoCub` with ROS2 -This page centralises different resources showing how to control `iCub` and `ergoCub` using ROS2. +# Using `iCub` and `ergoCub` with ROS 2 +This page centralises different resources showing how to control `iCub` and `ergoCub` using ROS 2. !!! info - As the last supported **ROS 1** distribution (ROS Noetic Ninjemys) is reaching its End of Life (EOL) on May 2025, with the distro release [`v2024.11.1`](../sw_versioning_table/2024.11.1.md) ROS1 support was deprecated. + As the last supported **ROS 1** distribution (ROS Noetic Ninjemys) is reaching its End of Life (EOL) on May 2025, with the distro release [`v2024.11.1`](../sw_versioning_table/2024.11.1.md) ROS 1 support was deprecated. ## Overwiew -Make sure that you read [YARP's documentation about ROS](https://yarp.it/latest/group__nws__and__nwc__architecture.html#autotoc_md58). All the YARP [Network Wrapper Server (NWS) and Network Wrapper Client (NWC)](https://www.yarp.it/latest//group__nws__and__nwc__architecture.html) devices that use ROS 2 can be found under [`yarp-devices-ros2`](https://github.com/robotology/yarp-devices-ros2) repository. -`yarp-devices-ros2` contains the devices and utilities for YARP-ROS2 compatibility. The devices are in the form of NWS/NWC that read and/or write information from ROS2 topics and make them available via the YARP API. Starting from the distro [`v2024.11.1`](../sw_versioning_table/2024.11.1.md), it could be compiled within the robotology-superbuild by enabling the `ROBOTOLOGY_USES_ROS2` CMake option . +`yarp-devices-ros2` contains the devices and utilities for YARP-ROS 2 compatibility. The devices are in the form of NWS/NWC that read and/or write information from ROS 2 topics and make them available via the YARP API. Starting from the distro [`v2024.11.1`](../sw_versioning_table/2024.11.1.md), it can be compiled within the robotology-superbuild by enabling the `ROBOTOLOGY_USES_ROS2` CMake option . ## Publishing `iCub/ergoCub`'s joints state: the `controlBoard_nws_ros2` module ### Modules description -`controlBoard_nws_ros2` is the controlBoard network wrapper server for ROS2. As per the controlBoard_nws_yarp, this device can be used to publish the joint position information on ROS2 topics instead of YARP ports. The device uses the [yarpDeviceParamParserGenerator](https://yarp.it/latest/group__yarpDeviceParamParserGenerator.html) and [here](https://yarp.it/latest/classControlBoard__nws__ros2__ParamsParser.html) there is the list of the required parameters. +`controlBoard_nws_ros2` is the controlBoard network wrapper server for ROS 2. As per the `controlBoard_nws_yarp`, this device can be used to publish the joint position information on ROS 2 topics instead of YARP ports. The device uses the [yarpDeviceParamParserGenerator](https://yarp.it/latest/group__yarpDeviceParamParserGenerator.html) and [here](https://yarp.it/latest/classControlBoard__nws__ros2__ParamsParser.html) there is the list of the required parameters. ### Using `controlBoard_nws_ros2` -The module can be activated using an `xml` file, for example this `alljoints-mc_nws_ros2.xml`: +The NWS/NWC for YARP and ROS 2 are organized into separate wrappers. In this way, it is possible to attach multiple wrappers to the same device, so a `controlBoard_nws_yarp` for YARP and a `controlBoard_nws_ros2` for ROS 2, and include them to the same configuration file used to launch the yarprobotinterface. + +#### ergoCub + +All ergoCub robots have the configuration files to enable this module under [robots-configuration](https://github.com/robotology/robots-configuration) repository. The way to activate them is to run the yarprobotinterface of the robot with the following option: + +```sh +yarprobotinterface --enable_tags "(enable_ros2)" +``` + +#### iCub + +For iCub robots, instead, the module can be activated using an `xml` file, for example this `alljoints-mc_nws_ros2.xml`: ```xml - ergocub_cb_node + icub_cb_node /joint_states alljoints-mc_remapper @@ -35,16 +46,17 @@ The module can be activated using an `xml` file, for example this `alljoints-mc_ ``` -With this kind of file, the positions of all the joints specified in the `alljoints-mc_remapper` are published on the `/joint_states` ROS2 topic. +!!! warning + Not all iCub configuration files have been modified to support ROS 2. If you didn't find those files within your robot name folder under `robots-configuration`, please don't hesitate to open an issue [here](https://github.com/robotology/robots-configuration/issues). -More in particular, this file is meant to be used as part of the same `yarprobotinterface` with which you launch the robot. To include it among the devices that you launch with it, you should modify the `ergocub_all.xml`/`icub_all.xml` (or any file that is launched with your `yarprobotinterface` when you launch the robot) to include the line: +With this kind of file, the positions of all the joints specified in the `alljoints-mc_remapper` are published on the `/joint_states` ROS 2 topic. + +More in particular, this file is meant to be used as part of the same `yarprobotinterface` with which you launch the robot. To include it among the devices that you launch with it, you should modify the `icub_all.xml` (or any file that is launched with your `yarprobotinterface` when you launch the robot) to include the line: ```xml ``` -Moreover, the NWS/NWC for YARP and ROS2 are organized into separate wrappers. In this way, it is possible to attach multiple wrappers to the same device, so a `controlBoard_nws_yarp` for YARP and a `controlBoard_nws_ros2` for ROS2, and include them to the same configuration file used to launch the yarprobotinterface. - ## xcub-moveit2 -[`xcub-moveit2`](https://github.com/icub-tech-iit/xcub-moveit2) contains ROS2 packages to control a YARP-based robot (iCub/ergoCub) with MoveIt2 platform. Check it out [here](https://github.com/icub-tech-iit/xcub-moveit2/blob/master/README.md) for more details. +[`xcub-moveit2`](https://github.com/icub-tech-iit/xcub-moveit2) contains ROS 2 packages to control a YARP-based robot (iCub/ergoCub) with MoveIt2 platform. Check it out [here](https://github.com/icub-tech-iit/xcub-moveit2/blob/master/README.md) for more details. diff --git a/docs/icub_sw.md b/docs/icub_sw.md index f2afc6cf4..67aaba185 100644 --- a/docs/icub_sw.md +++ b/docs/icub_sw.md @@ -15,7 +15,7 @@ - [`Standard Calibration Types`](./robot_calibration_types/standard_calibration_types.md) - [`iCub 3 Calibration Types`](./robot_calibration_types/icub3_calibration_types.md) - [`Configure IP on a setup for ETH boards`](./configure_static_ip/configure-static-ip.md) -- [`Using iCub/ergoCub with ROS2`](./icub-ergocub_ros2/index.md) +- [`Using iCub or ergoCub with ROS 2`](./icub-ergocub_ros2/index.md) - [`iCub Force Control`](./icub_force_control/icub-force-control.md) - [`Sensor Interfaces`](./robot_sensors/index.md) - [`Tactile Sensors`](./tactile_sensors/index.md) diff --git a/mkdocs.yml b/mkdocs.yml index e1ad93eec..16a30b614 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -301,7 +301,7 @@ nav: - Encoders and Joint limits (manual): icub_testing/encoders_manual.md - Configure IP on a setup for ETH boards: - Configure IP on a setup for ETH boards: configure_static_ip/configure-static-ip.md - - Using iCub/ergoCub with ROS2: icub-ergocub_ros2/index.md + - Using iCub or ergoCub with ROS 2: icub-ergocub_ros2/index.md - iCub Force Control: icub_force_control/icub-force-control.md - Sensor interfaces: - Summary: robot_sensors/index.md