![]() |
WALL-E Version 1.0
The "WALL-E" Project is a ME 507 quarter term project inspired to recreate the robot WALL-E. The WALL-E robot is a fully 3D printed robot with modified components in order to fit the needs of the chosen peripherals and electronics. WALL-E contains a custom made PCB which is housed in the main body of WALL-E. WALL-E's peripherals and components include 2 pololu Romi Motors with encoders, 4 MG90s servos, BNO055 IMU, and a OV2640 ArduCam camera. The objective of WALL-E is to scan the surrounding area for the closest object to it. Once that object is detected, WALL-E drives up to the object, attempts to pick up or hold the object and detect the color of the object.
|
WALL-E class that holds all necessary peripherals and devices in order to control WALL-E and complete it's goal and objective. More...
#include <WALLE_FSM.h>
Public Member Functions | |
| WALLE (BNO055 &imu, HCSR04 &range, RomiMotor &leftMotor, RomiMotor &rightMotor, OV2640Camera &camera, Servo &LArm, Servo &LHand, Servo &RArm, Servo &RHand) | |
| WALLE Constructor Function that holds reference to all sensors for use in FSM. | |
| void | init () |
| Function Initializes WALLE and restes the current PID States. | |
| void | update (float dt) |
| Function updates the FSM and peripherals at every call, creating the autonomous WALL_E Bot based on PID. | |
| void | simpleUpdate (float dt, float yaw, uint16_t distance) |
| Function that is a simpler version of the WALL-E FSM without the use PID controls and still utilizes external peripherals. | |
| void | closeHands () |
| Function is responsible for closing the hands on WALLE. | |
| void | liftArms () |
| Function is responsible for raising and lowering the arms. | |
| void | computerVision () |
Private Types | |
| enum class | State { START_SCAN , TURN_SEGMENT , STOP_MEASURE , FINISH_SCAN , TURN , FORWARD , STOP , IDENTIFY } |
| Enumeration for WALL-E State Transitions. More... | |
Private Member Functions | |
| void | stopMotors () |
| Function stops motors completely. | |
| float | normalizeAngle (float angle) |
Private Attributes | |
| enum WALLE::State | state |
| BNO055 & | imu |
| HCSR04 & | rangeSensor |
| RomiMotor & | leftMotor |
| RomiMotor & | rightMotor |
| OV2640Camera & | camera |
| Servo & | leftArm |
| Servo & | leftHand |
| Servo & | rightArm |
| Servo & | rightHand |
| PIDController | turnPID |
| PIDController | drivePID |
| float | targetYaw |
| float | initialYaw |
| int | currentSegment |
| int | totalSegments |
| float | segmentAngle |
| int | stopTimer |
| float | scanYawStart |
| int | distances [16] |
| int | candidateAngles [16] |
| uint32_t | actionDuration |
| uint32_t | actionStartTime |
| const float | yawTolerance = 2.0f |
| const uint16_t | distanceThreshold = 7 |
WALL-E class that holds all necessary peripherals and devices in order to control WALL-E and complete it's goal and objective.
|
strongprivate |
Enumeration for WALL-E State Transitions.
| Enumerator | |
|---|---|
| START_SCAN | START_SCAN FSM State to begin scans and data collection |
| TURN_SEGMENT | TURN_SEGMENT FSM State to turn to the next angle for data collection |
| STOP_MEASURE | STOP_MEASURE FSM State to record angle data and distance data |
| FINISH_SCAN | FINISH_SCAN FSM State that indicates all angles and distances have been recorded |
| TURN | TURN FSM State to turn to the angle which has the closest object detected |
| FORWARD | FORWARD FSM State to move forward towards the object |
| STOP | STOP FSM State to stop in front of object after a certain threshold |
| IDENTIFY | IDENTIFY FSM State to utilize computer vision to detect the color |
| WALLE::WALLE | ( | BNO055 & | imu, |
| HCSR04 & | range, | ||
| RomiMotor & | leftMotor, | ||
| RomiMotor & | rightMotor, | ||
| OV2640Camera & | camera, | ||
| Servo & | LArm, | ||
| Servo & | LHand, | ||
| Servo & | RArm, | ||
| Servo & | RHand ) |
WALLE Constructor Function that holds reference to all sensors for use in FSM.
| void WALLE::closeHands | ( | ) |
Function is responsible for closing the hands on WALLE.
| void WALLE::computerVision | ( | ) |
| void WALLE::init | ( | ) |
Function Initializes WALLE and restes the current PID States.
| void WALLE::liftArms | ( | ) |
Function is responsible for raising and lowering the arms.
|
private |
| void WALLE::simpleUpdate | ( | float | dt, |
| float | yaw, | ||
| uint16_t | distance ) |
Function that is a simpler version of the WALL-E FSM without the use PID controls and still utilizes external peripherals.
|
private |
Function stops motors completely.
| void WALLE::update | ( | float | dt | ) |
Function updates the FSM and peripherals at every call, creating the autonomous WALL_E Bot based on PID.
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |
|
private |