i have ready to test my ArduRover for connect ROS2(HW = AGX Orin on JP6, Cube Orange, custom build Rover and SW Ubuntu 22.04, ROS Humble, last dev firmware for ArduRover).
AGX Orin is connected to Cube Orange by two serial ports (USB FTDI 232 converters), the first provides MAVROS connection for Mission Planner via WiFi and the second is set for DDS XRCE), both are at 921600 Bd speed and functional. After install Ardupilot ROS2 packages , I tried the first connection via XRCE DDS, unfortunately it was unsuccessful, with an error that I donât understand âSerial port not found.(error 2)â
The run command looked like this âros2 run micro_ros_agent micro_ros_agent serial --baudrate 921600 --dev ./dev/ttyUSB1â.
If I set this port âttyUSB1â for Mavlink 2 it works without problem.
Itâs my first attempt to use XRCE DDS and Iâm not a big expert on ROS2, itâs my hobby, where the goal is autonomous exploration of an unknown environment.
Is it reasonable to physically test this now, considering the stage of development?
âŚthe result is test yes but without 100% success, DDS Client on OrangeCube would not send data serial portâŚ
I will document the results for illustration.
Yea compile warnings are expected till upstream library changes are made to allow weak references. It shouldnât impact the behavior. Looks like you did everything else fine. Did you see libraries/AP_DDS/README.md, there is a section on the bottom about deploying to a Pixhawk6X. You can adapt it easily to Cube Orange or other hardware. As explained in the README, itâs easiest to test DDS on USB Serial because you donât have to worry if you messed up wiring.
Thanks for reply,
SERIAL1-5 i tested via Mavlink2 protocol(test connect to MP), build with settings â./waf configure ==board OrangeCube ==enable-ddsâ(by upload FW i get âDDS_ENABLE=1â in parameters).
On OrangeCube this FW works fine without internal microros client.
I tested actual master branch and you fork branch from github, both had the same behavior.
Is there any other idea why there is this error?
Hi @lalal2017, just seen this referenced from another thread. Not sure if you have resolved, if so please ignore.
Itâs not clear from your terminal output and commands in text which USB ports you have assigned. The text uses /dev/ttyUSB1 and the terminal screenshot /dev/ttyUSB0.
Connect a mavproxy session to the port assigned to SERIAL0 and monitor the output. This should show the status of the DDS connection, whether it is initialised and the status of each of the topics as they are created.
mavproxy.py --master /dev/ttyUSB0`
assuming /dev/ttyUSB0 is SERIAL0.
Then run the micro-ROS agent
cd ~/ardupilot/library/AP_DDS
ros2 run micro_ros_agent micro_ros_agent serial --baudrate 921600 --dev /dev/ttyUSB1 --refs dds_xrce_profile.xml -v6
Then reboot from within mavproxy
MANUAL> reboot
What to you see in each of the terminals? (paste the command and output as text into your reply, exactly as they occur).
Hello Rhys,
thank you for your interest in solving the problem, but I am constantly testing this, then without clear success.
Anyway, I compiled a new build from master again with âCubeOrangeâ and âenable-ddsâ parameters, I used âserial1â from pixhawk (USB connected to AGX Orin, I tested via âmavlinkâ with success and then switched to âDDS_XRCEâ as follows performed a reboot). Unfortunately, the situation is the same, no packet from pixhawk. The result is on the attached picture.
@lalal2017 - I suspect that you are trying to connect the micro-ROS agent to the serial port outputting mavlink. You need to document exactly what youâre doing though for us to help.
What serial ports from the cube orange are connected to the companion computer
What are the device names of the ports
What parameters are configured for the serial ports
Command line used to start mavproxy
Output from mavproxy when the flight controller is rebooted
Command line used to start micro-ROS
Output from the micro-ROS terminal
Donât provide screen shots of the terminals, instead capture the terminal text and past and format as:
What device is the console / mavlink mapped to? (/dev/ttyUSB1 ?)
What is the output from mavproxy when connected to the console serial device?
You should lower the baud rate to 115200 as has been suggested above.
Have you tried connecting the flight controller to your PC, and getting it set up on an standard Ubuntu machine (i.e. remove possible config issues with the companion computer)?
âŚmy problem solved, micro_ros_agent running properly, it works correctly only if Iâm connected at the same time and running âmavproxyâ on another serial portâŚ
In order to cause the problem, with the same configuration, just turn off mavproxy and reboot CubeOrange.
My current CubeOrange settings are âserial5-mavlink2-921600â(for MAVPROXY) and âserial1-DDS_XRCE-921600â(for AP_DDS).
SBC AGX Orin uses â/dev/ttyUSB0â for (micro_ros_agent) and â/dev/ttyUSB1â for (MAVPROXY).
I have a question, why do I have to have âmavproxyâ running for my AP_DDS connection to work?
If I donât currently have âmavproxyâ connected to CubeOrange via serial1 port and âDDS_XRCEâ via serial2 port to SBC AGX Orin, I donât have data from AP_DDS.
Is there any reason for such dependence on the current connection?
Itâs simple, if âmavproxyâ is not connected to Cube Orange, micro ros client in Cube Orange does not work and micro_ros_agent in SBC does not receive anything.
So just run micro_ros connect and stop or disconnect âmavproxyâ.
Thatâs why the person who used the SITL scheme didnât have a problem, because he had to have âmavproxyâ enabled, but I donât need it for anything at all, so all my first tests were doomed to failure. Now until there is a fix, I will run âmavproxyâ and I can finally try to create my services for ROS2.
âŚnew refresh about this problem âŚ
âmavproxyâ must be connected only for the first start of âmicro_rosâ.
After the successful connection of âmicro_rosâ, it is possible to close âmavproxyâ and âmicro_rosâ continues to run perfectly correctly without any problems.
It is also possible to close âmicro_ros_agentâ and start it again and it runs correctly again without any problems.
What really surprised me was the behavior after the OrangeCube reboot, if I donât end the âmicro_ros_agentâ run on the SBC and then ârebootâ the CubeOrange, the communication starts again correctly even without the âmavproxyâ run.
The difference occurs if I close âmicro_ros_agentâ on the SBC and perform a ârebootâ of CubeOrange without running âmavproxyâ and start the âmicro_ros_agentâ again on the SBC, the ROS2 communication is without data.
So only for the first correct start of âmicro_ros_agentâ a functional âmavproxyâ connection is required, then âmavproxyâ can be terminated.
Hopefully this contribution will help everyone who is now trying to start ROS2 communication with ADUPILOT in real conditions without SITL simulation.
Thanks for the reply, I have continued to better identify the given problem.
The main obstacle turned out to be the need to reboot âCubeOrangeâ after starting âmicro_ros_agentâ on the SBC. Otherwise, data transfer from âmicro_ros_clientâ to âCubeOrangeâ simply does not work.
It never works without this.
A possible problem is that I turn on SBC and âCubeOrangeâ at the same time, SBC is online significantly later than âCubeâŚâ.
So when the âCubeâŚâ is started, the online âmicro_ros_agentâ is never present on the SBC.
It is interesting that if I have successfully connected the first âmicro_rosâ and ended the âmicro_ros_agentâ on the SBC, the restart will take place without the need to reboot the âCubeâŚâ.
This behavior does not depend on the âmavrosâ or âMPâ connection status.
In order for it to always start properly after the first âmicro_rosâ connection, I must be the first active âmicro_ros_agentâ before starting âCubeâŚâ, during the next connection (if I do not turn off âCubeâŚâ) a reboot is not necessary.
I am attaching the connection diagram on which I am testing.
I use the âmavrosâ connection for the ROS2 node and as a UDPCI proxy for âMPâ.
I reboot via the âMPâ reboot button in the compass settings section.
Hi, I am working on a Ros2 Project * I am working on a ROS2 project. In this project I am trying to connect a companion computer to an ardupilot flight controller using XRCE-DDS.
This is my first time working with xrce dds. I am running into problems regarding the communication and accessing sensor data and publishing it. It will be a great help if you can guide me on this and also how to look into these kinds of issues.
What I did was , With the help of gen tool and .idl file I was able to generate a C code. After that I compiled it and made the file to an executable. So after this when I try to run the code in the terminal, It is taking some time and returning " error in creating a session".
Also am i going through the right procedure?
This describes how to get set up with currently supported messages and there are notes in the library README about how to add further messages (if you are running your own fork of ArduPilot).