Georacer / ardupilog

A ardupilot log to MATLAB converter
GNU General Public License v3.0
49 stars 36 forks source link

More timestamps as dependent #48

Closed hunt0r closed 7 years ago

hunt0r commented 7 years ago

This is a first attempt at implementing TimeS and UTC time as dependent properties. As we begin to use these, we will likely evolve how they're implemented internally.

I ran into a number of issues for discussion, so I've put comments in the code and I'll summarize them here: 1) We had envisioned TimeUTC as the dependent property, but I wasn't sure how we would implement that? I used instead DatenumUTC, using MATLAB's datenum, which is the number of days since Jan 00, year 0000. 2) For this first-attempt, I assume that the first GPS log message (containing GWk and GMS info) was received at its TimeUS timestamp. Note this is NOT true, as TimeUS measures its time-of-logging, not it's receipt time. (I expect less than a second of error from this.) We can get more accurate by using the GPA messages, or by requesting Ardupilot change some logging, but I went ahead with this for now. 3) Use caution if merging with PRs #46 and #47 , I found some sneaky bugs that made slicing not work correctly. In the future, if we refactor the code further, we might want to modify how/when the bootTimeUTC is passed to all the LogMsgGroups.

hunt0r commented 7 years ago

So I don't forget them, here are the "sneaky bugs" I found: 1) The merge still has createLogMsgGroups() where I updated the addprop() call to catch the handles, but in the "flattened" main code, addprop is originally called without catching the handle. 2) At the end of LogMsgGroup.getSlice(), don't forget to set the bootDatenumUTC after setting the LineNo

Georacer commented 7 years ago

What is the status of this, regarding yesterday's talk on avoiding "flattening" of functions?

Georacer commented 7 years ago

Looks fine now. It conflicts with getSlice, but I'll try to resolve it online.

Georacer commented 7 years ago

It was a botch job after all, we should have rebased the branch onto master as usual. Can you make sure getSlice and more-timestamps work as intended? Thanks