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: send attitude target message implementation (for quadplanes) #25253

Closed
wants to merge 344 commits into from

Conversation

miodine
Copy link
Contributor

@miodine miodine commented Oct 13, 2023

Minor mod to the communication routine, whose purpose is to expose the target attitude for a plane operating in VTOL mode.

Might be useful for external in-flight PID tuning applications.

rmackay9 and others added 30 commits June 8, 2023 18:41
this copes with the M10S rejecting multiple-key VALGET calls. We fall
back to fetching one at a time
Co-authored-by: Randy Mackay <rmackay9@yahoo.com>

optional support to toggle GPIO pin at 10hz
this sets up the vwd integrator more reasonably when we are in
POSITION1 stage of VTOL landing. We need to have enough throttle to
cope with a headwind, but want it lower when we are at or above our
target closing speed so can minimise the amount of pitch up

This also makes the landing_desired_closing_velocity() consistent with
the landing speed used in approach, using average of airspeed min and
cruise speed if TECS_LAND_ARSPD is not set

The target airspeed for TECS during airbraking is now set to
ARSPD_FBW_MIN, on the basis we are trying to slow down to min speed,
and we have VTOL support which should prevent a stall.

To cope with a high headwind where ARSPD_FBW_MIN is below the headwind
we now check for too low achieved closing speed and switch to
POSITION1 which can use vfwd to get to the landing location
M10S (no storage) throws this for a considerable period of time and the wording makes this process sound scary.
The ResetVelocity() function is only supposed to reset XY states, not
Z state. Resetting the Z state for velocity results in a large
velocity glitch if a vehicle is descending or ascending when aiding
switches to AID_NONE

this fixes ArduPilot#19386
The ResetVelocity() function is only supposed to reset XY states, not
Z state. Resetting the Z state for velocity results in a large
velocity glitch if a vehicle is descending or ascending when aiding
switches to AID_NONE

this fixes ArduPilot#19386
this test was relying on the EKF bug fixed in this PR. The copter was
actually fully landing and touching the ground in the LAND phase
whereas the original intention of this test was that it not touch the
ground in LAND. See the graph in
ArduPilot#17104 where the test was
added
@miodine
Copy link
Contributor Author

miodine commented Oct 16, 2023

I did as it was requested - I applied the most recent suggestions, reverted any chages done in the logging part, and squashed the commits altogether.

Copy link
Member

@IamPete1 IamPete1 left a comment

Choose a reason for hiding this comment

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

I think this looks good. Its not added to any default stream rate, so it will not be sent by default, but it can be requested.

@IamPete1
Copy link
Member

@miodine I have marked for the dev cal which is this evening on Discord, your welcome to come along.

https://ardupilot.org/dev/docs/ardupilot-discord-server.html#weekly-dev-calls

@miodine
Copy link
Contributor Author

miodine commented Oct 16, 2023

All right, then I'll await the results of your discussion. Sorry for my clumsiness with all that, and thanks for the guidance

@miodine miodine changed the title Expose Attitude Target for a Quadplane Plane: send attitude target message implementation (for quadplanes) Oct 16, 2023
Copy link
Contributor

@tridge tridge left a comment

Choose a reason for hiding this comment

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

fix refs in copter too?

ArduPlane/GCS_Mavlink.cpp Show resolved Hide resolved
}

const Quaternion quat = plane.quadplane.attitude_control->get_attitude_target_quat();
const Vector3f ang_vel = plane.quadplane.attitude_control->get_attitude_target_ang_vel();
Copy link
Contributor

Choose a reason for hiding this comment

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

should be const ref

@tridge
Copy link
Contributor

tridge commented Oct 17, 2023

this needs to be against master, not plane-4.4

@tridge
Copy link
Contributor

tridge commented Oct 17, 2023

@IamPete1 will rework this as a PR against master

@IamPete1 IamPete1 self-assigned this Oct 17, 2023
@miodine miodine changed the base branch from Plane-4.4 to master October 17, 2023 11:25
@miodine miodine changed the base branch from master to Plane-4.4 October 17, 2023 11:35
@miodine miodine changed the base branch from Plane-4.4 to master October 17, 2023 11:41
@miodine miodine changed the base branch from master to Plane-4.4 October 17, 2023 11:42
Minor modification -  implementation of the send_attitude_target msg. streaming (for quadplanes). The code is analogous in its structure and functionality to the implementation in Copter

Co-Authored-By: Peter Hall <33176108+IamPete1@users.noreply.github.com>
@miodine miodine changed the base branch from Plane-4.4 to master October 17, 2023 14:30
@miodine miodine changed the base branch from master to Plane-4.4 October 17, 2023 14:31
@miodine miodine changed the base branch from Plane-4.4 to master October 17, 2023 14:36
@miodine miodine closed this Oct 17, 2023
@miodine miodine deleted the Plane-4.4-mods branch October 17, 2023 14:46
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.

None yet