get total delta angle (in radians) measured by the wheel encoder
| 276 | |
| 277 | // get total delta angle (in radians) measured by the wheel encoder |
| 278 | float AP_WheelEncoder::get_delta_angle(uint8_t instance) const |
| 279 | { |
| 280 | // for invalid instances return zero |
| 281 | if (instance >= WHEELENCODER_MAX_INSTANCES) { |
| 282 | return 0.0f; |
| 283 | } |
| 284 | // protect against divide by zero |
| 285 | if (_counts_per_revolution[instance] == 0) { |
| 286 | return 0.0f; |
| 287 | } |
| 288 | return M_2PI * state[instance].distance_count / _counts_per_revolution[instance]; |
| 289 | } |
| 290 | |
| 291 | // get the total distance traveled in meters |
| 292 | float AP_WheelEncoder::get_distance(uint8_t instance) const |
no outgoing calls
no test coverage detected