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

clean code #7802

Merged
merged 1 commit into from
Aug 16, 2017
Merged

clean code #7802

merged 1 commit into from
Aug 16, 2017

Conversation

oneWayOut
Copy link
Contributor

change a little bit to make the code more readable

change a little bit to make the code more readable
@@ -829,16 +829,6 @@ FixedwingPositionControl::control_position(const math::Vector<2> &curr_pos, cons
wp_distance_save = 0.0f;
}

// create virtual waypoint which is on the desired flight path but
Copy link
Member

Choose a reason for hiding this comment

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

why is this removed?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Because it's not used anywhere.

Copy link
Member

Choose a reason for hiding this comment

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

Did you flight test with these changes?

Copy link
Member

Choose a reason for hiding this comment

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

Thanks @oneWayOut. I was actually thinking of restoring this functionality, but we might as well delete this unused chunk until I get around to it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

In SITL, the new code works well. I have not do a real flight test yet. @TSC21

Copy link
Member

Choose a reason for hiding this comment

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

That's definitely good practice, although in this case I think SITL is sufficient.

@@ -1041,6 +1030,11 @@ FixedwingAttitudeControl::task_main()
_wheel_ctrl.reset_integrator();
}

float roll_sp = _att_sp.roll_body;
Copy link
Member

@TSC21 TSC21 Aug 16, 2017

Choose a reason for hiding this comment

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

Maybe add a line comment saying /* Update attitude setpoint variables */

Copy link
Contributor Author

Choose a reason for hiding this comment

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

As there is no comment before, I just leave it as that. Maybe you can add as you wish.

Copy link
Member

Choose a reason for hiding this comment

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

It was you that added these variables before at this point so if you don't mind adding this comment, we appreciate.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

do I need to do a new PR? @TSC21

Copy link
Member

Choose a reason for hiding this comment

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

A new commit. But let it as is, no issue if there's no description.

@dagar
Copy link
Member

dagar commented Aug 16, 2017

Looks good, I'll merge once CI passes. There's still a lot of dead code in these controllers that make them seem more complicated than they actually are.

@dagar dagar merged commit 63306ad into PX4:master Aug 16, 2017
@oneWayOut oneWayOut deleted the cairevise branch August 17, 2017 15:01
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