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).