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

Copter: GCS_MAVLink: populate flags using position controller active flags #28131

Merged
merged 2 commits into from
Sep 26, 2024

Conversation

IamPete1
Copy link
Member

This means we don't need to switch on the mode number, extracted from #28110

This is the first time we will be using these flags for reporting, until now it is used internally only. There are some changes in behaviour, for example you can be landed in auto mode in which case the pos controller may not report as active (i need to check).

Copy link
Contributor

@peterbarker peterbarker left a comment

Choose a reason for hiding this comment

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

I like this change.

case Mode::Number::POSHOLD:
case Mode::Number::BRAKE:
case Mode::Number::SMART_RTL:
if ((copter.pos_control != nullptr) && copter.pos_control->is_active_xy()) {
_base_mode |= MAV_MODE_FLAG_GUIDED_ENABLED;
Copy link
Contributor

Choose a reason for hiding this comment

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

This makes our answer here marginally worse.

My reading of that attribute is we should only set it actually chasing a waypoints "flies waypoints / mission items".

Not a blocker, but we really should cut this down to AUTO, AUTO_RTL, RTL and SMART_RTL at some stage.

@IamPete1 IamPete1 force-pushed the copter_mavlink_poscontrol branch from 1269765 to 2143070 Compare September 21, 2024 17:03
@IamPete1
Copy link
Member Author

IamPete1 commented Sep 21, 2024

I have rebased, I tested the auto mode case when disarmed or armed but waiting for high throttle in both cases both XY and Z control are active.

However, I can't guarantee that this is the same in every combination of mode and submode. If we wanted identical behavior then this could be a per mode function call.

Copy link
Contributor

@rmackay9 rmackay9 left a comment

Choose a reason for hiding this comment

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

This is probably OK but we decided that a bit of testing with MP and QGC is warranted. At least a grep through MP/QGC to see if they use the flag at all

@robertlong13
Copy link
Collaborator

This is probably OK but we decided that a bit of testing with MP and QGC is warranted. At least a grep through MP/QGC to see if they use the flag at all

MP doesn't look at them.
image

@IamPete1
Copy link
Member Author

I have grepped QGC, there are no users of these bits there either.

@rmackay9 rmackay9 merged commit 25e77a5 into ArduPilot:master Sep 26, 2024
75 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants