-
Notifications
You must be signed in to change notification settings - Fork 17.5k
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
Stop Missions blowing past desired speeds #27733
base: master
Are you sure you want to change the base?
Stop Missions blowing past desired speeds #27733
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think this is the better of two imperfect options. At least this option won't do something the user didn't ask for so should be less scary.
I'm not sure about this, we get complaints on the forums when SCurves don't cut the corners and so I worry we will just see more of these. I wonder if perhaps the the cause of the crash was that the WPNAV_TER_MARGIN was set too high |
@peterbarker should we set the terrain margin to the min of the parameter and the target alt AGL? |
We discussed this at length and I think we decided:
Thanks @peterbarker for your work on this! |
Closes #22466 |
Copter wants to use this to peek ahead at what DO commands are coming
c7d715d
to
1535405
Compare
(@IamPete1 - pretty corners are back ;-) ) |
Well done @peterbarker !!!! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That is an extremely tight change. Well done!!!
This is perfect!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is better, but I don't think its quite right. This is effectively taking the change speed one waypoint early.
Ok, I missed that. Maybe the Do Change Speed is being called on both segments instead of only the second one.
Yes, this approach can't work because update_track_with_speed_accel_limits() changes both the current and next segment speed.
Can we get the do_change_speed and feed that speed into the call for the next_leg as a speed overide parameter. Or maybe always feed the speed in from the higher layer. I have been thinking for a while now that we should be doing something like this anyway.
SCurve navigation plans its segments based off the current vehicle speed, not taking into account that the speed can be changed between the next waypoint and the one after it.
This has led to a crash where the vehicle accelerated up to its waypoint navigation speed and was travelling too fast for the rise in terrain it was traveling over. i.e. the mission was well-planned but the unexpected velocity caused a crash.
The included autotest reproduces this in SITL (assuming you comment-out the actual test in the test,
ensure_low_gps_speed
you can get the log which produced the pre-fix graphs below):Pre-fix:
Post-fix:
This will be a positive change for users who set a speed at the start of their missions and stick to it.
This will potentially be a negative change for users who are changing speeds many times as part of their missions.
A better fix might be to pass the expected speed for the next segment in.
However, there may be (a) a delay before we
DO_CHANGE_SPEED
and (b) there may be multipleDO_CHANGE_SPEED
s.Example of pathological case which makes correct SCurve planning difficult:
MAV_CMD_DO_CONDITION_YAW
followed byDO_CHANGE_SPEED
. Not actually an unreasonable demand in a mission, but planning your vel/accel profile becomes problematic when you don't really know how long that condition might take to become true!This work sponsored by Harris Aerial