mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-06-02 03:49:12 +08:00
Correct units of CRSF GPS altitude
Bug fix to correct returning mm units of altitude to m.
This commit is contained in:
@@ -241,7 +241,7 @@ void CrsfRc::Run()
|
|||||||
int32_t longitude = static_cast<int32_t>(round(sensor_gps.longitude_deg * 1e7));
|
int32_t longitude = static_cast<int32_t>(round(sensor_gps.longitude_deg * 1e7));
|
||||||
uint16_t groundspeed = sensor_gps.vel_d_m_s / 3.6f * 10.f;
|
uint16_t groundspeed = sensor_gps.vel_d_m_s / 3.6f * 10.f;
|
||||||
uint16_t gps_heading = math::degrees(sensor_gps.cog_rad) * 100.f;
|
uint16_t gps_heading = math::degrees(sensor_gps.cog_rad) * 100.f;
|
||||||
uint16_t altitude = static_cast<int16_t>(sensor_gps.altitude_msl_m * 1e3) + 1000;
|
uint16_t altitude = static_cast<int16_t>(sensor_gps.altitude_msl_m) + 1000;
|
||||||
uint8_t num_satellites = sensor_gps.satellites_used;
|
uint8_t num_satellites = sensor_gps.satellites_used;
|
||||||
this->SendTelemetryGps(latitude, longitude, groundspeed, gps_heading, altitude, num_satellites);
|
this->SendTelemetryGps(latitude, longitude, groundspeed, gps_heading, altitude, num_satellites);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user