PX4 / PX4-Autopilot

PX4 Autopilot Software
https://px4.io
BSD 3-Clause "New" or "Revised" License
8.2k stars 13.37k forks source link

GPS time cleanup #1343

Closed DrTon closed 9 years ago

DrTon commented 10 years ago

Now ubx driver uses UTC time, but stores it to time_gps_usec field of vehicle_gps_position: https://github.com/PX4/Firmware/blob/master/src/modules/uORB/topics/vehicle_gps_position.h#L82

It's confusing, because "GPS time" (week and seconds) is not the same as UTC and differs from UTC by 16 seconds. (See http://leapsecond.com/java/gpsclock.htm)

I think we should use UTC time everywhere so just need to fix field name and comment.

@pavel-kirienko, what about time reported by CAN GPS?

pavel-kirienko commented 10 years ago

UAVCAN recommends to use UTC: https://github.com/pavel-kirienko/uavcan/blob/master/dsdl/uavcan/equipment/gnss/300.Fix.uavcan#L10.

Our GNSS board uses UTC. And yes, I agree that UTC should normally be preferred, especially considering the fact that any GLONASS-capable receiver can pick UTC directly from the sats without the need to obtain the number of leap seconds first.

mhkabir commented 10 years ago

@DrTon Please note, we're working on extending time synchronization across the system to encompass GPS time, Time from companion computer, Time from a GCS, etc.

Please check pull #1278. Any recommendations for us would be welcome

DrTon commented 10 years ago

As I see you haven't touched exactly this issue: there are two "GPS" times: GPS and UTC. We just neet to not mess it and call things correctly, e.g. calling ITC time that was received from GPS receiver is very confusing, someone may think that it's GPS time, that is off by 16 leap seconds now.

LorenzMeier commented 9 years ago

Fixed by #1570.