Hello everyone,
in my application I need to read mavlink packages coming out of the Pixhawk telemetry port directly with a PC in which is running a Java program: in some cases I can reconstruct the complete message and numbers I get make sense. In other cases I think I'm misunderstanding something in the values decoding: in particular I think I'm messing something about how the Pixhawk handles the floating numbers.
For example I want to read this package:
VFR_HUD ( #74 )
Metrics typically displayed on a HUD for fixed wing aircraft
Field Name | Type | Description |
---|---|---|
airspeed | float | Current airspeed in m/s |
groundspeed | float | Current ground speed in m/s |
heading | int16_t | Current heading in degrees, in compass units (0..360, 0=north) |
throttle | uint16_t | Current throttle setting in integer percent, 0 to 100 |
alt | float | Current altitude (MSL), in meters |
climb | float | Current climb rate in meters/second |
And what I notice is that the output values are very strange (i.e. heading is out of range all the times, floating numbers have extremely large values)
On the other hand, I can completely reconstruct this package:
GLOBAL_POSITION_INT ( #33 )
The filtered global position (e.g. fused GPS and accelerometers). The position is in GPS-frame (right-handed, Z-up). It is designed as scaled integer message since the resolution of float is not sufficient.
Field Name | Type | Description |
---|---|---|
time_boot_ms | uint32_t | Timestamp (milliseconds since system boot) |
lat | int32_t | Latitude, expressed as degrees * 1E7 |
lon | int32_t | Longitude, expressed as degrees * 1E7 |
alt | int32_t | Altitude in meters, expressed as * 1000 (millimeters), AMSL (not WGS84 - note that virtually all GPS modules provide the AMSL as well) |
relative_alt | int32_t | Altitude above ground in meters, expressed as * 1000 (millimeters) |
vx | int16_t | Ground X Speed (Latitude, positive north), expressed as m/s * 100 |
vy | int16_t | Ground Y Speed (Longitude, positive east), expressed as m/s * 100 |
vz | int16_t | Ground Z Speed (Altitude, positive down), expressed as m/s * 100 |
hdg | uint16_t | Vehicle heading (yaw angle) in degrees * 100, 0.0..359.99 degrees. If unknown, set to: UINT16_MAX |
So what's the difference here? :(
The second strange thing I noticed is that not all the messages listed here http://mavlink.org/messages/common are sent out of the telemetry port (i.e. ESTIMATOR_STATUS #230) and, moreover, I found some msgId that are not present on this list (i.e #193).
Can someone give me some hints how to proceed and if there is some usefull documentation I may have not still found?
Thank you very much!!
Replies