robomaster_ros icon indicating copy to clipboard operation
robomaster_ros copied to clipboard

Robomaster does not connect to ROS2 humble on WSL2

Open Ploty32 opened this issue 1 year ago • 1 comments

Good afternoon. Help please soon I have a diploma, and the project is not ready. Because ROS2 does not see the robot Robomaster EP or S1 (I am confused in them), although it is written, as soon as your robot and PC will be on the same network, you can execute the command <ros2 launch robomaster_ros {s1|ep}.launch> and everything will work. And nothing works because it can't see the robot.
I installed wsl2 for windows 11, Ubuntu 22.04 distribution, installed ROS2 humble, all packages using colcon built fine. I run the file from RobomasterSDK 05_conn_helper.py on windows to display the QR code to connect Robomaster. Yes, and it is not clear what the result will be, as there are no screenshots. I would at least like to see a video about the product in this repository. Thanks in advance) P.S. Docker's having the same problem.

Ploty32 avatar Apr 25 '24 07:04 Ploty32

Hi @Ploty32,

this is what I suggest to debug connection issues:

  1. Use the official robomaster app to connect to the robot: https://www.dji.com/ch/downloads/djiapp/robomaster Follow the official instructions they provide. If this step does not work, nothing will.
  2. If you could connect using the app, try with Python SDK. Follow the example at https://robomaster-dev.readthedocs.io/en/latest/python_sdk/connection.html or execute one of the example script, like https://github.com/dji-sdk/RoboMaster-SDK/blob/master/examples/01_robot/05_sta_conn.py. Pay attention to use the correct method (ap or sta, read more in the docs linked above)
  3. If you could connect via SDK, nothing prevents using ROS2. Again, pay attention to the connection mode and specify the correct one in the launch file
ros2 launch robomaster_ros main.launch conn_type:=<ap or sta>

It it connects, it will log it on the console. Else it will complain that it could not find a robot to connect.

jeguzzi avatar Apr 25 '24 07:04 jeguzzi