Skip to content

Conversation

@muramura
Copy link
Contributor

This change clarifies the precondition checks in ModeFlip::init().

The checks are reordered for readability, and both roll and pitch inputs
are validated at init time. No behavior change is intended.

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.

This LGTM

We used to have this check, by my reading.

// only allow flip when flying
if (!motors->armed() || copter.ap.land_complete) {
// ensure roll and pitch input is less than 40deg
if ((abs(channel_roll->get_control_in()) >= 4000) || (abs(channel_pitch->get_control_in()) >= 4000)) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
if ((abs(channel_roll->get_control_in()) >= 4000) || (abs(channel_pitch->get_control_in()) >= 4000)) {
if ((abs(channel_roll->get_control_in()) >= 4000) ||
(abs(channel_pitch->get_control_in()) >= 4000)) {

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants