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.
Loading...
Searching...
No Matches
WALLE Class Reference

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

Detailed Description

WALL-E class that holds all necessary peripherals and devices in order to control WALL-E and complete it's goal and objective.

Member Enumeration Documentation

◆ State

enum class WALLE::State
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

Constructor & Destructor Documentation

◆ WALLE()

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.

Member Function Documentation

◆ closeHands()

void WALLE::closeHands ( )

Function is responsible for closing the hands on WALLE.

Returns
None

◆ computerVision()

void WALLE::computerVision ( )

◆ init()

void WALLE::init ( )

Function Initializes WALLE and restes the current PID States.

Returns
None

◆ liftArms()

void WALLE::liftArms ( )

Function is responsible for raising and lowering the arms.

Returns
None

◆ normalizeAngle()

float WALLE::normalizeAngle ( float angle)
private

◆ simpleUpdate()

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.

Returns
None

◆ stopMotors()

void WALLE::stopMotors ( )
private

Function stops motors completely.

Returns
None

◆ update()

void WALLE::update ( float dt)

Function updates the FSM and peripherals at every call, creating the autonomous WALL_E Bot based on PID.

Returns
None

Member Data Documentation

◆ actionDuration

uint32_t WALLE::actionDuration
private

◆ actionStartTime

uint32_t WALLE::actionStartTime
private

◆ camera

OV2640Camera& WALLE::camera
private

◆ candidateAngles

int WALLE::candidateAngles[16]
private

◆ currentSegment

int WALLE::currentSegment
private

◆ distances

int WALLE::distances[16]
private

◆ distanceThreshold

const uint16_t WALLE::distanceThreshold = 7
private

◆ drivePID

PIDController WALLE::drivePID
private

◆ imu

BNO055& WALLE::imu
private

◆ initialYaw

float WALLE::initialYaw
private

◆ leftArm

Servo& WALLE::leftArm
private

◆ leftHand

Servo& WALLE::leftHand
private

◆ leftMotor

RomiMotor& WALLE::leftMotor
private

◆ rangeSensor

HCSR04& WALLE::rangeSensor
private

◆ rightArm

Servo& WALLE::rightArm
private

◆ rightHand

Servo& WALLE::rightHand
private

◆ rightMotor

RomiMotor& WALLE::rightMotor
private

◆ scanYawStart

float WALLE::scanYawStart
private

◆ segmentAngle

float WALLE::segmentAngle
private

◆ state

enum WALLE::State WALLE::state
private

◆ stopTimer

int WALLE::stopTimer
private

◆ targetYaw

float WALLE::targetYaw
private

◆ totalSegments

int WALLE::totalSegments
private

◆ turnPID

PIDController WALLE::turnPID
private

◆ yawTolerance

const float WALLE::yawTolerance = 2.0f
private

The documentation for this class was generated from the following files:
  • C:/Users/arath/OneDrive/Documents/ME 507/Project-WALLE/Code/Inc/WALLE_FSM.h
  • C:/Users/arath/OneDrive/Documents/ME 507/Project-WALLE/Code/src/WALLE_FSM.cpp