|
SmartVehicle-Sortic
SmartFactory
|
Contains the FSM for the Navigation. More...
#include <NavigationCtrl.h>

Classes | |
| struct | ActualPos |
| Holds the actual information about the vehicleposition. More... | |
| struct | TargetPos |
| Holds the information about the vehicle target. More... | |
Public Types | |
| enum | Event { Event::MoveToTargetPosition, Event::PosEndPointReached, Event::PosTransitReached, Event::PosReached, Event::Error, Event::Resume, Event::Reset, Event::NoEvent } |
| Enum holds all possible events. More... | |
| enum | State { State::endPoint, State::toGateway, State::gateway, State::crossTransit, State::toEndPoint, State::resetState, State::errorState } |
| Enum holds all possible states for the Navigation. More... | |
| enum | Sector { Sector::SorticHandover, Sector::SorticToHandover, Sector::SorticWaitForGateway, Sector::SorticGateway, Sector::TransitWaitForGatewaySortic, Sector::TransitToSortic, Sector::TransitToTransfer, Sector::Parking, Sector::TransitWaitForGatewayTransfer, Sector::TransferGateway, Sector::TransferWaitForGateway, Sector::TransferToHandover, Sector::TransferHandover, Sector::error } |
| Enum holds all possible sectors. More... | |
Public Member Functions | |
| NavigationCtrl () | |
| Construct a new Navigation Ctrl object and initailize the currentState with endPoint state. More... | |
| void | loop () |
| Calls the do-function of the active state and hence generates Events. More... | |
| void | loop (Event currentEvent) |
| Procceses the current Event and calls the do-function of the active state. More... | |
| const State | getcurrentState () |
| Get the current State. More... | |
| const Sector | getcurrentSector () |
| Get the current Sector. More... | |
| const int | getcurrentLine () |
| Get the current Line. More... | |
| void | setTargetPosition (Sector sector, const int line) |
| Set the Target Position object. More... | |
| void | setActualPosition (Sector sector, const int line) |
| Set the actual Position object. More... | |
| void | giveToken () |
| give Token to access the Gateway More... | |
| String | decodeSector (Sector sector) |
| Decodes the Sector-Enum and returns a description. More... | |
| NavigationCtrl::Sector | decodeSector (String sector) |
| Decodes a sectro String and returns the sector. More... | |
Private Member Functions | |
| void | process (Event e) |
| changes the state of the FSM based on the event More... | |
| void | entryAction_endPoint () |
| executes the entry action of the endPoint state. More... | |
| NavigationCtrl::Event | doAction_endPoint () |
| executes the main action of the endPoint state. This is an Idel-state ->NoEvent generated More... | |
| void | exitAction_endPoint () |
| executes the exit action of the endPoint state. More... | |
| void | entryAction_toGateway () |
| executes the entry action of the toGateway state. More... | |
| NavigationCtrl::Event | doAction_toGateway () |
| executes the main action of the toGateway state. More... | |
| void | exitAction_toGateway () |
| executes the exit action of the toGateway state. More... | |
| void | entryAction_gateway () |
| executes the entry action of the gateway state. More... | |
| NavigationCtrl::Event | doAction_gateway () |
| executes the main action of the gateway state. More... | |
| void | exitAction_gateway () |
| executes the exit action of the gateway state. More... | |
| void | entryAction_crossTransit () |
| executes the entry action of the crossTransit state. More... | |
| NavigationCtrl::Event | doAction_crossTransit () |
| executes the main action of the crossTransit state. More... | |
| void | exitAction_crossTransit () |
| executes the exit action of the crossTransit state. More... | |
| void | entryAction_toEndPoint () |
| executes the entry action of the toEndPoint state. More... | |
| NavigationCtrl::Event | doAction_toEndPoint () |
| executes the main action of the toEndPoint state. More... | |
| void | exitAction_toEndPoint () |
| executes the exit action of the toEndPoint state. More... | |
| void | entryAction_errorState () |
| entry action of the errorState state. More... | |
| NavigationCtrl::Event | doAction_errorState () |
| main action of the errorState state. More... | |
| void | exitAction_errorState () |
| exit action of the errorState state. More... | |
| void | entryAction_resetState () |
| entry action of the resetState More... | |
| NavigationCtrl::Event | doAction_resetState () |
| main action of the resetState More... | |
| void | exitAction_resetState () |
| exit action of the resetState More... | |
| String | decodeState (State state) |
| Decodes the State-Enum and returns a description. More... | |
| String | decodeEvent (Event event) |
| Decodes the Event-Enum and returns a description. More... | |
Private Attributes | |
| State | lastStateBevorError |
| holds the last state of the FSM so it's possible to resume after error More... | |
| State | currentState |
| holds the current state of the FSM More... | |
| Event | currentEvent |
| holds the current event of the FSM More... | |
| int | pCurrentSubState = 0 |
| Counter for the Current Substate. More... | |
| int | pLastSubStateBevorError = 0 |
| Holds the last Substate befor an Error occured. More... | |
| int | pSubStateLoopInc = 0 |
| Counter so you can call the same substatefunction multiple times. More... | |
| struct NavigationCtrl::ActualPos | pActual |
| struct NavigationCtrl::TargetPos | pTarget |
| bool | tranistonce = true |
| prevents an loop between transit and gateway More... | |
| DriveCtrl::Event | pLastGatewayTurn |
| Variable which holds the last made turn in gateway. More... | |
| Event(NavigationCtrl::* | doActionFPtr )(void) = nullptr |
| Functionpointer to call the current states do-function. More... | |
| DriveCtrl | pDriveCtrl |
| Navigation Object. More... | |
|
strong |
Enum holds all possible events.
Definition at line 34 of file NavigationCtrl.h.
|
strong |
Enum holds all possible states for the Navigation.
| Enumerator | |
|---|---|
| endPoint | endPoint State |
| toGateway | toGateway State |
| gateway | gateway State |
| crossTransit | crossTransit State |
| toEndPoint | toEndPoint State |
| resetState | reset state |
| errorState | error State |
Definition at line 48 of file NavigationCtrl.h.
|
strong |
Enum holds all possible sectors.
Definition at line 61 of file NavigationCtrl.h.
| NavigationCtrl::NavigationCtrl | ( | ) |
Construct a new Navigation Ctrl object and initailize the currentState with endPoint state.
Definition at line 18 of file NavigationCtrl.cpp.
| void NavigationCtrl::loop | ( | ) |
Calls the do-function of the active state and hence generates Events.
Definition at line 21 of file NavigationCtrl.cpp.
| void NavigationCtrl::loop | ( | Event | currentEvent | ) |
Procceses the current Event and calls the do-function of the active state.
| currentEvent | - Event |
Definition at line 26 of file NavigationCtrl.cpp.
| const NavigationCtrl::State NavigationCtrl::getcurrentState | ( | ) |
Get the current State.
Definition at line 32 of file NavigationCtrl.cpp.
| const NavigationCtrl::Sector NavigationCtrl::getcurrentSector | ( | ) |
Get the current Sector.
Definition at line 38 of file NavigationCtrl.cpp.
| const int NavigationCtrl::getcurrentLine | ( | ) |
Get the current Line.
Definition at line 43 of file NavigationCtrl.cpp.
| void NavigationCtrl::setTargetPosition | ( | Sector | sector, |
| const int | line | ||
| ) |
Set the Target Position object.
| sector | - TargetSector ( HandoverSortic or HandoverTransfer) |
| line | - TargetLine |
Definition at line 48 of file NavigationCtrl.cpp.
| void NavigationCtrl::setActualPosition | ( | Sector | sector, |
| const int | line | ||
| ) |
Set the actual Position object.
| sector | - actualSector ( HandoverSortic or HandoverTransfer) |
| line | - actualLine |
Definition at line 54 of file NavigationCtrl.cpp.
| void NavigationCtrl::giveToken | ( | ) |
give Token to access the Gateway
Definition at line 60 of file NavigationCtrl.cpp.
| String NavigationCtrl::decodeSector | ( | Sector | sector | ) |
Decodes the Sector-Enum and returns a description.
| sector | - enum Sector |
Definition at line 65 of file NavigationCtrl.cpp.
| NavigationCtrl::Sector NavigationCtrl::decodeSector | ( | String | sector | ) |
Decodes a sectro String and returns the sector.
| sector | - Sector as String |
Definition at line 113 of file NavigationCtrl.cpp.
|
private |
changes the state of the FSM based on the event
| e | - Event |
Definition at line 144 of file NavigationCtrl.cpp.
|
private |
executes the entry action of the endPoint state.
Update actual sector and startsector with taregt sector.
Definition at line 240 of file NavigationCtrl.cpp.
|
private |
executes the main action of the endPoint state. This is an Idel-state ->NoEvent generated
Definition at line 256 of file NavigationCtrl.cpp.
|
private |
executes the exit action of the endPoint state.
Definition at line 262 of file NavigationCtrl.cpp.
|
private |
executes the entry action of the toGateway state.
Definition at line 268 of file NavigationCtrl.cpp.
|
private |
executes the main action of the toGateway state.
Definition at line 282 of file NavigationCtrl.cpp.
|
private |
executes the exit action of the toGateway state.
Definition at line 312 of file NavigationCtrl.cpp.
|
private |
executes the entry action of the gateway state.
Definition at line 318 of file NavigationCtrl.cpp.
|
private |
executes the main action of the gateway state.
Definition at line 334 of file NavigationCtrl.cpp.
|
private |
executes the exit action of the gateway state.
Definition at line 450 of file NavigationCtrl.cpp.
|
private |
executes the entry action of the crossTransit state.
Definition at line 472 of file NavigationCtrl.cpp.
|
private |
executes the main action of the crossTransit state.
drive forward three times and return Event::PosReached
Definition at line 487 of file NavigationCtrl.cpp.
|
private |
executes the exit action of the crossTransit state.
Definition at line 503 of file NavigationCtrl.cpp.
|
private |
executes the entry action of the toEndPoint state.
Definition at line 509 of file NavigationCtrl.cpp.
|
private |
executes the main action of the toEndPoint state.
drive forward once and return Event::PosEndPointReached
Definition at line 524 of file NavigationCtrl.cpp.
|
private |
executes the exit action of the toEndPoint state.
Definition at line 539 of file NavigationCtrl.cpp.
|
private |
entry action of the errorState state.
Definition at line 545 of file NavigationCtrl.cpp.
|
private |
main action of the errorState state.
Definition at line 555 of file NavigationCtrl.cpp.
|
private |
exit action of the errorState state.
Definition at line 561 of file NavigationCtrl.cpp.
|
private |
entry action of the resetState
Definition at line 566 of file NavigationCtrl.cpp.
|
private |
main action of the resetState
Definition at line 572 of file NavigationCtrl.cpp.
|
private |
exit action of the resetState
Definition at line 578 of file NavigationCtrl.cpp.
|
private |
Decodes the State-Enum and returns a description.
| state | - enum State |
Definition at line 590 of file NavigationCtrl.cpp.
|
private |
Decodes the Event-Enum and returns a description.
| event | - enum Event |
Definition at line 618 of file NavigationCtrl.cpp.
|
private |
holds the last state of the FSM so it's possible to resume after error
Definition at line 159 of file NavigationCtrl.h.
|
private |
holds the current state of the FSM
Definition at line 160 of file NavigationCtrl.h.
|
private |
holds the current event of the FSM
Definition at line 161 of file NavigationCtrl.h.
|
private |
Counter for the Current Substate.
Definition at line 162 of file NavigationCtrl.h.
|
private |
Holds the last Substate befor an Error occured.
Definition at line 163 of file NavigationCtrl.h.
|
private |
Counter so you can call the same substatefunction multiple times.
Definition at line 164 of file NavigationCtrl.h.
|
private |
|
private |
|
private |
prevents an loop between transit and gateway
Definition at line 187 of file NavigationCtrl.h.
|
private |
Variable which holds the last made turn in gateway.
Definition at line 188 of file NavigationCtrl.h.
|
private |
Functionpointer to call the current states do-function.
https://stackoverfendPoint.com/questions/1485983/calling-c-class-methods-via-a-function-pointer
Definition at line 196 of file NavigationCtrl.h.
|
private |
Navigation Object.
Definition at line 198 of file NavigationCtrl.h.