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

Terrain following fix #21885

Closed
wants to merge 2 commits into from
Closed

Terrain following fix #21885

wants to merge 2 commits into from

Conversation

joe-bfd
Copy link

@joe-bfd joe-bfd commented Jul 25, 2023

Solved Problem

When using jerk limited/acceleration based input position controllers I found that terrain following was not functional. Terrain following z position setpoints were ignored.

Solution

Only set position setpoint to current position if z position setpoint is not already set

@joe-bfd joe-bfd changed the title draft PR terrain_following fix draft PR terrain following fix Jul 26, 2023
@joe-bfd joe-bfd changed the title draft PR terrain following fix Terrain following fix Jul 26, 2023
@dagar
Copy link
Member

dagar commented Jul 27, 2023

Trivial whitespace thing is making astyle angry. https://github.com/PX4/PX4-Autopilot/actions/runs/5674219445/job/15377357389?pr=21885
image

@joe-bfd
Copy link
Author

joe-bfd commented Jul 27, 2023

Updated. Will check the output a little later to make sure It's all green lit

@github-actions github-actions bot added the stale label Aug 27, 2023
@joe-bfd
Copy link
Author

joe-bfd commented Sep 5, 2023

Hey guys, any update on this PR? I can rebase it onto latest master if we want

@dagar
Copy link
Member

dagar commented Sep 5, 2023

It wasn't exactly clear to me why this is the right fix, could we do it more explicitly so it's obvious?

Are you interested in terrain hold or the full terrain following? Could it apply to only the current default manual position control mode or is it actually needed across all altitude and position control modes?

Ping me on slack if you want to discuss directly.

@julianoes
Copy link
Contributor

Is this still work in progress or can we close it?

@bresch
Copy link
Member

bresch commented Oct 25, 2023

The issue with that patch is that FlightTaskAltitude is now producing the altitude setpoint in all cases, meaning that locking won't be as smooth as when done using the smooth vel variant.
For this, we might need to rewrite the terrain following/hold logic in FlightTaskAltitudeSmoothVel. It might be a good opportunity to review it and extract it in a class.

@AlexKlimaj
Copy link
Member

@bresch maybe we want to make _terrain_hold a public variable of FlightTaskManualAltitude, then FlightTaskManualAltitudeSmoothVel can check before it does _position_setpoint(2) = _smoothing.getCurrentPosition();

@bresch
Copy link
Member

bresch commented Nov 6, 2023

replaced by #22294

@bresch bresch closed this Nov 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants