MCPcopy Create free account
hub / github.com/ArduPilot/ardupilot / input_expo

Function input_expo

libraries/AP_Math/control.cpp:520–527  ·  view source on GitHub ↗

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.

Source from the content-addressed store, hash-verified

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.
520float 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
530float angle_to_accel(float angle_deg)

Callers 4

updateMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected