mirror of
https://gitee.com/xiaohuolufeihua/bizhang_-obav.git
synced 2026-05-21 01:12:11 +00:00
gps_position: convert uint64 timestamp_time -> int32 timestamp_time_relative
We need to make this timestamp relative to the main timestamp. Necessary for replay, and saves some space.
This commit is contained in:
@@ -25,7 +25,7 @@ float32 vel_d_m_s # GPS Down velocity, (metres/sec)
|
|||||||
float32 cog_rad # Course over ground (NOT heading, but direction of movement), -PI..PI, (radians)
|
float32 cog_rad # Course over ground (NOT heading, but direction of movement), -PI..PI, (radians)
|
||||||
bool vel_ned_valid # True if NED velocity is valid
|
bool vel_ned_valid # True if NED velocity is valid
|
||||||
|
|
||||||
uint64 timestamp_time # Time of the UTC timestamp since system start, (microseconds)
|
int32 timestamp_time_relative # timestamp + timestamp_time_relative = Time of the UTC timestamp since system start, (microseconds)
|
||||||
uint64 time_utc_usec # Timestamp (microseconds, UTC), this is the timestamp which comes from the gps module. It might be unavailable right after cold start, indicated by a value of 0
|
uint64 time_utc_usec # Timestamp (microseconds, UTC), this is the timestamp which comes from the gps module. It might be unavailable right after cold start, indicated by a value of 0
|
||||||
|
|
||||||
uint8 satellites_used # Number of satellites used
|
uint8 satellites_used # Number of satellites used
|
||||||
|
|||||||
Submodule src/drivers/gps/devices updated: 682fca425e...a5e3e263aa
@@ -752,10 +752,9 @@ GPS::task_main()
|
|||||||
* no valid position lock
|
* no valid position lock
|
||||||
*/
|
*/
|
||||||
|
|
||||||
_report_gps_pos.timestamp_time = hrt_absolute_time();
|
|
||||||
|
|
||||||
/* reset the timestamp 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 = 0;
|
||||||
|
_report_gps_pos.timestamp_time_relative = 0;
|
||||||
|
|
||||||
/* set a massive variance */
|
/* set a massive variance */
|
||||||
_report_gps_pos.eph = 10000.0f;
|
_report_gps_pos.eph = 10000.0f;
|
||||||
|
|||||||
@@ -1781,7 +1781,7 @@ MavlinkReceiver::handle_message_hil_gps(mavlink_message_t *msg)
|
|||||||
struct vehicle_gps_position_s hil_gps;
|
struct vehicle_gps_position_s hil_gps;
|
||||||
memset(&hil_gps, 0, sizeof(hil_gps));
|
memset(&hil_gps, 0, sizeof(hil_gps));
|
||||||
|
|
||||||
hil_gps.timestamp_time = timestamp;
|
hil_gps.timestamp_time_relative = 0;
|
||||||
hil_gps.time_utc_usec = gps.time_usec;
|
hil_gps.time_utc_usec = gps.time_usec;
|
||||||
|
|
||||||
hil_gps.timestamp = timestamp;
|
hil_gps.timestamp = timestamp;
|
||||||
|
|||||||
@@ -339,7 +339,7 @@ GPSSIM::task_main()
|
|||||||
//Make sure to clear any stale data in case driver is reset
|
//Make sure to clear any stale data in case driver is reset
|
||||||
memset(&_report_gps_pos, 0, sizeof(_report_gps_pos));
|
memset(&_report_gps_pos, 0, sizeof(_report_gps_pos));
|
||||||
_report_gps_pos.timestamp = hrt_absolute_time();
|
_report_gps_pos.timestamp = hrt_absolute_time();
|
||||||
_report_gps_pos.timestamp_time = hrt_absolute_time();
|
_report_gps_pos.timestamp_time_relative = 0;
|
||||||
|
|
||||||
if (!(m_pub_blocked)) {
|
if (!(m_pub_blocked)) {
|
||||||
if (_report_gps_pos_pub != nullptr) {
|
if (_report_gps_pos_pub != nullptr) {
|
||||||
|
|||||||
Reference in New Issue
Block a user