Access to sensor data

Hi all,

Hoy can i access sensor data like altitude or speed variable?? Aldo i want to send landing instruction according to that data values. That i should do by Sending mavlink message or is there any other way?

Thx!

Hey, you can access this information on uORB.
Here is the documentation. this is useful if you are developing on the PX4 firmware.
https://docs.px4.io/master/en/msg_docs/

In the tutorial to create your module, the example is to retrieve information from the IMU

Best regards

@DiaZ0te thank you! I was just reading the documentation and thinking that might be it. You mean this tutorial?
https://docs.px4.io/master/en/advanced/out_of_tree_modules.html#usage

What I want to do is send a return or landing message when the altitude is above an arbitrary height (I am doing work to start drone work in a laboratory at my university and it should not be something so complex, but demonstrative)

Where do you need access to that information? If it’s on a companion computer like a raspberry pi, or on the ground, then I can recommend using mavsdk.

1 Like

@JulianOes hello, I’m trying to do it as a modification to the firmware, something like “add a new failsafe” like the ones that already exist with the battery or when the gps / RC signal is lost. I know it is not a great advance but it is an university wrok with an educational focus so that later other students can work on newer things. (I am aware that it would be more “practical” to make an “external” application but the idea of the work itself is to get directly involved with the firmware)

I was going through the code looking for something that could serve me and I hid this:

Is it possible to use this mavlink message to then give an instruction to the drone based on the value of said message?