diff --git a/msg/vehicle_gps_position.msg b/msg/vehicle_gps_position.msg index 4be23df42e..77ef0f3e15 100644 --- a/msg/vehicle_gps_position.msg +++ b/msg/vehicle_gps_position.msg @@ -1,10 +1,10 @@ # GPS position in WGS84 coordinates. +# the auto-generated field 'timestamp' is for the position & velocity (microseconds) int32 lat # Latitude in 1E-7 degrees int32 lon # Longitude in 1E-7 degrees int32 alt # Altitude in 1E-3 meters above MSL, (millimetres) int32 alt_ellipsoid # Altitude in 1E-3 meters bove Ellipsoid, (millimetres) -uint64 timestamp_variance # Time of the accuracy estimates since system start, (microseconds) float32 s_variance_m_s # GPS speed accuracy estimate, (metres/sec) float32 c_variance_rad # GPS course accuracy estimate, (radians) uint8 fix_type # 0-1: no fix, 2: 2D fix, 3: 3D fix, 4: RTCM code differential, 5: Real-Time Kinematic, float, 6: Real-Time Kinematic, fixed, 8: Extrapolated. Some applications will not use the value of this field unless it is at least two, so always correctly fill in the fix. @@ -18,7 +18,6 @@ float32 vdop # Vertical dilution of precision int32 noise_per_ms # GPS noise per millisecond int32 jamming_indicator # indicates jamming is occurring -uint64 timestamp_velocity # Time of the velocity estimates since system start, (microseconds) float32 vel_m_s # GPS ground speed, (metres/sec) float32 vel_n_m_s # GPS North velocity, (metres/sec) float32 vel_e_m_s # GPS East velocity, (metres/sec) diff --git a/src/drivers/gps/devices b/src/drivers/gps/devices index 9e7ed8a5ea..682fca425e 160000 --- a/src/drivers/gps/devices +++ b/src/drivers/gps/devices @@ -1 +1 @@ -Subproject commit 9e7ed8a5ea85c76c5d563413df051f138b9a0622 +Subproject commit 682fca425e6f3d67ac8062dcc9b36d8bca210175 diff --git a/src/drivers/gps/gps.cpp b/src/drivers/gps/gps.cpp index 21950bbf4c..54f5987deb 100644 --- a/src/drivers/gps/gps.cpp +++ b/src/drivers/gps/gps.cpp @@ -691,13 +691,11 @@ GPS::task_main() _report_gps_pos.lat = (int32_t)47.378301e7f; _report_gps_pos.lon = (int32_t)8.538777e7f; _report_gps_pos.alt = (int32_t)1200e3f; - _report_gps_pos.timestamp_variance = hrt_absolute_time(); _report_gps_pos.s_variance_m_s = 10.0f; _report_gps_pos.c_variance_rad = 0.1f; _report_gps_pos.fix_type = 3; _report_gps_pos.eph = 0.9f; _report_gps_pos.epv = 1.8f; - _report_gps_pos.timestamp_velocity = hrt_absolute_time(); _report_gps_pos.vel_n_m_s = 0.0f; _report_gps_pos.vel_e_m_s = 0.0f; _report_gps_pos.vel_d_m_s = 0.0f; @@ -756,10 +754,8 @@ GPS::task_main() _report_gps_pos.timestamp_time = hrt_absolute_time(); - /* reset the timestamps for data, because we have no data yet */ + /* reset the timestamp for data, because we have no data yet */ _report_gps_pos.timestamp = 0; - _report_gps_pos.timestamp_variance = 0; - _report_gps_pos.timestamp_velocity = 0; /* set a massive variance */ _report_gps_pos.eph = 10000.0f; diff --git a/src/modules/ekf2/ekf2_main.cpp b/src/modules/ekf2/ekf2_main.cpp index d482c4d8ac..6311790127 100644 --- a/src/modules/ekf2/ekf2_main.cpp +++ b/src/modules/ekf2/ekf2_main.cpp @@ -525,7 +525,7 @@ void Ekf2::task_main() gps_msg.eph = gps.eph; gps_msg.epv = gps.epv; gps_msg.sacc = gps.s_variance_m_s; - gps_msg.time_usec_vel = gps.timestamp_velocity; + gps_msg.time_usec_vel = gps.timestamp; gps_msg.vel_m_s = gps.vel_m_s; gps_msg.vel_ned[0] = gps.vel_n_m_s; gps_msg.vel_ned[1] = gps.vel_e_m_s; @@ -910,7 +910,7 @@ void Ekf2::task_main() // only write gps data if we had a gps update. if (gps_updated) { replay.time_usec = gps.timestamp; - replay.time_usec_vel = gps.timestamp_velocity; + replay.time_usec_vel = gps.timestamp; replay.lat = gps.lat; replay.lon = gps.lon; replay.alt = gps.alt; diff --git a/src/modules/mavlink/mavlink_receiver.cpp b/src/modules/mavlink/mavlink_receiver.cpp index 37530bb13a..1c5730c3cf 100644 --- a/src/modules/mavlink/mavlink_receiver.cpp +++ b/src/modules/mavlink/mavlink_receiver.cpp @@ -1791,10 +1791,8 @@ MavlinkReceiver::handle_message_hil_gps(mavlink_message_t *msg) hil_gps.eph = (float)gps.eph * 1e-2f; // from cm to m hil_gps.epv = (float)gps.epv * 1e-2f; // from cm to m - hil_gps.timestamp_variance = timestamp; hil_gps.s_variance_m_s = 5.0f; - hil_gps.timestamp_velocity = timestamp; hil_gps.vel_m_s = (float)gps.vel * 1e-2f; // from cm/s to m/s hil_gps.vel_n_m_s = gps.vn * 1e-2f; // from cm to m hil_gps.vel_e_m_s = gps.ve * 1e-2f; // from cm to m diff --git a/src/modules/position_estimator_inav/position_estimator_inav_main.cpp b/src/modules/position_estimator_inav/position_estimator_inav_main.cpp index 79e070c614..8d4b882b0b 100644 --- a/src/modules/position_estimator_inav/position_estimator_inav_main.cpp +++ b/src/modules/position_estimator_inav/position_estimator_inav_main.cpp @@ -1212,7 +1212,7 @@ int position_estimator_inav_thread_main(int argc, char *argv[]) inertial_filter_correct(corr_gps[0][0], dt, x_est, 0, w_xy_gps_p); inertial_filter_correct(corr_gps[1][0], dt, y_est, 0, w_xy_gps_p); - if (gps.vel_ned_valid && t < gps.timestamp_velocity + gps_topic_timeout) { + if (gps.vel_ned_valid && t < gps.timestamp + gps_topic_timeout) { inertial_filter_correct(corr_gps[0][1], dt, x_est, 1, w_xy_gps_v); inertial_filter_correct(corr_gps[1][1], dt, y_est, 1, w_xy_gps_v); } diff --git a/src/modules/uavcan/sensors/gnss.cpp b/src/modules/uavcan/sensors/gnss.cpp index bf56539b7a..f31ca0174a 100644 --- a/src/modules/uavcan/sensors/gnss.cpp +++ b/src/modules/uavcan/sensors/gnss.cpp @@ -109,8 +109,6 @@ void UavcanGnssBridge::gnss_fix_sub_cb(const uavcan::ReceivedDataStructure