Skip to content

Commit

Permalink
Rover: fractional Loiter Turn Support
Browse files Browse the repository at this point in the history
Adds special storage handling for loiter turns. Fractional Loiter
Turns 0<N<1 are stored by multiplying the turn number by 256, then
dividing that number by 256 on retrieval.
  • Loading branch information
jrbronkar authored and tridge committed Jan 16, 2024
1 parent 7ce94a9 commit c777a16
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion Rover/mode_auto.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -943,8 +943,9 @@ bool ModeAuto::do_circle(const AP_Mission::Mission_Command& cmd)

bool ModeAuto::verify_circle(const AP_Mission::Mission_Command& cmd)
{
const float turns = cmd.get_loiter_turns();
// check if we have completed circling
return ((g2.mode_circle.get_angle_total_rad() / M_2PI) >= LOWBYTE(cmd.p1));
return ((g2.mode_circle.get_angle_total_rad() / M_2PI) >= turns);
}

/********************************************************************************/
Expand Down

0 comments on commit c777a16

Please sign in to comment.