AutonomyLab / libcreate

C++ library for interfacing with the iRobot Create 1 and 2.
BSD 3-Clause "New" or "Revised" License
47 stars 76 forks source link

Use average dt values for velocity calculation #60

Closed tim-fan closed 3 years ago

tim-fan commented 3 years ago

Fixes #36

Tested on my Create2, running Ubuntu 18.04 on a Intel(R) Core(TM) i7-8650U CPU @ 1.90GHz (Intel NUC).

The underlying issue appears to be that dt values between onData calls do not accurately represent the dt values at which the encoders are sampled. It appears that averaging the onData dt values yields more accurate results.