MPU9250 test without magnetometer

This commit is contained in:
2023-07-22 21:37:54 -03:00
parent 181dbd202e
commit e567566e30
16 changed files with 11761 additions and 30 deletions

View File

@@ -11,6 +11,7 @@
#include "main.h"
#include "BTS7960B.hpp"
#include "Encoder.hpp"
#include "MPU9250/MPU9250.h"
class Robot {
public:
@@ -20,6 +21,7 @@ public:
void controlCallback();
void init();
private:
void print_roll_pitch_yaw();
const float reductionRatio = 30;
const float wheelRadius = 0.073025; //m
const float ticksPerSecond = 100;
@@ -29,6 +31,7 @@ private:
Encoder encoder1 = Encoder(&(TIM3->CNT), &(TIM3->ARR), 52);
BTS7960B motor0 = BTS7960B(&(TIM2->CCR1), &(TIM2->CCR2), &(TIM2->ARR), &(TIM2->ARR), GPIOB, GPIO_PIN_4, GPIOB, GPIO_PIN_5);
BTS7960B motor1 = BTS7960B(&(TIM2->CCR3), &(TIM2->CCR4), &(TIM2->ARR), &(TIM2->ARR), GPIOB, GPIO_PIN_0, GPIOB, GPIO_PIN_1);
MPU9250 imu0;
};
#endif /* SRC_COMPONENTS_ROBOT_HPP_ */