Skip to content

Commit

Permalink
AP_L1_Control: Use is_positive
Browse files Browse the repository at this point in the history
Avoid !is_zero
  • Loading branch information
Ryanf55 authored and srmainwaring committed Oct 28, 2024
1 parent 1061192 commit bce81f7
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion libraries/AP_L1_Control/AP_L1_Control.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -553,7 +553,7 @@ void AP_L1_Control::update_level_flight(void)
// update L1 control for path following
void AP_L1_Control::follow_path(const Location &location_on_path, const Vector2f& unit_path_tangent, float path_curvature, int8_t direction) {
//! @note initial implementation uses existing functions
if (!is_zero(path_curvature)) {
if (is_positive(path_curvature)) {
// moving along arc of circle - loiter about wp located at
// centre of curvature.
float radius_m = 1.0 / path_curvature;
Expand Down

0 comments on commit bce81f7

Please sign in to comment.