Commit 4c34fb38 authored by nanthony21's avatar nanthony21

Removed code that cut off the last 25% of joystick motion in either direction....

Removed code that cut off the last 25% of joystick motion in either direction. I'm not sure what the original purpose of this code was.
parent a9de4cf7
...@@ -431,18 +431,6 @@ void Joystick::run(void) ...@@ -431,18 +431,6 @@ void Joystick::run(void)
throttle_accu = std::max(static_cast<float>(-1.f), std::min(throttle_accu, static_cast<float>(1.f))); throttle_accu = std::max(static_cast<float>(-1.f), std::min(throttle_accu, static_cast<float>(1.f)));
throttle = throttle_accu; throttle = throttle_accu;
} }
float roll_limited = std::max(static_cast<float>(-M_PI_4), std::min(roll, static_cast<float>(M_PI_4)));
float pitch_limited = std::max(static_cast<float>(-M_PI_4), std::min(pitch, static_cast<float>(M_PI_4)));
float yaw_limited = std::max(static_cast<float>(-M_PI_4), std::min(yaw, static_cast<float>(M_PI_4)));
float throttle_limited = std::max(static_cast<float>(-M_PI_4), std::min(throttle, static_cast<float>(M_PI_4)));
// Map from unit circle to linear range and limit
roll = std::max(-1.0f, std::min(tanf(asinf(roll_limited)), 1.0f));
pitch = std::max(-1.0f, std::min(tanf(asinf(pitch_limited)), 1.0f));
yaw = std::max(-1.0f, std::min(tanf(asinf(yaw_limited)), 1.0f));
throttle = std::max(-1.0f, std::min(tanf(asinf(throttle_limited)), 1.0f));
if ( _exponential ) { if ( _exponential ) {
// Exponential (0% to -50% range like most RC radios) // Exponential (0% to -50% range like most RC radios)
// 0 for no exponential // 0 for no exponential
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment