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

Plane: extend support of SET_POSITION_TARGET_GLOBAL_INT #25754

Conversation

srmainwaring
Copy link
Contributor

This PR extends support for the mavlink handler of SET_POSITION_TARGET_GLOBAL_INT to handle position (lat, lon) setpoints as well as altitude changes. If velocity and acceleration data is provided it is used to calculate the path curvature expressed as a loiter radius and direction.

See Also

Motivation

Detail

The following control methods from Plane are used:

  • plane.control_mode->handle_guided_request() is passed the position setpoint.
  • plane.mode_guided.set_radius_and_direction() is passed the radius and direction calculated from setpoint velocity and acceleration.
  • plane.adjust_altitude_target is called to force update the altitude, otherwise the current altitude set in set_guided_WP is used if the setpoint update rate is greater than the scheduled update rate of adjust_altitude_target, and the plane will not achieve the desired altitude.

Testing

  • Initial testing in SITL using the default quadplane model with the terrain navigation package commanding setpoints.

Tasks

  • Correct handling of the type_mask and coordinate_frame fields of SET_POSITION_TARGET_GLOBAL_INT.
  • Check fields are valid (position, velocity, acceleration).
  • Verify use of plane control functions is valid.

@srmainwaring srmainwaring marked this pull request as draft December 11, 2023 19:55
@srmainwaring srmainwaring changed the title Plane: extend support for SET_POSITION_TARGET_GLOBAL_INT to (lat, lon, alt) with velocity and accel inputs Plane: extend support of SET_POSITION_TARGET_GLOBAL_INT Dec 11, 2023
@srmainwaring srmainwaring force-pushed the wips/wip-plane-mavlink-set-pos-global branch from df5a139 to 4dd67ef Compare December 18, 2023 23:46
- Extend to handle position as well as altitude.
- Check for non-zero velocity and acceleration
- Calculate and update loiter radius and direction.
- Force update of adjust_altitude_target.
- Disable debug output to GCS.

Signed-off-by: Rhys Mainwaring <[email protected]>
Signed-off-by: Rhys Mainwaring <[email protected]>
@srmainwaring srmainwaring force-pushed the wips/wip-plane-mavlink-set-pos-global branch from 4dd67ef to 7a79292 Compare January 29, 2024 11:29
@srmainwaring
Copy link
Contributor Author

Superseded by #26262

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant