20 #include "LogConfiguration.h"
const unsigned int LEFT_MOTOR
Portnumber of the left motor on the motorshield.
void exitAction_followingLineForward()
executes the exit action of the followingLineForward
Contains the FSM to controll the Drive.
const double PID_KI
I-value of the PID-controller.
follow the line while driving forward state
const State getcurrentState()
Get the current State.
Class EnvironmentDetection provides an Interface for all Enviroment detection Systems of the Vehilce.
DriveCtrl::Event doAction_errorState()
main action of the errorState
void entryAction_idle()
executes the entry action of the idle
File that contains the configuratioindetails of the different modules.
DriveCtrl::Event doAction_turningAround()
executes the main action of the turningAround
void entryAction_turningLeft()
executes the entry action of the turningLeft
unsigned long currentMillis
will store current time
Ext.: Reset after Error occured.
Ext.: Follow the line backwards.
PID pController
PID-Controller Object.
double pController_Output
Controller Output.
Drive pDrive
Drive Object.
EnvironmentDetection pEnvdetect
EnviromentDetection Object.
const unsigned long ignoreSensorTurnMillis
sets how long the sensors are ignored for a turn
void exitAction_turningLeft()
executes the exit action of the turningLeft
Event currentEvent
holds the current event of the FSM
Provides an Interface for all Enviroment detection Systems of the Vehilce.
const double PID_KD
D-value of the PID-controller.
double pVal_d
D-Value (independet of SamplingTime)
State lastStateBevorError
holds the last state of the FSM so it's possible to resume after error
Class Drive handels the Driving-System and provides basic functions.
Ext.: Follow the line forwards.
void exitAction_idle()
executes the exit action of the idle
State currentState
holds the current state of the FSM
void process(Event e)
changes the state of the FSM based on the event
DriveCtrl::Event doAction_turningRight()
executes the main action of the turningRight
void exitAction_resetState()
exit action of the resetState
Event(DriveCtrl::* doActionFPtr)(void)
Functionpointer to call the current states do-function.
DriveCtrl::Event doAction_followingLineBackward()
executes the main action of the followingLineBackward
void entryAction_turningRight()
executes the entry action of the turningRight
void exitAction_turningAround()
executes the exit action of the turningAround
DriveCtrl::Event doAction_turningLeft()
executes the main action of the turningLeft
follow the line while driving backward state
Signal: Full line detected.
const unsigned int RIGHT_MOTOR
Portnumber of the right motor on the motorshield.
String decodeState(State state)
Decodes the State-Enum and returns a description.
String decodeEvent(Event event)
Decodes the Event-Enum and returns a description.
Signal: Line is alligned in the middle of the vehicle.
DriveCtrl::Event doAction_idle()
executes the main action of the idle
double pVal_i
I-Value (independet of SamplingTime)
State
Enum holds all possible states.
int pSampleTime
Controler SampleTime in ms.
void entryAction_errorState()
entry action of the errorState
void entryAction_followingLineForward()
executes the entry action of the followingLineForward
The Drive Class handles the activation of the dc-motors for the drive.
double pController_Input
Controller Input.
const unsigned long ignoreSensorAroundMillis
sets how long the sensors are ignored for a turning around
DriveCtrl::Event doAction_followingLineForward()
executes the main action of the followingLineForward
void exitAction_followingLineBackward()
executes the exit action of the followingLineBackward
Event
Enum holds all possible events.
void entryAction_followingLineBackward()
executes the entry action of the followingLineBackward
DriveCtrl::Event doAction_resetState()
main action of the resetState
Ext.: Turn around on position.
void loop()
Calls the do-function of the active state and hence generates Events.
void exitAction_turningRight()
executes the exit action of the turningRight
void entryAction_resetState()
entry action of the resetState
void exitAction_errorState()
exit action of the errorState
const double PID_KP
P-value of the PID-controller.
Ext.: Resume after Error occured.
double pController_Setpoint
Controller Setpoint.
unsigned long previousMillis
will store last time
DriveCtrl()
Construct a new Drive Ctrl object and set the currentState with idle state and initialize the PID-Con...
void entryAction_turningAround()
executes the entry action of the turningAround