ROME2 Lab3
StateMachine Class Reference
This class implements a simple state machine for a mobile robot. More...
#include <StateMachine.h>
Public Member Functions | |
| StateMachine (Controller &controller, DigitalOut &enableMotorDriver, DigitalOut &led0, DigitalOut &led1, DigitalOut &led2, DigitalOut &led3, DigitalOut &led4, DigitalOut &led5, DigitalIn &button, IRSensor &irSensor0, IRSensor &irSensor1, IRSensor &irSensor2, IRSensor &irSensor3, IRSensor &irSensor4, IRSensor &irSensor5) | |
| Creates and initializes a state machine object. | |
| virtual | ~StateMachine () |
| Deletes the state machine object and releases all allocated resources. | |
| int | getState () |
| Gets the actual state of this state machine. | |
Detailed Description
This class implements a simple state machine for a mobile robot.
It allows to move the robot forward, and to turn left or right, depending on distance measurements, to avoid collisions with obstacles.
Definition at line 25 of file StateMachine.h.
Constructor & Destructor Documentation
| StateMachine | ( | Controller & | controller, |
| DigitalOut & | enableMotorDriver, | ||
| DigitalOut & | led0, | ||
| DigitalOut & | led1, | ||
| DigitalOut & | led2, | ||
| DigitalOut & | led3, | ||
| DigitalOut & | led4, | ||
| DigitalOut & | led5, | ||
| DigitalIn & | button, | ||
| IRSensor & | irSensor0, | ||
| IRSensor & | irSensor1, | ||
| IRSensor & | irSensor2, | ||
| IRSensor & | irSensor3, | ||
| IRSensor & | irSensor4, | ||
| IRSensor & | irSensor5 | ||
| ) |
Creates and initializes a state machine object.
Definition at line 24 of file StateMachine.cpp.
| ~StateMachine | ( | ) | [virtual] |
Deletes the state machine object and releases all allocated resources.
Definition at line 37 of file StateMachine.cpp.
Member Function Documentation
| int getState | ( | ) |
Gets the actual state of this state machine.
- Returns:
- the actual state as an int constant.
Definition at line 46 of file StateMachine.cpp.
Generated on Wed Jul 13 2022 16:04:31 by
1.7.2