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: support precision QLOITER in quadplanes #26436

Merged
merged 3 commits into from Mar 11, 2024

Conversation

tridge
Copy link
Contributor

@tridge tridge commented Mar 7, 2024

This extends the plane_precland.lua script to support precision loiter, enabled with the same AUX function as for copter (value 39)

added SIM_PLD_SHIP to make the precland location track the SIM_SHIP
location, giving a nice way of having a landing marker on a moving
ship
and allow for moving landing target
@tridge tridge requested a review from IamPete1 March 7, 2024 07:18
@tridge tridge added the WikiNeeded needs wiki update label Mar 7, 2024
Vector2f target_accel;
Vector2f target_speed_xy_cms{quadplane.poscontrol.velocity_match.x*100, quadplane.poscontrol.velocity_match.y*100};
quadplane.pos_control->input_vel_accel_xy(target_speed_xy_cms, target_accel);
quadplane.poscontrol.last_velocity_match_ms = 0;
Copy link
Member

Choose a reason for hiding this comment

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

This means that you have to send matching at at least loop rate or it will start slowing down again? Why not just wait for the timeout to expire?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

it doesn't seem to, I checked with gdb and there doesn't seem to be anything else that overrides the velocity. I got the same speed with and without this for QLOITER, so I thought it was safer to apply once

@@ -29,6 +33,36 @@ void ModeQLoiter::update()
void ModeQLoiter::run()
{
const uint32_t now = AP_HAL::millis();

#if AC_PRECLAND_ENABLED
const uint32_t precland_timeout_ms = 250;
Copy link
Member

Choose a reason for hiding this comment

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

Elsewhere we use a 1 second timeout.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

my main concern is for users that use QLOITER as bail-out for QLAND if prec-land goes wrong. I wanted it to stop moving towards a bad target as soon as possible
note that there is a race condition with mode change and the lua script. I'd like to find a way to solve this, suggestions welcome

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.

Looks good.

@tridge tridge merged commit b9fbc7d into ArduPilot:master Mar 11, 2024
90 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: 4.5.0-beta3
Development

Successfully merging this pull request may close these issues.

None yet

3 participants