I’m using mavproxy.pywith a companion computer (a NVIDIA Jetson) to get GPS data from my copter. With Mission Planner, I did compass calibration and accel calibration. I went outside with a clear sky to get a 3D Fix GPS data. But when I get GPS data from MAVLink packet messages that I read with mavproxy.py code, GPS timestamps are not the same as other sensors of the copter.
I want to mention that I’m using the Holybro GPS M8N module on my copter and the flight controller is a Pixhawk 6X. I’m using the Jetson UART to get the copter data via the TELEM2 port of the flight controller. Finally : the GPS M8N module is far enough from the Pixhawk 6X and its electronic to avoid any magnetic problem.
Does anyone have an idea of why this happens ? And how to fix that issue ?
GPS Timestamps contain the GPS time, as defined in the GPS standard. And do not include leap seconds!
Sensor timestamps are “microseconds since flight controller boot” and are very different from the above.
The “issue” is normal, expected, and not an issue.
OK, I think I missexplained the problem though (but you are right about the GPS time). The sensors timestamp from the GPS packet of MAVLink messages is not the same as other timestamp of other sensors. I checked the documentations and it also mentions that the timestamp of GPS sensor is the time since the system boot, here : https://mavlink.io/en/messages/common.html#GPS_RAW_INT .
So if the logic is the same as other sensors, I don’t get why the timestamp value is not the same ?
I invested in my code and the problem is more “simple” than I thought : in order to have the same timestamp value as timestamps of my Jetson, I added a time shift (or a delay) to the timestamp value of sensors packet messages from the copter. And the value of the GPS MAVLink packet message was not its timestamp but the time shift between the Jetson boot and my flight controller boot. When I read the raw GPS MAVLink packet message, I have 0 s as timestamp value.
That explains why I don’t have the same timestamp value with GPS MAVLink packet messages and the other sensors packet messages.
Every MAVLink messages from the copter sensors give me raw value that I convert in second and with which I add a time shift (or delay) to sync their value with my Jetson timestamp values… except raw value of from the GPS MAVLink messages which are 0
So the real problem was that I don’t receive any GPS data