-
Notifications
You must be signed in to change notification settings - Fork 13.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
microdds_client not working with real hardware #20634
Comments
I'm not sure if there's any useful information, but you could try launching the agent with more verbosity to see if it has anything helpful (-v4 I think). Have you tried pixhawk -> PC through serial for comparison? I'll give it a try myself later, but I did verify it during development earlier this year. |
I tried to launch it with
Does the data mean anything to you? In the meantime I have tried the same setup with a pixhawk 4 on the TELEM 2 port. The same problem persists. Is it correct to set MAV_1_CONFIG to Disabled and the XRCE_DDS_0_CFG to TELEM2? I will try to do the same with my development computer and post updates here. |
@dagar I have tried to do the same setup with my development computer running ubuntu 20.04 and ROS2 Galactic and I could make it work just fine. Therefore, the error must be somewhere on my companion computer setup. I have tried to reinstall the
Could this be part of my problem? |
After raising the issue on the agent side, I have managed to make the microdds_client to agent bridge communicate just fine using the Micro XRCE-DDS Agent instead of the micro-ros-agent. I was able to run an offboard example using HITL and commanding trajectory setpoints from the raspberry pi companion computer. One problem that remains is that I get a warning in the nuttShell saying: Does this have to do anything with the microdds_client? |
@Ecuashungo The microxrcedds agent you installed uses a superbuild cmake to fetch dependencies, it probably would have resolved the libfastrtps dynamic library issue. It looks like you had a newer version of libfastrtps installed. |
@Ecuashungo please, how do you start the microdds_client ? is it via mavlink? I am trying to do it but if I work with mavlink I can not simultaneously work with the xrce-dds birdge !! I tried to open the mavlink console in the QGroundControl, start the client, so I close the QGround and in the sequence I start the Agent. Following it I just have the following: [1676258724.774920] info | TermiosAgentLinux.cpp | init | running... | fd: 3 Looks like there is not any ROS topic being published. How do you manage it to see the topics? |
Hello , i 'm on the same situation. Impossible to see any topics. I'm on ubuntu 22.4 with humble. |
@ozitoune I managed to fix it as following (reference - #21120 (comment)): if you want to use TELEM1, you have to stop mavlink and then activate the microdds_client. You can do that changing the parameters: to use TELEM2 (ttyS3 of pixhawk): make sure your raspberrypi is correct connected to your pixhawk: It is not possible to configure XRCE_DDS_0_CFG = USB (/dev/ttyACM0 port of laptop) only for the pixhawk's TELEM, so it would not work on laptop via USB. |
Thank you, you're an angel !! I'm a little confused , AMA0 is when we use a fdti/usb adaptator? so if connect telem2 on a fdti adaptator then on a raspberry usb port it could be work ? in a raspbery is /dev/serial0 or /dev/ttyAMA0 ??? The best is to connect directly telem2 to raspbery tx and rx ? I have a pixhawk 6x so i would like to connect via ethernet but , i dont see where to tell the ip adress on Xrce client / agent, there is -p for the port but how to specify the host ? Another question Mavros is still usable ? There is a MAVROS / ROS2 page so perhaps it could be usable if i can't make it work with xrce. Thanks again !! |
@ozitoune you do not need a fdti/usb adapter in order to connect the pixhawk with raspberrypi. You can connect it in the raspberrypi IO pins directly. When you do it, you are working with the AMA0 in the raspberrypi (same as serial0). I think that mavlink is still working correctly, since you need it for communication in QGroundControl, so should not have problems with mavros. |
ok so if I understand I can run |
No, the correct is /dev/ttyAMA0. what did you mean by " you also need to configure the raspberry's serial port /dev/ttyAMA0." There are some tutorials better explaining the steps, like here: Double check if your pixhawk model have the same TELEM pins sequence as in the video. And do you have an idea if it's possible to connect directly my pixhawk 6x via ethernet on the raspbery and run the client / agent in udp4 with the ip adress of the raspberry /piwhaxk ? Thank you The communication is via pixhawk's TELEM, so the connection must be via tx/rx/ground pins . |
Thank you for the link !! It's not working but i'm happy , it's the first time i see the list of topics !! |
Great, my pixhawk does not have ethernet, so I only tested with TELEM. |
All topics works now !! only topics with the need off GPS don't publish data because i'm indoor. Do you know how to make the start off the xrce client automatic at px4 startup? |
Did you just plug the GPS and all the topics start to work or did you do anything else?
Looks like is not necessary to start client, as you can see here: |
@ozitoune congratulations for having microdds on UDP working on the Pixhawk! Let me start by answering to this
As you need to specify the agent address, you cannot do that from the PX4 parameters. However you can still start the client automatically using a custom startup file on the SD: https://docs.px4.io/main/en/concept/system_startup.html#starting-additional-applications-extras-txt just put As we are fixing up the new documentation for the microdds bridge I have a fer questions for you:
Just a few details for the serial connection:
You can have mavlink on
Yes, of course. Rearding using the serial protocol, you can perfectly use a fdti/usb adaptator, but the device name will be different, normally it is something like
It would definitively works but you may need to set the right permission to access the device on your raspberry. |
@ViniciusAbrao I have the gps connected and all topics are published out of the box, only the topic /fmu/out/failsafe_flags do nothing, no error , no message, i don't know why. @beniaminopozzan the client start automaticly now but when i start the agent, there is nothing, i have to stop the client then rtestart it to see the topics.
i start the agent via the i connect to the mavlink console via And now it work ! Edit : i forgot , as you said i have to set the right permission, i add my user to dialout group but the command
I also forget i put this parameter on qgroundcontrol : XRCE_DDS_0_CFG = ethernet (thanks vinicius for his help!)
I think it's what i have made to make it work, i will try to make a fresh install of this to see if i forgot a think.
But what is the difference off using fdti/usb and then plug into usb port of raspberry and directly plug the pixhawk on raspberry usb port ? I would like to move servo connected to my pixhawk from ros2 , i mean i have to publish on /fmu/in/vehicle_command but what i have to publish ? |
@ozitoune thanks for your feedback!
This is really interesting! I did not know PX4 has DHCP (and it is actually well documented! https://docs.px4.io/main/en/advanced_config/ethernet_setup.html#setting-up-the-ethernet-network, my mystake!)
If you are using your Raspberry just as companion computer, then you don't need PX4-Autopilot and all the build toolchain (namely, no arm-none-eabi-gcc is needed) and as you are using micro XRCE-DDS , even fast-rtp-gen is not needed (I mean this one https://docs.px4.io/main/en/dev_setup/fast-dds-installation.html#fast-rtps-gen is not needed)
you can limit the number of threads during compilation: see https://answers.ros.org/question/368249/colcon-build-number-of-threads/, the build command should be MAKEFLAGS="-j1 " colcon build --executor-sequential And eventually other
If you source the main ros packages and commands (
You should check whats the group of
Please, let me know if the sequence:
works. I just want to make sure you don't need the agent running before starting the client.
The Pixhawk USB port is tricky I'm still trying to figure out how it is configured, but to give you some reasons why it is more complicated that a TELEM port
You mean you want to do in ROS2 what you can do with MAVLINK? https://mavlink.io/en/messages/common.html#MAV_CMD_DO_SET_ACTUATOR If so, then the command message must be something like
set |
Hello , sory for time to awnser ! @beniaminopozzan thank you for all this precisions !
Without -h option and the adress of the companion it's not working. Firts when i echo the topic /fmu/out/vehicle_control_mode here is the result :
So i need to put the flag : " flag_control_offboard_enabled: false " to true ? how to do this ? If i understand i need to specifies in the actuator section that my servo 1 and 2 are controlled offboard ? but if i do this, can i control also with rc and the px4 autopiliot can control this 2 servo to control my model or are they "ONLY" offboard cotroled ? Here is my problem, i want to use px4 with paramotor, the problem the is no frame paramotor. So there is 2 servo to control left brake, right brake, i need to control them with my rc to pilot manually, but i also need px4 control them to make return to home or waypoint navigation, but i also need ros2 control them for more high level algorithm like obstacle avoidance, trajectory, collaborative work , autopilot with artificial intelligence, ect.... |
Great!
What do you want to achieve? Is it just to control the servos? If so then no, you don't need to change anything, the " But as you said:
This changes everything!
Short answer, yes. Long answer... requires more work! You need to define a frame paramotor, this way you can treat the paramotor as any other supported vehicle and use manual control, automatic control (return to home, etc), offboard control. As we are going quite out of topic (way out of topic :) do you mind opening a new topic at https://discuss.px4.io/ , or a new issue here? Consider also this topic! https://discuss.px4.io/t/px4-paramotor-project-1-first-flight-with-px4/30881 |
This issue has been mentioned on Discussion Forum for PX4, Pixhawk, QGroundControl, MAVSDK, MAVLink. There might be relevant details there: https://discuss.px4.io/t/how-to-configure-uxrce-dds-client-with-usb-connection/41881/2 |
Describe the bug
I use a raspberry pi 4 companion computer with ros2 humble and micro_ros_agent installed. When I try to connect it to a pixhawk 4 mini (setup for HITL) through serial (TELEM 1 port on pixhawk, /dev/ttyAMA1 on the raspberry pi) they start the communication, but very quickly abort.
On the companion computer the following message is shown:
On the px4-side I get the following error after executing
microdds_client start -t serial -d /dev/ttyS1 -b 921600
in the nuttshell:To Reproduce
ros2 run micro_ros_agent micro_ros_agent serial --dev /dev/ttyAMA1 -b 921600 -v
microdds_client start -t serial -d /dev/ttyS1 -b 921600
Expected behavior
When I run this on my development computer in a SITL environment the agent and the client communicate through udp without a problem. In the SITL example I used a modified c++ node (see my pull request) inspired by px4-offboard.
I expect the agent and the client to communicate as they do in SITL.
Log Files and Screenshots
None
Drone (please complete the following information):
I use a Pixhawk 4 mini in HITL mode
Additional context
I am sure that the serial connection between the companion computer works, because I have tried to access the mavlink shell with the mavlink_shell.py script from the companion computer. After that I have disabled Mavlink on TELEM 1 (MAV_0_CONFIG = 0), set the serial baudrate to 921600 (SER_TEL1_BAUD = 921600) and enabled (XRCE_DDS_0_CFG = TELEM1).
The text was updated successfully, but these errors were encountered: