-
Notifications
You must be signed in to change notification settings - Fork 13.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
Collision Prevention for manual flight mode #23507
base: main
Are you sure you want to change the base?
Conversation
a3d8d8b
to
d130612
Compare
dcfa190
to
9cf4838
Compare
@Claudio-Chies is this something I can pull down to flight test? Or is it needing more time in the SITL? |
@dirksavage88 it should be ready to test, the only thing i haven't tested is how non-default gains in the position and velocity controller change the CP behavior |
7fa1fcc
to
077226b
Compare
f8585cd
to
1e40431
Compare
1e40431
to
bd72ecf
Compare
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.
After an in person discussion I see a lot of value in simplifying the logic. The main pain points are:
- Separate input data processing from guidance logic e.g. distance and direction to closest obstacle and distance to next obstacle in current velocity direction are the interface between obstacle map processing and guidance.
- If possible avoid cases in guidance logic. E.g. three things to take care of:
- Stick should not accelerate over the configured collision prevention minimum distance
- Brake from current velocity before before minimum allowed distance
- If obstacle is closer/"comes closer" push away from it to minimum distance
Probably these rules can run all the time, get superimposed and be readable, predictable (logged).
I added a commit for cosmetic and commenting things that I saw at a glance.
eb4dede
to
e0b6707
Compare
e0b6707
to
d346da5
Compare
Solved Problem
Ports and extends the current collision prevention algorithm to FlightModeManualAcceleration
Associated PR's
Solution
The algorithm has two parts, velocity compensation, and constraining of the commanded acceleration.
Velocity compensation
For this i have ported over the existing methods from the velocity based collision prevention method. and transformed the velocity into an acceleration by subtracting the velocity set-point from the collision prevention velocity and applying a proportional gain ( MPC_XY_VEL_P_ACC ) to it.
Acceleration constraining
For this I'm calculating the minimal distance to the obstacle, and scaling it quadratic in the range of [0,1] distances proportional to the maximum velocity.
hereby its important to note that scaling currently only happens in surface-normal direction, which means that the drone is still able to move freely tangentially.
whereby the acceleration constraining is done in the distance between CP_DIST and MPC_VEL_MANUAL / MPC_XY_P
Drawbacks
The main drawback of this approach is that it might allow collision causing accelerations if flying into inside corners, as when your closer to one wall than the other, you can command maximum acceleration into the other wall.
might introduce normal and tangential damping parameters to solve this.
Changelog Entry
For release notes:
Drawbacks
Alternatives
Test coverage
Context
CP.mp4