Send custom Data from PX4 to Ground Station (from uORB via MavLink)
HTML-код
- Опубликовано: 20 авг 2024
- In this Quick tutorial I will show you how to register new data (topic) in uORB API in your PX4 software. Then we publish the value using Mavlink to out Ground station (QGroundControl) and monitor it using live plot.
Then we can log the data in real time.
If you are not familiar with PX4 firmware concepts Refer to my last videos about PX4 SITL, HITL, Log, etc. Another great resource is PX4 developers documentation.
• Ardupilot & PX4 SIL(SI...
• PX4 HITL(Hardware in t...
• PX4 / Ardupilot Flight...
In this video I walk you through one of pre-build examples in PX4 Firmware called PX4_Mavlink_debug
dev.px4.io/v1....
سلام باعث افتخاره که ویدیوئی با این سطح و محتوا از هموطنم پیدا میکنم
متشکر از لطفتون
This would only broadcast uORB message to other modules (including MAVLink) inside the firmware. For the MAVLink to actually send the message you have to define your message and build your own MAVLink header files, and then implement the sending mechanism into the MAVLink module of the firmware. For the message to be received by the ground station, you will need to use the same MAVLink header files and then generate and implement your message's logic into MAVSDK (or your GCS's MAVLink interface) and build the GCS software yourself.
PS: I suggest changing the video's name to just "uORB messaging" because you haven't touched anything related to MAVLink in this video yet. If you have a tutorial on how to implement the logic on both sides (GCS and PX4) of the MAVLink messages, please share it with us and guide us around these topics.
Yes Exactly...but instead you can use already available debug_array or debug_float message to send your own values...
alireza ghaderi well that is a different way to send custom values, but I personally still prefer the extension method though either of those methods would do
You are right. .but this is the simplest and easiest for those who are beginners to PX4 architecture so they wont need to create a mavlink header file. just a quick shortcut cheat:D
Thanks for the tutorial Alireza, and thanks for the clarification Hoang. Due to already compiled debug_array headers what is shown works
This tutorial is awesome. :) I would like to know, how it has to be done when we are connecting a external sensor to Pixhawk?
you should create a custom module or use simulink support package. I have a video about that in channel
Thank you alireza ghaderi for this great tutorial,
I have a question, I build a new app inside examples folder, I followed the instructions in the px4 documentation, and I run git submodule update - -recursive, but px4 does not recognize the app.
What can I do to make px4 recognize the new app?
Hi
did you add your app in the cmakelist? using that cmakelist before building you introduce your module to PX4
@@alirezaghaderi
Thank you, I fixed the problem.
But I have a question. Could I create an app in the same way in Python?
you mean the module with python? i dont think so...you should ask on px4 developer forums
Could you also explain this process for Ardupilot ? or how similar is it to this ?
Its relatively similar process...its more more readable and easier to follow in ardupilot... I will do in future
@@alirezaghaderi Yes please. it will be pretty helpful for many of us.
Now, I am planning to publish my px4 onboard sensor datas to my companion computer which contains ROS2 , Do I have to make publish and subscribe UORB nodes in side of the px4 right? I mean I will make a pub/sub nodes from ROS2 and px4 to make communication between them?
I havent worked with ROS actually. but if you are going to send data to Raspberry Pi, you should create a mavlink header for your custom uorb. If you dont know how to create a new mavlink packet, you can use the mavlink debug messages to deliver your values. I have a video for that in my channel I guess.
@@alirezaghaderi thanks for the info :) I'll watch it too.
@@alirezaghadericould you tell me how to use debug values messages to send and receive values? Is there a video where you explained this? Thanks a lot :)