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

Projects
None yet
4 participants
@giacomo892
Copy link
Collaborator

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 giacomo892:nav_cruise_mode branch 5 times, most recently from 19b2b29 to 970c308 Jun 2, 2018

@@ -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

This comment has been minimized.

Copy link
@fiam

fiam Jun 6, 2018

Member

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-

This comment has been minimized.

Copy link
@fiam

fiam Jun 6, 2018

Member

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

@giacomo892 giacomo892 force-pushed the giacomo892:nav_cruise_mode branch 2 times, most recently from 9517fb1 to 963fcb7 Jun 6, 2018

@fiam fiam added this to the 2.0 milestone Jun 8, 2018

@giacomo892 giacomo892 force-pushed the giacomo892:nav_cruise_mode branch 2 times, most recently from 21ce792 to b92e208 Jun 9, 2018

@digitalentity

This comment has been minimized.

Copy link
Member

commented Jun 16, 2018

@giacomo892 @shellixyz rebase is required

@shellixyz shellixyz force-pushed the giacomo892:nav_cruise_mode branch from d941f50 to 4771028 Jun 16, 2018

@shellixyz shellixyz deleted the giacomo892:nav_cruise_mode branch Jun 16, 2018

@shellixyz shellixyz restored the giacomo892:nav_cruise_mode branch Jun 16, 2018

@shellixyz shellixyz force-pushed the giacomo892:nav_cruise_mode branch from 4771028 to fe06cb2 Jun 16, 2018

@shellixyz

This comment has been minimized.

Copy link
Collaborator

commented Jun 16, 2018

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

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

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details
@digitalentity

This comment has been minimized.

Copy link
Member

commented Jun 16, 2018

Squashed again and merged. Thanks!

@giacomo892 giacomo892 deleted the giacomo892:nav_cruise_mode branch Jun 16, 2018

@fiam fiam referenced this pull request Jul 19, 2018

Closed

Add cruise mode #3228

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.