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

AC_Avoidance: track status Rover: sailboats tack on fence #12117

Open
wants to merge 2 commits into
base: master
from

Conversation

@IamPete1
Copy link
Contributor

commented Aug 22, 2019

This adds a method to track if AC_Avodance is actively avoiding, if it is a sailboat will try a tack.

https://youtu.be/AAhHa9Nh3mU

This shows a sailboat sailing upwind between two wayponints parallel to a fence boundary. The sailboat tacks on the fence boundary, at the other it tacks on a cross track error of 100m. This would benefit from the tacking improvements from #11423. Tacking may not always result in traveling away from the fence but in 95% of cases it is a improvement over stopping. I think this should also allow tacking on avoidance data from a rangefinder......

This also lays the ground work for reporting if fence limiting is active, see mavlink/mavlink#1215

@IamPete1 IamPete1 requested a review from rmackay9 Aug 22, 2019

@IamPete1 IamPete1 referenced this pull request Aug 22, 2019

@IamPete1 IamPete1 force-pushed the IamPete1:fence_tack branch from a58d4eb to 9c55c24 Aug 22, 2019

@rmackay9

This comment has been minimized.

Copy link
Contributor

commented Aug 23, 2019

How about if the limit_velocity function returns a boolean of true if it's limited the velocity? I think that would be better if possible

@IamPete1

This comment has been minimized.

Copy link
Contributor Author

commented Aug 23, 2019

that would probably make more sense for rover, I was trying to catch all ways it can be activated for a PR to notify when limits are active pending the mavlink change

@@ -269,6 +269,10 @@ void Mode::calc_throttle(float target_speed, bool avoidance_enabled)
// apply object avoidance to desired speed using half vehicle's maximum deceleration
if (avoidance_enabled) {
g2.avoid.adjust_speed(0.0f, 0.5f * attitude_control.get_decel_max(), ahrs.yaw, target_speed, rover.G_Dt);
if (g2.sailboat.enabled() && g2.avoid.limits_active()) {
// we are a sailboat trying to avoid fence, try a tack
rover.control_mode->handle_tack_request();

This comment has been minimized.

Copy link
@IamPete1

IamPete1 Aug 25, 2019

Author Contributor

this should be in auto modes only, auto tacking in acro is annoying as it turns out

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants
You can’t perform that action at this time.