upkie 6.1.0
Open-source wheeled biped robots
|
Observe contact between a given wheel and the floor. More...
#include <WheelContact.h>
Classes | |
struct | Parameters |
Observer parameters. More... | |
Public Member Functions | |
WheelContact (const Parameters ¶ms) | |
Initialize observer. More... | |
void | observe (const double torque, const double velocity, const double dt) noexcept |
Process a new observation. More... | |
double | abs_acceleration () const noexcept |
Low-pass filtered absolute wheel acceleration, in [rad] / [s]² | |
double | abs_torque () const noexcept |
Low-pass filtered absolute wheel torque, in [N m]. | |
bool | contact () const noexcept |
Current contact state. | |
double | inertia () const noexcept |
Apparent inertia I = |torque| / |acceleration| at the wheel. | |
void | reset_contact () noexcept |
Reset contact to false. | |
Observe contact between a given wheel and the floor.
We use an acceleration-from-torque simple linear regressor with no affine term and online updates. There is a quick intro to the math in the following post on simple linear regression with online updates. The output of this regressor is an "inertia" (torque over acceleration slope) that is low during contact and large in the air (as then the wheel needs little torque to spin freely).
The observer is made more reliable by three hacks post-processing stages:
|
explicit |
Initialize observer.
[in] | params | Observer parameters. |
|
noexcept |
Process a new observation.
[in] | torque | New torque observation. |
[in] | velocity | New velocity observation. |
[in] | dt | Duration in seconds since last observation. |