Hi everybody, I am Luis from Spain, I am building my own GCS and I would like to know which is the MAVLink stream I have to request to get the sonar altitude, or in case it is not given as a stream, I would like to know which message do I have to send to receive the sonar altitude.
I guess that sonar altitude should be given to my GCS in the message MAVLINK_MSG_ID_GLOBAL_POSITION_INT, for which I have to send a MAV_DATA_STREAM_POSITION stream request, but after doing this (i.e. requesting that stream) I still do not receive in my GCS the MAVLINK_MSG_ID_GLOBAL_POSITION_INT message.
I am using Arducopter v2.6 (MAVLink 1.0).
Thank you,
Luis.
Replies
Look at https://pixhawk.ethz.ch/mavlink/ and search for rangefinder?
After some research & testing I have found the answer:
1) Request (send to Arducopter) the stream MAV_DATA_STREAM_RAW_SENSORS.
2) Read (from Arducopter) the message MAVLINK_MSG_ID_VFR_HUD.
3) Use the MAVLink function mavlink_msg_vfr_hud_get_alt() to get the float altitude in meters.
Greetings,
Luis.