Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
giacomo892 authored and giacomo892 committed Jun 7, 2018
1 parent bde2ae6 commit 963fcb7
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 11 deletions.
4 changes: 3 additions & 1 deletion src/main/fc/fc_msp_box.c
Expand Up @@ -189,7 +189,9 @@ 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
if(STATE(FIXED_WING)) {
activeBoxIds[activeBoxIdCount++] = BOXNAVCRUISE; //Temp fix before CRUISE will be active for MC
}
}
#endif

Expand Down
12 changes: 3 additions & 9 deletions src/main/navigation/navigation.c
Expand Up @@ -76,7 +76,7 @@ PG_DECLARE_ARRAY(navWaypoint_t, NAV_MAX_WAYPOINTS, nonVolatileWaypointList);
PG_REGISTER_ARRAY(navWaypoint_t, NAV_MAX_WAYPOINTS, nonVolatileWaypointList, PG_WAYPOINT_MISSION_STORAGE, 0);
#endif

PG_REGISTER_WITH_RESET_TEMPLATE(navConfig_t, navConfig, PG_NAV_CONFIG, 3);
PG_REGISTER_WITH_RESET_TEMPLATE(navConfig_t, navConfig, PG_NAV_CONFIG, 2);

PG_RESET_TEMPLATE(navConfig_t, navConfig,
.general = {
Expand Down Expand Up @@ -335,14 +335,11 @@ static const navigationFSMStateDescriptor_t navFSM[NAV_STATE_COUNT] = {
.mwState = MW_NAV_STATE_NONE,
.mwError = MW_NAV_ERROR_NONE,
.onEvent = {

//FIX WHOLE OF THIS:

[NAV_FSM_EVENT_TIMEOUT] = NAV_STATE_CRUISE_2D_IN_PROGRESS, // re-process the state
[NAV_FSM_EVENT_SWITCH_TO_IDLE] = NAV_STATE_IDLE,
[NAV_FSM_EVENT_SWITCH_TO_ALTHOLD] = NAV_STATE_ALTHOLD_INITIALIZE,
[NAV_FSM_EVENT_SWITCH_TO_POSHOLD_3D] = NAV_STATE_POSHOLD_3D_INITIALIZE,
[NAV_FSM_EVENT_SWITCH_TO_CRUISE_3D] = NAV_STATE_CRUISE_3D_INITIALIZE, //switch to 3D cruise if ALT HOLD is enabled
[NAV_FSM_EVENT_SWITCH_TO_CRUISE_3D] = NAV_STATE_CRUISE_3D_INITIALIZE,
[NAV_FSM_EVENT_SWITCH_TO_CRUISE_ADJ] = NAV_STATE_CRUISE_2D_ADJUSTING,
[NAV_FSM_EVENT_SWITCH_TO_RTH] = NAV_STATE_RTH_INITIALIZE,
[NAV_FSM_EVENT_SWITCH_TO_WAYPOINT] = NAV_STATE_WAYPOINT_INITIALIZE,
Expand All @@ -366,7 +363,7 @@ static const navigationFSMStateDescriptor_t navFSM[NAV_STATE_COUNT] = {
}
},

/** CRUISE_3D mode ************************************************/
/** CRUISE_3D mode ************************************************/
[NAV_STATE_CRUISE_3D_INITIALIZE] = {
.persistentId = NAV_PERSISTENT_ID_CRUISE_3D_INITIALIZE,
.onEntry = navOnEnteringState_NAV_STATE_CRUISE_3D_INITIALIZE,
Expand All @@ -390,9 +387,6 @@ static const navigationFSMStateDescriptor_t navFSM[NAV_STATE_COUNT] = {
.mwState = MW_NAV_STATE_NONE,
.mwError = MW_NAV_ERROR_NONE,
.onEvent = {

//FIX WHOLE OF THIS:

[NAV_FSM_EVENT_TIMEOUT] = NAV_STATE_CRUISE_3D_IN_PROGRESS, // re-process the state
[NAV_FSM_EVENT_SWITCH_TO_IDLE] = NAV_STATE_IDLE,
[NAV_FSM_EVENT_SWITCH_TO_ALTHOLD] = NAV_STATE_ALTHOLD_INITIALIZE,
Expand Down
2 changes: 1 addition & 1 deletion src/main/navigation/navigation_fixedwing.c
Expand Up @@ -344,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
calculateVirtualPositionTarget_FW(HZ2S(MIN_POSITION_UPDATE_RATE_HZ) * 2);

updatePositionHeadingController_FW(currentTimeUs, deltaMicrosPositionUpdate);
Expand Down

0 comments on commit 963fcb7

Please sign in to comment.