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
bno055.h
Go to the documentation of this file.
1/* USER CODE BEGIN Header */
19#ifndef INC_BNO055_H_
20#define INC_BNO055_H_
21
22#include "stm32f4xx_hal.h"
23#include <cstdint>
24#include <iostream>
25#include <stdbool.h>
26
27
32class BNO055{
33 public:
37 enum class REG: uint8_t{
38 CONFIG_MODE = 0x00,
39 IMU = 0x08,
40 NDOF = 0x0C
41 };
42
43 BNO055(I2C_HandleTypeDef *hi2c, uint8_t addr = 0x28);
44
45 bool init_imu(REG mode = REG::NDOF);
46 bool updateEuler();
47 bool readCalibStatus(uint8_t& sys, uint8_t& gyro, uint8_t& accel, uint8_t&mag);
48 bool updateGyro();
49 int16_t getYawRateZ();
50 int16_t getYaw();
51 int16_t getRoll();
52 int16_t getPitch();
53
54
55 private:
59 I2C_HandleTypeDef* hi2c;
60
64 uint8_t addr;
65
69 int16_t pitch;
70
74 int16_t yaw;
75
79 int16_t roll;
80
84 int16_t gyroX;
85
89 int16_t gyroY;
90
94 int16_t gyroZ;
95
96 bool writeByte(uint8_t reg, uint8_t value);
97 bool readLen(uint8_t reg, uint8_t* buffer, uint8_t len);
98};
99
100
101#endif /* INC_BNO055_H_ */
int16_t getRoll()
Function allows for the user to get the current roll value.
Definition bno055.cpp:117
int16_t pitch
Definition bno055.h:69
bool writeByte(uint8_t reg, uint8_t value)
Function writes values to the specified register given by the user.
Definition bno055.cpp:155
bool updateEuler()
Function Updates the Euler values based on the IMU's current readings. Roll Pitch,...
Definition bno055.cpp:66
REG
Enumerated class REG of the IMU modes that will be used.
Definition bno055.h:37
@ CONFIG_MODE
Definition bno055.h:38
@ NDOF
Definition bno055.h:40
@ IMU
Definition bno055.h:39
int16_t getPitch()
Function allows for the user to get the current pitch value.
Definition bno055.cpp:125
bool init_imu(REG mode=REG::NDOF)
Function handles the configuration and initialization of the BNO055 IMU.
Definition bno055.cpp:44
int16_t getYaw()
Function allows for the user to get the current yaw value.
Definition bno055.cpp:109
BNO055(I2C_HandleTypeDef *hi2c, uint8_t addr=0x28)
Constructor Function to initialize the BNO055 Class.
Definition bno055.cpp:35
bool readCalibStatus(uint8_t &sys, uint8_t &gyro, uint8_t &accel, uint8_t &mag)
Function Checks the Calibration status of the IMU and individual sensors.
Definition bno055.cpp:137
int16_t gyroY
Definition bno055.h:89
int16_t gyroZ
Definition bno055.h:94
bool readLen(uint8_t reg, uint8_t *buffer, uint8_t len)
Function reads the current value of the specified register given by the user.
Definition bno055.cpp:166
int16_t gyroX
Definition bno055.h:84
int16_t yaw
Definition bno055.h:74
int16_t roll
Definition bno055.h:79
int16_t getYawRateZ()
Function allows users to retrieve the yaw rate around the Z axis.
Definition bno055.cpp:101
bool updateGyro()
Function pull they data from the gyroscope retrieving angular velocities.
Definition bno055.cpp:85
I2C_HandleTypeDef * hi2c
Definition bno055.h:59
uint8_t addr
Definition bno055.h:64