Hello everyone,
I’m currently using the VectorNav VN-300 and taking a closer look at the vectornav driver (src/drivers/ins/vectornav/VectorNav.cpp). I noticed that the driver assigns the GNSS ellipsoid altitude to both the MSL and ellipsoid altitude fields in the sensor_gps topic:
sensor_gps.altitude_msl_m = positionGpsLla.c[2];
sensor_gps.altitude_ellipsoid_m = sensor_gps.altitude_msl_m;
Because positionGpsLla.c[2] represents the WGS84 ellipsoid altitude, the MSL altitude ends up being inaccurate. I’m guessing this was a standard workaround for older firmware versions that lacked a dedicated MSL output.
Since newer firmware versions (v1.1.0.1+) now provide the true Mean Sea Level (MSL) altitude, I’d like to propose an update to the driver. The modifications would be relatively straightforward:
-
Configuration: Turn on the
GnssAltMSLbit (Bit Offset 18) in the binary output config register during initialization. -
Parser: Update
VnUartPacketto extract theGnssAltMSLmeasurement. -
Mapping: Route the new
GnssAltMSLvalue directly tosensor_gps.altitude_msl_m, and leavepositionGpsLla.c[2]strictly forsensor_gps.altitude_ellipsoid_m.
Does this approach sound good to the maintainers? I’d love to hear your thoughts or any potential edge cases I should keep in mind!