diff options
author | Lorenz Meier <lm@inf.ethz.ch> | 2013-10-27 07:02:59 -0700 |
---|---|---|
committer | Lorenz Meier <lm@inf.ethz.ch> | 2013-10-27 07:02:59 -0700 |
commit | 0b89051be1abd9094ac454053f47d2c2f3d183ae (patch) | |
tree | 365764277084fb18b2cc55c3193d18d6ecfb237b /src | |
parent | 59c04adada5a6b55d599cb11680ceafc7bf75614 (diff) | |
parent | 4b63c5488582241c7e3af45dce74c112dbfa60bd (diff) | |
download | px4-firmware-0b89051be1abd9094ac454053f47d2c2f3d183ae.tar.gz px4-firmware-0b89051be1abd9094ac454053f47d2c2f3d183ae.tar.bz2 px4-firmware-0b89051be1abd9094ac454053f47d2c2f3d183ae.zip |
Merge pull request #497 from thomasgubler/l1_sine_eta1
l1: fix constrain of sine_eta1
Diffstat (limited to 'src')
-rw-r--r-- | src/lib/ecl/l1/ecl_l1_pos_controller.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/lib/ecl/l1/ecl_l1_pos_controller.cpp b/src/lib/ecl/l1/ecl_l1_pos_controller.cpp index 196ded26c..27d76f959 100644 --- a/src/lib/ecl/l1/ecl_l1_pos_controller.cpp +++ b/src/lib/ecl/l1/ecl_l1_pos_controller.cpp @@ -190,7 +190,7 @@ void ECL_L1_Pos_Controller::navigate_waypoints(const math::Vector2f &vector_A, c float xtrackErr = vector_A_to_airplane % vector_AB; float sine_eta1 = xtrackErr / math::max(_L1_distance , 0.1f); /* limit output to 45 degrees */ - sine_eta1 = math::constrain(sine_eta1, -M_PI_F / 4.0f, +M_PI_F / 4.0f); + sine_eta1 = math::constrain(sine_eta1, -0.7071f, 0.7071f); //sin(pi/4) = 0.7071 float eta1 = asinf(sine_eta1); eta = eta1 + eta2; /* bearing from current position to L1 point */ |