Skip to content
Snippets Groups Projects
Commit fbeb7b9c authored by Federico Mandelli's avatar Federico Mandelli
Browse files

[WingController] Tested code and fixed bugs

parent 817baf59
No related branches found
No related tags found
No related merge requests found
......@@ -39,8 +39,7 @@ namespace Parafoil
void PinHandler::onExpulsionPinTransition(PinTransition transition)
{
if (transition == DPL_SERVO_PIN_TRIGGER)
EventBroker::getInstance().post(FLIGHT_LAUNCH_PIN_DETACHED,
TOPIC_FLIGHT);
EventBroker::getInstance().post(FLIGHT_NC_DETACHED, TOPIC_FLIGHT);
}
std::map<PinsList, PinData> PinHandler::getPinsData()
......
......@@ -144,6 +144,12 @@ State FlightModeManager::state_init_error(const Event& event)
{
return HANDLED;
}
case TMTC_RESET_BOARD:
{
Logger::getInstance().stop();
reboot();
return HANDLED;
}
case TMTC_FORCE_INIT:
{
return transition(&FlightModeManager::state_init_done);
......
......@@ -81,7 +81,12 @@ State WingController::state_idle(const Boardcore::Event& event)
}
case FLIGHT_WING_ALT_PASSED:
{
return transition(&WingController::state_calibration);
return transition(&WingController::state_flying);
}
case EV_EMPTY:
{
return tranSuper(&WingController::state_top);
return HANDLED;
}
default:
{
......@@ -136,6 +141,14 @@ State WingController::state_calibration(const Boardcore::Event& event)
.startWindEstimationSchemeCalibration();
return HANDLED;
}
case EV_EXIT:
{
return HANDLED;
}
case EV_EMPTY:
{
return tranSuper(&WingController::state_flying);
}
case WING_WES_CALIBRATION:
{
Actuators::getInstance().stopTwirl();
......@@ -166,6 +179,14 @@ State WingController::state_controlled_descent(const Boardcore::Event& event)
AltitudeTrigger::getInstance().disable();
return transition(&WingController::state_calibration);
}
case EV_EMPTY:
{
return tranSuper(&WingController::state_flying);
}
case EV_EXIT:
{
return HANDLED;
}
default:
{
return UNHANDLED;
......@@ -185,6 +206,14 @@ State WingController::state_on_ground(const Boardcore::Event& event)
stopAlgorithm();
return HANDLED;
}
case EV_EXIT:
{
return HANDLED;
}
case EV_EMPTY:
{
return tranSuper(&WingController::state_top);
}
default:
{
return UNHANDLED;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment