Hi again, @loickchovet,
After talking to Gabriel it was found that the DDS connection really didn’t work.
I would suggest trying the connection using Zenoh then, to see if it works.
The 13 steps to test Zenoh are the following, to be followed in order, to make sure everything is correctly set:
-
Run on the robot the installation script provided by The Construct
-
Connect to the robot by pressing the Connect button.
-
Make sure you can ping the robot, using either “ping master
”, or “ping leo01
”. (Assuming the robot name is leo01. You can check the robot name using “cat /etc/hosts
” on the rosject after the connection is established. Try to ping the rosject from the robot also. Type “hostname
” on the rosject to see the rosject hostname, to be able to ping it from the robot.
-
Install “zenoh-bridge-ros2dds
” on the ROSJECT using the three commands below:
echo "deb [trusted=yes] https://download.eclipse.org/zenoh/debian-repo/ /" | sudo tee -a /etc/apt/sources.list > /dev/null
sudo apt-get update
sudo apt install -y zenoh-bridge-ros2dds
- Install “
zenoh-bridge-ros2dds
” also on the ROBOT, using the same commands:
echo "deb [trusted=yes] https://download.eclipse.org/zenoh/debian-repo/ /" | sudo tee -a /etc/apt/sources.list > /dev/null
sudo apt-get update
sudo apt install -y zenoh-bridge-ros2dds
-
On the ROSJECT, check the hostname using the “hostname
” command.
-
On the ROBOT, create a file named “zenoh_leo.json
” with the following content:
{
plugins: {
ros2dds: {
domain: 0,
allow: {
publishers: ["/chatter"],
subscribers: [],
service_servers: [],
service_clients: [],
action_servers: [],
action_clients: [],
},
},
},
connect: {
endpoints: [
"tcp/2_xterm:7447",
]
}
}
-
On the 4th last line of the “zenoh_leo.json
” file aforementioned, replace 2_xterm with the hostname of the rosject retrieved on the 6th step.
-
Run the “zenoh-bridge-ros2dds
” on the ROBOT using the following command:
zenoh-bridge-ros2dds -c zenoh_leo.json
- Now, on the rosject, create a “
zenoh_rosject.json
” file with the following content:
{
plugins: {
ros2dds: {
domain: 1,
allow: {
publishers: [],
subscribers: ["/chatter"],
service_servers: [],
service_clients: [],
action_servers: [],
action_clients: [],
},
},
},
connect: {
endpoints: [
"tcp/master:7447",
]
},
}
- Run “
zenoh-bridge-ros2dds
” on the ROSJECT using the following command:
zenoh-bridge-ros2dds -c zenoh_rosject.json
- Now, on the ROBOT, run the talker on domain 0:
ROS_DOMAIN_ID=0 ros2 run demo_nodes_cpp talker
- Now, on the ROSJECT, run the listener on DOMAIN 1 (YES, DOMAIN 1. When using Zenoh, the domains have to be different to make sure the connection is through Zenoh and not through DDS).
ROS_DOMAIN_ID=1 ros2 run demo_nodes_cpp listener
Now, after a few seconds, you should see messages being printed on the ROSJECT. If you see the messages, it is proved that the connection works through Zenoh but not through DDS.
Can you tell us if the listener on the rosject is able to see the messages coming from the talker on the robot?