mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-28 14:43:34 +08:00
SensorGps.msg: switch to double precision for lat/lon/alt
To match https://github.com/PX4/PX4-GPSDrivers/pull/132 - adding high precision RTK lat/lon/alt components
This commit is contained in:
committed by
Beat Küng
parent
f82785a322
commit
f000238987
@@ -386,9 +386,9 @@ struct msp_raw_gps_t {
|
||||
uint8_t numSat;
|
||||
int32_t lat; // 1 / 10000000 deg
|
||||
int32_t lon; // 1 / 10000000 deg
|
||||
int16_t alt; // meters
|
||||
int16_t alt; // centimeters since MSP API 1.39, meters before
|
||||
int16_t groundSpeed; // cm/s
|
||||
int16_t groundCourse; // unit: degree x 10
|
||||
int16_t groundCourse; // unit: degree x 100, centidegrees
|
||||
uint16_t hdop;
|
||||
} __attribute__((packed));
|
||||
|
||||
|
||||
@@ -314,9 +314,9 @@ msp_raw_gps_t construct_RAW_GPS(const sensor_gps_s &vehicle_gps_position,
|
||||
msp_raw_gps_t raw_gps {0};
|
||||
|
||||
if (vehicle_gps_position.fix_type >= 2) {
|
||||
raw_gps.lat = vehicle_gps_position.lat;
|
||||
raw_gps.lon = vehicle_gps_position.lon;
|
||||
raw_gps.alt = vehicle_gps_position.alt / 10;
|
||||
raw_gps.lat = static_cast<int32_t>(vehicle_gps_position.latitude_deg * 1e7);
|
||||
raw_gps.lon = static_cast<int32_t>(vehicle_gps_position.longitude_deg * 1e7);
|
||||
raw_gps.alt = static_cast<int16_t>(vehicle_gps_position.altitude_msl_m * 100.0);
|
||||
|
||||
float course = math::degrees(vehicle_gps_position.cog_rad);
|
||||
|
||||
@@ -432,14 +432,14 @@ msp_altitude_t construct_ALTITUDE(const sensor_gps_s &vehicle_gps_position,
|
||||
msp_altitude_t altitude {0};
|
||||
|
||||
if (vehicle_gps_position.fix_type >= 2) {
|
||||
altitude.estimatedActualPosition = vehicle_gps_position.alt / 10;
|
||||
altitude.estimatedActualPosition = static_cast<int32_t>(vehicle_gps_position.altitude_msl_m * 100.0); // cm
|
||||
|
||||
} else {
|
||||
altitude.estimatedActualPosition = 0;
|
||||
}
|
||||
|
||||
if (estimator_status.solution_status_flags & (1 << 5)) {
|
||||
altitude.estimatedActualVelocity = -vehicle_local_position.vz * 10; //m/s to cm/s
|
||||
altitude.estimatedActualVelocity = -vehicle_local_position.vz * 100; //m/s to cm/s
|
||||
|
||||
} else {
|
||||
altitude.estimatedActualVelocity = 0;
|
||||
|
||||
Reference in New Issue
Block a user