14 #ifndef NAVIGATIONCTRL_H__ 15 #define NAVIGATIONCTRL_H__ 19 #include "DriveCtrl.h" void entryAction_endPoint()
executes the entry action of the endPoint state.
const Sector getcurrentSector()
Get the current Sector.
Sector startSector
Startpoint from current path.
NavigationCtrl::Event doAction_toEndPoint()
executes the main action of the toEndPoint state.
int pCurrentSubState
Counter for the Current Substate.
Signal: PosTransitReached.
void exitAction_resetState()
exit action of the resetState
void exitAction_endPoint()
executes the exit action of the endPoint state.
void entryAction_errorState()
entry action of the errorState state.
NavigationCtrl::Event doAction_toGateway()
executes the main action of the toGateway state.
Ext.: Reset after Error occured.
NavigationCtrl::Event doAction_errorState()
main action of the errorState state.
DriveCtrl pDriveCtrl
Navigation Object.
Sortic - Wait for Gateway.
void giveToken()
give Token to access the Gateway
State lastStateBevorError
holds the last state of the FSM so it's possible to resume after error
int pLastSubStateBevorError
Holds the last Substate befor an Error occured.
NavigationCtrl()
Construct a new Navigation Ctrl object and initailize the currentState with endPoint state.
Ext: Resume after Error occured.
void entryAction_resetState()
entry action of the resetState
Ext: Start MoveToTargetPosition.
String decodeEvent(Event event)
Decodes the Event-Enum and returns a description.
Transfer - wait for Gateway.
NavigationCtrl::Event doAction_gateway()
executes the main action of the gateway state.
void exitAction_gateway()
executes the exit action of the gateway state.
State currentState
holds the current state of the FSM
Holds the information about the vehicle target.
void setTargetPosition(Sector sector, const int line)
Set the Target Position object.
Sector sector
actual sector
Transit - Wait for Gateway Transfer.
void exitAction_toGateway()
executes the exit action of the toGateway state.
Event(NavigationCtrl::* doActionFPtr)(void)
Functionpointer to call the current states do-function.
Sector lastSector
last sector
NavigationCtrl::Event doAction_endPoint()
executes the main action of the endPoint state. This is an Idel-state ->NoEvent generated
void loop()
Calls the do-function of the active state and hence generates Events.
bool token
token for gateway accees
Signal: PosEndPointReached.
NavigationCtrl::Event doAction_resetState()
main action of the resetState
struct NavigationCtrl::ActualPos pActual
NavigationCtrl::Event doAction_crossTransit()
executes the main action of the crossTransit state.
const State getcurrentState()
Get the current State.
void entryAction_gateway()
executes the entry action of the gateway state.
void process(Event e)
changes the state of the FSM based on the event
Contains the FSM for the Navigation.
String decodeState(State state)
Decodes the State-Enum and returns a description.
Event
Enum holds all possible events.
Contains Pre-Compiler directives for diffent Serialprints for Datalogin.
State
Enum holds all possible states for the Navigation.
Signal: Position reached.
void exitAction_crossTransit()
executes the exit action of the crossTransit state.
Event currentEvent
holds the current event of the FSM
void exitAction_errorState()
exit action of the errorState state.
Holds the actual information about the vehicleposition.
String decodeSector(Sector sector)
Decodes the Sector-Enum and returns a description.
void entryAction_toGateway()
executes the entry action of the toGateway state.
Transit - Wait for Gateway Sortic.
const int getcurrentLine()
Get the current Line.
int pSubStateLoopInc
Counter so you can call the same substatefunction multiple times.
struct NavigationCtrl::TargetPos pTarget
void setActualPosition(Sector sector, const int line)
Set the actual Position object.
void entryAction_toEndPoint()
executes the entry action of the toEndPoint state.
void exitAction_toEndPoint()
executes the exit action of the toEndPoint state.
DriveCtrl::Event pLastGatewayTurn
Variable which holds the last made turn in gateway.
void entryAction_crossTransit()
executes the entry action of the crossTransit state.
bool tranistonce
prevents an loop between transit and gateway
Sector sector
TargetSector.
Sector
Enum holds all possible sectors.