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

MPC: AUTO: Emergency Braking velocity setpoint fix #23757

Closed
wants to merge 1 commit into from

Conversation

Claudio-Chies
Copy link
Contributor

Problem

Emergency braking was implemented to slow down the vehicle when switching from a manual flighttask into FlightTaskAuto with velocities higher than the maximum allowed velocity allowed in FlightTaskAuto.
There is currently a problem that there is a discrepancy between the velocities allowed in the PositionController and the FlightTask, meaning that the trajectory generator is able to generate trajectories which are not possible with the PositionController resulting in high errors between the velocity and velocity setpoint.

With this PR, i'm extending the vehicle constraints to also consider the xy speed, and increase this constraint while emergency braking is possible.

image

Solution

With the proposed Solution, the Velocity setpoint corresponds more closely with what trajectory setpoint from the
image

Test coverage

  • Tested in SITL

// correction required by the altitude/vertical position controller
_constraints.speed_down = 1.2f * _param_mpc_z_v_auto_dn.get();
_constraints.speed_up = 1.2f * _param_mpc_xy_vel_max.get();
_constraints.speed_xy = 1.2f * _param_mpc_xy_vel_max.get();;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I moved this up here and removed the max, as there wasn't a possibility that the constraints to back to the normal value after emergency braking, I haven't experienced any issues stemming from this. But this way it should be more intentional.

@Claudio-Chies Claudio-Chies marked this pull request as ready for review October 18, 2024 08:41
@Claudio-Chies Claudio-Chies requested a review from MaEtUgR October 18, 2024 08:41
@github-actions github-actions bot added the stale label Nov 18, 2024
@MaEtUgR
Copy link
Member

MaEtUgR commented Dec 19, 2024

Commit is contained in #23678 this pr serves for documentation purposes.

@MaEtUgR MaEtUgR closed this Dec 19, 2024
@MaEtUgR MaEtUgR deleted the pr-Emergency_Braking branch December 19, 2024 12:04
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.

2 participants