input_expo calculates the expo function on the normalised input. The input must be in the range of -1 to 1. The expo should be less than 1.0 but limited to be less than 0.95.
| 518 | // The input must be in the range of -1 to 1. |
| 519 | // The expo should be less than 1.0 but limited to be less than 0.95. |
| 520 | float input_expo(float input, float expo) |
| 521 | { |
| 522 | input = constrain_float(input, -1.0, 1.0); |
| 523 | if (expo < 0.95) { |
| 524 | return (1 - expo) * input / (1 - expo * fabsf(input)); |
| 525 | } |
| 526 | return input; |
| 527 | } |
| 528 | |
| 529 | // angle_to_accel converts a maximum lean angle in degrees to an accel limit in m/s/s |
| 530 | float angle_to_accel(float angle_deg) |
no outgoing calls
no test coverage detected