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

Implement CRUISE MODE for Fixed Wing #3311

Merged
merged 6 commits into from
Jun 16, 2018

Conversation

giacomo892
Copy link
Collaborator

@giacomo892 giacomo892 commented Jun 2, 2018

Implementing CRUISE MODE (2D and 3D) for Fixed Wing aircrafts.

2D Mode: The aircraft will maintain the current heading unless pilot changes it via yaw input or roll the aircraft.

3D Mode: The aircraft will maintain the current altitude (change via pitch command) and the current heading unless pilot changes it via yaw input or roll the aircraft.

It can be enabled together with launch mode so the aircraft will enter in CRUISE MODE right after the launch is over.

Thanks to @shellixyz for the contribution to the code and the massive amount of time spent in testing and fix issues with the implementation.

As today the code it is being flown and works but indeed code need a review.

@giacomo892 giacomo892 force-pushed the nav_cruise_mode branch 5 times, most recently from 19b2b29 to 970c308 Compare June 4, 2018 17:47
@@ -188,6 +189,7 @@ void initActiveBoxIds(void)
activeBoxIds[activeBoxIdCount++] = BOXNAVWP;
activeBoxIds[activeBoxIdCount++] = BOXHOMERESET;
activeBoxIds[activeBoxIdCount++] = BOXGCSNAV;
if(STATE(FIXED_WING)) {activeBoxIds[activeBoxIdCount++] = BOXNAVCRUISE;} //Temp fix before CRUISE will be active for MC
Copy link
Member

Choose a reason for hiding this comment

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

Please, move the if body into its own line.

@@ -340,7 +344,7 @@ void applyFixedWingPositionController(timeUs_t currentTimeUs)
// Calculate virtual position target at a distance of forwardVelocity * HZ2S(POSITION_TARGET_UPDATE_RATE_HZ)
// Account for pilot's roll input (move position target left/right at max of max_manual_speed)
// POSITION_TARGET_UPDATE_RATE_HZ should be chosen keeping in mind that position target shouldn't be reached until next pos update occurs
// FIXME: verify the above
// FIXME: verify the above-
Copy link
Member

Choose a reason for hiding this comment

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

Can you remove the extra -? Seems it's the only change in this line.

@giacomo892 giacomo892 force-pushed the nav_cruise_mode branch 2 times, most recently from 9517fb1 to 963fcb7 Compare June 7, 2018 20:14
@fiam fiam added this to the 2.0 milestone Jun 8, 2018
@giacomo892 giacomo892 force-pushed the nav_cruise_mode branch 2 times, most recently from 21ce792 to b92e208 Compare June 11, 2018 12:17
@digitalentity
Copy link
Member

@giacomo892 @shellixyz rebase is required

@shellixyz shellixyz deleted the nav_cruise_mode branch June 16, 2018 15:27
@shellixyz shellixyz restored the nav_cruise_mode branch June 16, 2018 15:27
@shellixyz
Copy link
Collaborator

Rebased and squashed. I tested this extensively it is ready to merge IMO.

@digitalentity digitalentity merged commit 46ef27d into iNavFlight:development Jun 16, 2018
@digitalentity
Copy link
Member

Squashed again and merged. Thanks!

@giacomo892 giacomo892 deleted the nav_cruise_mode branch June 16, 2018 20:18
@fiam fiam mentioned this pull request Jul 19, 2018
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.

4 participants