Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rover: Circle mode enhancements #27983

Merged
merged 2 commits into from
Sep 11, 2024

Conversation

stephendade
Copy link
Contributor

Two fixes for circle mode in Rover:

  • Correct reporting of target position and distance/bearing to target
  • Stop circling (stop the vehicle) if it's unable to properly track the circle. This is usually due to the vehicle not being able to turn fast enough for a given speed/radius circle.

@stephendade
Copy link
Contributor Author

Fix for #25825

The issue can be replicated in SITL by setting ATC_STR_RAT_MAX to 10

Copy link
Member

@IamPete1 IamPete1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure about the stopping, rest looks OK.

We do already limit the speed on circle enter for the given accel limits, maybe we just need some safety factor there, or to include some missing limiting factors.

Comment on lines 159 to 162
// if more than 20% inside or outside circle radius, stop vehicle
GCS_SEND_TEXT(MAV_SEVERITY_ERROR, "Circle: vehicle unable to turn fast enough to track circle. Stopping vehicle.");
stop_vehicle();
return;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We also come through here in loiter turns mission items. This is not such a great solution in that case. Also it looks like it will call send text at loop rate?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I should add in a flag to only send this message once...

@stephendade
Copy link
Contributor Author

We do already limit the speed on circle enter for the given accel limits, maybe we just need some safety factor there, or to include some missing limiting factors.

I assume you mean the throttle accel limits?

This is more the case when the vehicle turn rate (yaw) is much less than the desired turn rate. The vehicle (currently) does not slow down if it can't reach the desired turn rate. It'd be nice if it did, though - I couldn't quite work out the maths to do that though.

@stephendade stephendade force-pushed the circle-mode-enhancements branch from f7234ef to 2fc3d0f Compare September 4, 2024 10:14
@stephendade
Copy link
Contributor Author

Ok, I've changed my approach here:
If the vehicle can't track the circle, it will slow the vehicle speed by 20% and then attempt to track back onto the circle

Worked well in SITL

@stephendade stephendade force-pushed the circle-mode-enhancements branch from 2fc3d0f to bda3d25 Compare September 8, 2024 09:41
@stephendade
Copy link
Contributor Author

Tested in a real vehicle and it worked just fine

@IamPete1 and/or @rmackay9 - are you happy to approve?

Rover/mode_circle.cpp Outdated Show resolved Hide resolved
@stephendade stephendade force-pushed the circle-mode-enhancements branch from bda3d25 to e0cf5f6 Compare September 9, 2024 10:53
Copy link
Member

@IamPete1 IamPete1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good.

Rover/mode_circle.cpp Outdated Show resolved Hide resolved
Rover/mode_circle.cpp Outdated Show resolved Hide resolved
@rmackay9
Copy link
Contributor

This looks pretty good to me, thanks! I've made some comments on text messages to the user but after that's let's merge

@stephendade stephendade force-pushed the circle-mode-enhancements branch from e0cf5f6 to 9982398 Compare September 10, 2024 10:25
Copy link
Contributor

@rmackay9 rmackay9 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks!

@Hwurzburg Hwurzburg added the WikiNeeded needs wiki update label Sep 10, 2024
@peterbarker peterbarker merged commit a3548b6 into ArduPilot:master Sep 11, 2024
61 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants