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

Rover: Summarize FALSE's decision #26962

Closed

Conversation

muramura
Copy link
Contributor

@muramura muramura commented May 2, 2024

Summarize the judgment that is FALSE.
Judgments are made individually in IF statements.
The judgment result only returns FLASE.

Copy link
Member

@IamPete1 IamPete1 left a comment

Choose a reason for hiding this comment

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

Sorry, I think the original way is easier to understand.

@muramura
Copy link
Contributor Author

muramura commented May 3, 2024

@IamPete1 san.
Other methods are doing the same process as mine.

https://github.com/ArduPilot/ardupilot/blob/master/Rover/sailboat.cpp#L285

@peterbarker
Copy link
Contributor

I agree with @IamPete1 ; the current code is far easier to understand.

@muramura the example you cite has no choice but to use a compound expression there - it can't use the "early return pattern". Currently that example is still understandable - but a little more complexity in there and it might be worth breaking out a force_motor_out method or something. Not yet, 'though :-)

Sorry, closing this as it's a step backwards in readability and maintainability.

@peterbarker peterbarker closed this Sep 7, 2024
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