jeguzzi / ros-thymio

ROS driver for a Thymio robot running Aseba.
http://jeguzzi.github.io/ros-aseba/
BSD 3-Clause "New" or "Revised" License
4 stars 2 forks source link

Thymio MultiDriver ROS2 #1

Closed lueckhan closed 5 months ago

lueckhan commented 5 months ago

Hello, I followed your Tutorial/Documentation to use ROS2 with Thymio Robots. I used the aseba Playground simulation. With one robot everything worked (sending values over the cmd_vel topic via rqt or python script), but when I wanted to connect two robots, they did not respond. I used asebaswitch and the Thymio Multidriver to connect them. They get connected, the correct topics get created under two different namespaces (Thymio0 and Thymio1). Unfortunately whenever I sent values via thymio0/cmd_vel the robot does not respond. Is there any step I am missing when using multidriver? I would be very grateful for a reply! Kind regards

jeguzzi commented 5 months ago

Hi @lueckhan,

I just tried the configuration below:

Maybe the two thymios had the same nodeId in your setup? That would not work.

Note that there is an alternative to get the same result:

Let me know if the above does not work.

lueckhan commented 5 months ago

Hey, Thank you for your answer!

I did exactly as you described, but it did not work. The first way resulted in the ros2 topics being created, but publishing via the cmd_vel topic did not work. Screenshots1

Screenshots2

Unfortunately, The second way did not work because it says the port is busy. The Node ID is not the same for both robots. Screenshots3

I am using Ros2 humble and a VM with Ubuntu 2204 and the aseba version 2.4.0.

Could you tell me which versions you are using? Then I would create a fresh VM with the same versions as you.

Thank you so much for your help.

jeguzzi commented 5 months ago

I don't know why the first is failing but I know how to solve the second :-): you need to specify a different port for the two ros2 drivers, like

ros2 launch thymio_driver main.launch device:="tcp:host=localhost;port=33334" single:=True simulation:=True name:=thymio_1

and

ros2 launch thymio_driver main.launch device:="tcp:host=localhost;port=33335" single:=True simulation:=True name:=thymio_2 port:=44445

Sorry, I forgot to add this param in my first reply.

If you want to further investigate the first failure, please post the ros2 log file.

lueckhan commented 5 months ago

Hi,

Thank you so much for your reply! You really helped me! Both versions do work now. The Multi-Driver Version just has a delay when reacting to the messages.

I just have another question: I want to use the ROS2 Thymio on real Thymios and only use the Simulation for debugging. Is there any difference between the two versions (Multi-Driver and multiple instances of the Single Driver) and what would you recommend when using many real Thymios?

Have a nice day!

jeguzzi commented 5 months ago

Is there any difference between the two versions (Multi-Driver and multiple instances of the Single Driver) and what would you recommend when using many real Thymios?

It depends on the setup. If you have multiple wireless Thymios connected to the same dongle, then I would use the multi-driver. If the thymios are wired, or connected to different dongles, I would launch many instances of the single-driver. Mostly for simplicity and to avoid using asebaswitch, as both option should be fine for real robots too.

lueckhan commented 5 months ago

All right, thank you very much for your help!