Driver code for the wheel encoder. More...
Functions | |
float | wheel_enc_get_speed (float time_elapsed, bool is_pulse) |
Get the speed in either pulses/second or mm/second. More... | |
float | wheel_enc_get_time_diff (uint64_t current_time, uint64_t prev_time) |
Get the time difference in ms. More... | |
Driver code for the wheel encoder.
float wheel_enc_get_speed | ( | float | time_elapsed, |
bool | is_pulse | ||
) |
Get the speed in either pulses/second or mm/second.
[in] | time_elapsed | Time elapsed in ms |
[in] | is_pulse | True if speed is in pulses/second, false if speed is in mm/second |
References WHEEL_ENC_DIST_PER_PULSE, and WHEEL_ENC_SEC_TO_MSEC.
float wheel_enc_get_time_diff | ( | uint64_t | current_time, |
uint64_t | prev_time | ||
) |
Get the time difference in ms.
[in] | current_time | Current time in us |
[in] | prev_time | Previous time in us |
References WHEEL_ENC_SEC_TO_MSEC.