Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TS function in gps5.go #16

Open
parikshitraje opened this issue Dec 4, 2017 · 4 comments
Open

TS function in gps5.go #16

parikshitraje opened this issue Dec 4, 2017 · 4 comments

Comments

@parikshitraje
Copy link

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

@stilldavid
Copy link
Owner

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!

@parikshitraje
Copy link
Author

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 !

@stilldavid
Copy link
Owner

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.

@sukeshak
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants