-
Notifications
You must be signed in to change notification settings - Fork 35
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add ROS2 documentation #379
Merged
pattacini
merged 10 commits into
icub-tech-iit:master
from
martinaxgloria:feat/ros2_doc
Dec 17, 2024
Merged
Changes from all commits
Commits
Show all changes
10 commits
Select commit
Hold shift + click to select a range
c604ee1
Add ros2 documentation
martinaxgloria 31775e4
Address requested changes
martinaxgloria eca3aea
Update docs/icub-ergocub_ros2/index.md
pattacini 136c908
Update docs/icub-ergocub_ros2/index.md
pattacini 786c957
Update docs/icub-ergocub_ros2/index.md
pattacini 0206a3b
Update docs/icub-ergocub_ros2/index.md
pattacini 8f109b1
Update docs/icub-ergocub_ros2/index.md
pattacini 25c5476
Update docs/icub-ergocub_ros2/index.md
pattacini 48a2e44
Update docs/icub-ergocub_ros2/index.md
pattacini 7ef941d
Update docs/icub-ergocub_ros2/index.md
pattacini File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
# Using `iCub` and `ergoCub` with ROS 2 | ||
|
||
!!! note | ||
We illustrate in this documentation how to control `iCub` and `ergoCub` **physical robots** using ROS 2 (simulation models are not covered). | ||
|
||
!!! 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) ROS 1 support was deprecated. | ||
|
||
## Overwiew | ||
|
||
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-ROS 2 compatibility. The devices are in the form of NWS/NWC that read/write information from/to 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), the devices can be built with `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 ROS 2. As per the `controlBoard_nws_yarp`, this device publishes the joint position information on ROS 2 topics instead of YARP ports. The device uses the [yarpDeviceParamParserGenerator](https://yarp.it/latest/group__yarpDeviceParamParserGenerator.html) with its list of [required parameters](https://yarp.it/latest/classControlBoard__nws__ros2__ParamsParser.html). | ||
|
||
### Using `controlBoard_nws_ros2` | ||
|
||
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 (`controlBoard_nws_yarp` for YARP, `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. To activate them, run the `yarprobotinterface` 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 | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<!DOCTYPE devices PUBLIC "-//YARP//DTD yarprobotinterface 3.0//EN" "http://www.yarp.it/DTD/yarprobotinterfaceV3.0.dtd"> | ||
|
||
<device xmlns:xi="http://www.w3.org/2001/XInclude" name="alljoints-mc_nws_ros2" type="controlBoard_nws_ros2"> | ||
<param name="node_name"> icub_cb_node </param> | ||
<param name="topic_name"> /joint_states </param> | ||
<action phase="startup" level="15" type="attach"> | ||
<param name="device"> alljoints-mc_remapper </param> | ||
</action> | ||
<action phase="shutdown" level="20" type="detach" /> | ||
</device> | ||
``` | ||
|
||
!!! 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 file an [issue](https://github.com/robotology/robots-configuration/issues). | ||
|
||
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. | ||
|
||
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 launched devices, you have to modify the `icub_all.xml` (or any file that is launched with your `yarprobotinterface`) to include the line: | ||
|
||
```xml | ||
<xi:include href="wrappers/motorControl/alljoints-mc_nws_ros2.xml" /> | ||
``` | ||
|
||
## xcub-moveit2 | ||
|
||
[`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. |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps we should explain that this just applies to real robots, while we could have a different section for simulated robots?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you mean the entire documentation or a specific paragraph?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
At least the paragraph it seems to me that it only applies to real robot, right? I am not sure about the rest of the documentation, but if also the rest it does only apply to real robots and not simulated ones, I think it may be worth mentioning it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe I'm wrong, but after reading the entire page I added it seems that it could be applied to both real and simulated robots. The only difference between the two it's the usage of
controlBoard_nws_ros2
since in simulation it is required to modify the urdf for passing the proper XML to the yri plugin (cc @Nicogene)There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Exactly. I may be wrong, but I am not sure this is step that is obvious for the target reader of this documentation (for example, I am afraid it would not be obvious that how "yarprobotinterface --enable_tags "(enable_ros2)" needs to be translated in the case of simulated robots, see also robotology/gz-sim-yarp-plugins#163 .
So either we document this, or we just clearly state that the documentation is just targeting real robots.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As far as I understand, the enable/disable_tags are not available for simulation models yet (correct me if I'm wrong). If it's so, I prefer to specify that the documentation refers to the real robots.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes they are not supported in gz-sim at the moment, any solution is fine for me.