WHILL / ros_whill

ROS Package for WHILL Model CR
https://whill.jp/model-cr
MIT License
34 stars 25 forks source link

Why is cacl_time_diff so weird? #3

Closed kunaltyagi closed 3 years ago

kunaltyagi commented 5 years ago

The time difference function is not straight forward to understand. Can you help me in understanding it better?

seiya0412 commented 5 years ago

Thanks for the comment. That function calculates interval [in millisecond] between the latest and the second latest packets. The data packet coming from WHILL CR itself contains an one-byte "timestamp [in millisecond]" which is a circular counter with max value of 201.

Note: Why "201"? It is an implementation error in its firmware and will be fixed in the next release. (Both firmware and this ros_whill package.)

kunaltyagi commented 5 years ago

The values I've been observing have been more than 201 frequently, resulting in large positive time_diff_ms (because negative signed difference becomes large unsigned value)

seiya0412 commented 5 years ago

That behavior is actually unexpected. We are going to inspect CR's firmware to dig into the issue. Thank you very much for letting us know.