Hi there all,
I am following ardusub’s official docs, so I can read mavlink messages that suits my needs.
At the time of writing this, data that I need are:
time (as time of reading data)
depth
pressure
temperature
heading
Searching the forum and in Mavlink’s documentation, I could find those messages :
temperature - RAW_PRESSURE or SCALED_PRESSURE (also SCALED_PRESSURE2, SCALED_PRESSURE3 found in mavlink docs, but cannot decide which is the correct message)
heading - VFR_HUD, RAW_IMU and ATTITUDE (found here and here)
specially for the heading, my search results confused me, since I cannot tell the difference between VFR_HUD , RAW_IMU, ATTITUDE and AHRS
I think… testing those and at the same time crosschecking with QGC’s data, can give me an answer. But I would like anyone’s suggestion in this forum, based on your experience.
heading - RAW_IMU is the raw values from the sensor. For heading estimation, you should use VFR_HUD (0° … 360º [degree]) or ATTITUDE (-pi … +pi [rad]), the only difference is the unit.
Since ArduPilot messages are limited and are used in multiple devices/concepts, some messages like SCALED_PRESSURE2 and SCALED_PRESSURE3 can be a bit confuse, but everything else is straightforward after reading the documentation.
Hey @patrickelectric thanks for the answer !!
you didn’t mention anything about time or pressure, so I suppose I was right on those.
To sum up … mavlink messages I need are:
time - SYSTEM_TIME.time_unix_usec
depth - VFR_HUD.alt
pressure - SCALED_PRESSURE2.press_diff
temperature - SCALED_PRESSURE2.temperature (I use the Bar30 sensor)
heading - VFR_HUD.heading
please correct me if anything of the above is wrong.
Yes, I just did the corrections, your other assumptions are correct.
Everything looks right.
For the time issue, this should be fixed if you are using the last version of ArduSub and QGC. After doing the connection with the vehicle, QGC will set the time based on the surface computer date/time information, you can also set the desired time with system_time_send.
There’s a difference between “mavlink messages” (which are regularly communicated between the vehicle and ground control software) and “vehicle parameters” (which the vehicle uses for internal control, and to interpret the messages/commands it gets sent). We have examples for getting both: