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: ModeGuided: add an option_is_enabled method, use it #27141

Merged

Conversation

peterbarker
Copy link
Contributor

No description provided.

@peterbarker
Copy link
Contributor Author

Added a test for one of the options, others done my inspection only

@@ -1009,7 +1014,7 @@ void ModeGuided::set_yaw_state(bool use_yaw, float yaw_cd, bool use_yaw_rate, fl
// returns true if pilot's yaw input should be used to adjust vehicle's heading
bool ModeGuided::use_pilot_yaw(void) const
{
return (copter.g2.guided_options.get() & uint32_t(Options::IgnorePilotYaw)) == 0;
return option_is_enabled(Option::IgnorePilotYaw);
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
return option_is_enabled(Option::IgnorePilotYaw);
return !option_is_enabled(Option::IgnorePilotYaw);

@peterbarker peterbarker force-pushed the pr/copter-guided-option-is-enabled branch from 9efeecb to 515aa80 Compare May 28, 2024 00:07
@rmackay9
Copy link
Contributor

feel free to merge after those couple of small fixes.

@peterbarker peterbarker force-pushed the pr/copter-guided-option-is-enabled branch from 515aa80 to bebecf4 Compare May 28, 2024 00:09
@peterbarker peterbarker force-pushed the pr/copter-guided-option-is-enabled branch from bebecf4 to 60895d1 Compare May 28, 2024 00:38
@peterbarker
Copy link
Contributor Author

I've confirmed that using the copter singleton in the mode header does not work trivially, and my guess is that we'll end up with an include loop if we try to make it work.

@peterbarker peterbarker merged commit bdb84ed into ArduPilot:master May 29, 2024
71 checks passed
@peterbarker peterbarker deleted the pr/copter-guided-option-is-enabled branch May 31, 2024 03:34
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

4 participants