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: add Copter::option_enabled(...) replacing bitops vs copter.g2… #27334

Merged
merged 2 commits into from
Jun 20, 2024

Conversation

peterbarker
Copy link
Contributor

….flight_options

I've already added a test for an option bit in autotest and played with same in SITL

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.

add the uint32_t into the enum class and then LGTM

@@ -622,11 +622,13 @@ class Copter : public AP_Vehicle {
};


enum class FlightOptions {
enum class FlightOption {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Suggested change
enum class FlightOption {
enum class FlightOption : uint32_t {

these strigs would only be released if release() or grab were called a second time
@peterbarker
Copy link
Contributor Author

Now also fixes intermittent new test by fixing the Gripper code to emit messages correctly.

@@ -104,8 +104,10 @@ void AP_Gripper_Servo::update_gripper()
// Check for successful grabbed or released
if (config.state == AP_Gripper::STATE_GRABBING && has_state_pwm(config.grab_pwm)) {
config.state = AP_Gripper::STATE_GRABBED;
GCS_SEND_TEXT(MAV_SEVERITY_INFO, "Gripper load grabbed");
Copy link
Contributor

Choose a reason for hiding this comment

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

Does this perhaps result in duplicate messages being output? I see we're already outputting these messages higher up in the file

@peterbarker
Copy link
Contributor Author

peterbarker commented Jun 20, 2024 via email

@peterbarker peterbarker merged commit 56a7e52 into ArduPilot:master Jun 20, 2024
92 checks passed
@peterbarker peterbarker deleted the pr/tidy-flight-options branch June 23, 2024 23:49
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.

3 participants