gopro-utils icon indicating copy to clipboard operation
gopro-utils copied to clipboard

TS function in gps5.go

Open parikshitraje opened this issue 8 years ago • 4 comments

TS is always 0 Function is missing. Can some one help to add that ?

parikshitraje avatar Dec 04 '17 11:12 parikshitraje

Are you sure you have a valid GPS lock on the videos where the timestamp is zero?

If you have a sample file or output that would help a ton in figuring out what the issue is. Thanks!

stilldavid avatar Dec 12 '17 15:12 stilldavid

I tried your steps on this video. Please check the video and files in folder

https://drive.google.com/drive/folders/1BFAFB8hhprng2kn8EOGfW8vZK4SoNLro?usp=sharing

Every parameters are perfect.but TS is missing.

We have small function in /bin/gpdminfo/gpmdinfo.go

for i, _ := range t.Gps { gpsCsv = append(gpsCsv, []string{floattostr(t.Gps[i].Latitude),floattostr(t.Gps[i].Longitude),floattostr(t.Gps[i].Altitude),floattostr(t.Gps[i].Speed),floattostr(t.Gps[i].Speed3D),int64tostr(t.Gps[i].TS)}) }

but problem is t.Gps[i].TS(last function) will return zero value as nothing is defined is /telemetry/gps5.go for TS. and we are looking for UTC timestamp as per variable declared in code. Thanks !

parikshitraje avatar Dec 12 '17 20:12 parikshitraje

The format is a bit strange, and the code should be reworked.

What's happening is there is a timestamp there (in t.Gps.Time) but they only happen once per second. The GPS updates are sent at 18Hz, so there's a bit of code to fill in the timestamps at 1/18s intervals to guess at matching the coordinates to a timestamp. The timestamps in t.GPS need to be back-filled by the 1Hz timestamps, if that makes sense.

There is a method on telemetry.TELEM to fill the timestamps, but you have to know the next one because it's not always exactly 18Hz - sometimes it's 19 or 17 - but there's some code in gopro2gpx and gopro2json that keeps track of the previous telemetry and next one to fill everything in.

I hope this makes sense, and I'll try to spend some time cleaning up the logic around all this in the coming weeks when I have some time during the holiday. If you want I can add a CSV exporter as you described if needed.

stilldavid avatar Dec 13 '17 04:12 stilldavid

If timestamp is 1Hz (once per second) then having GPS data for 18Hz won't help unless you know if the time stamp is end of the 18Hz or start of the 18Hz. Possible they did this to reduce the amount of data getting added.

Just my opinion.

sukeshak avatar Jun 15 '18 15:06 sukeshak