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

Altitude FlightTask based on jerk-limited trajectory generator #11744

Merged
merged 1 commit into from
Apr 3, 2019

Conversation

bresch
Copy link
Member

@bresch bresch commented Mar 29, 2019

This FlightTask is a strip-down version of the PositionSmoothVel FlightTask in order to have consistent behavior between altitude and position controlled modes for a specific position sub-mode (MPC_POS_MODE)

This FlightTask is then used in altitude mode, when MPC_POS_MODE = 3.

There will come later a refactor of both AltitudeSmoothVel and PositionSmoothVel in order to reduce the amount of copy/paste between those two FlightTasks.

The plot below shows a SITL test where the first part (until the red vertical line) is Altitude mode and the second part (after the red vertical line) is Position mode.
2019-03-29_15-25-32_01_plot

Describe problem solved by the proposed pull request
When MPC_POS_MODE = 3 (Smooth velocity), the behavior of the Z axis is different between the Altitude and Position controlled modes.

Describe your preferred solution
Use the same algorithm for altitude and position control.

velocity smoothing library to create a jerk-limited trajectory along the
Z axis. This FlightTask is used when MPC_POS_MODE = 3.
@bresch bresch force-pushed the dev-altitude-smooth-vel branch from b0e42d2 to 24332f5 Compare March 29, 2019 14:40
Copy link
Member

@bkueng bkueng left a comment

Choose a reason for hiding this comment

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

Looks good.

_smoothing.setMaxVel(_constraints.speed_down);
}

float jerk = _param_mpc_jerk_max.get();
Copy link
Member

Choose a reason for hiding this comment

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

  • does it make sense to use the same jerk limit as for xy?
  • you overwrite jerk below unconditionally

Copy link
Member Author

Choose a reason for hiding this comment

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

  • We could have a different parameter for jerk Z but I think most people will leave it as is. I never had the feeling that I needed to adjust it until now.

  • Right, I'll keep that in mind for the next iteration

@DanielePettenuzzo
Copy link
Contributor

@bresch and I flew this yesterday and everything looked good.

Flight log: https://review.px4.io/plot_app?log=cfcc49cc-c28a-4cf7-b0ce-153065957b71

@DanielePettenuzzo DanielePettenuzzo merged commit 99fb88c into master Apr 3, 2019
@DanielePettenuzzo DanielePettenuzzo deleted the dev-altitude-smooth-vel branch April 3, 2019 08:49
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.

3 participants