Skip to content

Commit

Permalink
Delete quaternion related code
Browse files Browse the repository at this point in the history
The code is not used, since MPU6050_6Axis_MotionApps20.h and
MPU6050_9Axis_MotionApps41.h due to deps to freeRTOS are not included
  • Loading branch information
xeonqq committed Jul 28, 2023
1 parent 6b20199 commit 6fd135a
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 449 deletions.
1 change: 0 additions & 1 deletion Sming/Libraries/MPU6050/MPU6050.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3221,7 +3221,6 @@ void MPU6050::setIntDMPEnabled(bool enabled)
}

// DMP_INT_STATUS

bool MPU6050::getDMPInt5Status()
{
I2Cdev::readBit(devAddr, MPU6050_RA_DMP_INT_STATUS, MPU6050_DMPINT_5_BIT, buffer);
Expand Down
205 changes: 0 additions & 205 deletions Sming/Libraries/MPU6050/MPU6050.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ THE SOFTWARE.
#ifndef _MPU6050_H_
#define _MPU6050_H_

#include "helper_3dmath.h"
#include <Libraries/I2Cdev/I2Cdev.h>

// supporting link:
Expand All @@ -54,7 +53,6 @@ THE SOFTWARE.
//#define pgm_read_float(x) (*(x))
//#define PSTR(STR) STR

#define MPU6050_INCLUDE_DMP_MOTIONAPPS20
#define MPU6050_ADDRESS_AD0_LOW 0x68 // address pin low (GND), default for InvenSense evaluation board
#define MPU6050_ADDRESS_AD0_HIGH 0x69 // address pin high (VCC)
#define MPU6050_DEFAULT_ADDRESS MPU6050_ADDRESS_AD0_LOW
Expand Down Expand Up @@ -827,209 +825,6 @@ class MPU6050
uint8_t getDMPConfig2();
void setDMPConfig2(uint8_t config);

// special methods for MotionApps 2.0 implementation
#ifdef MPU6050_INCLUDE_DMP_MOTIONAPPS20
uint8_t* dmpPacketBuffer;
uint16_t dmpPacketSize;

uint8_t dmpInitialize();
bool dmpPacketAvailable();

uint8_t dmpSetFIFORate(uint8_t fifoRate);
uint8_t dmpGetFIFORate();
uint8_t dmpGetSampleStepSizeMS();
uint8_t dmpGetSampleFrequency();
int32_t dmpDecodeTemperature(int8_t tempReg);

// Register callbacks after a packet of FIFO data is processed
// uint8_t dmpRegisterFIFORateProcess(inv_obj_func func, int16_t priority);
// uint8_t dmpUnregisterFIFORateProcess(inv_obj_func func);
uint8_t dmpRunFIFORateProcesses();

// Setup FIFO for various output
uint8_t dmpSendQuaternion(uint_fast16_t accuracy);
uint8_t dmpSendGyro(uint_fast16_t elements, uint_fast16_t accuracy);
uint8_t dmpSendAccel(uint_fast16_t elements, uint_fast16_t accuracy);
uint8_t dmpSendLinearAccel(uint_fast16_t elements, uint_fast16_t accuracy);
uint8_t dmpSendLinearAccelInWorld(uint_fast16_t elements, uint_fast16_t accuracy);
uint8_t dmpSendControlData(uint_fast16_t elements, uint_fast16_t accuracy);
uint8_t dmpSendSensorData(uint_fast16_t elements, uint_fast16_t accuracy);
uint8_t dmpSendExternalSensorData(uint_fast16_t elements, uint_fast16_t accuracy);
uint8_t dmpSendGravity(uint_fast16_t elements, uint_fast16_t accuracy);
uint8_t dmpSendPacketNumber(uint_fast16_t accuracy);
uint8_t dmpSendQuantizedAccel(uint_fast16_t elements, uint_fast16_t accuracy);
uint8_t dmpSendEIS(uint_fast16_t elements, uint_fast16_t accuracy);

// Get Fixed Point data from FIFO
uint8_t dmpGetAccel(int32_t* data, const uint8_t* packet = 0);
uint8_t dmpGetAccel(int16_t* data, const uint8_t* packet = 0);
uint8_t dmpGetAccel(VectorInt16* v, const uint8_t* packet = 0);
uint8_t dmpGetQuaternion(int32_t* data, const uint8_t* packet = 0);
uint8_t dmpGetQuaternion(int16_t* data, const uint8_t* packet = 0);
uint8_t dmpGetQuaternion(Quaternion* q, const uint8_t* packet = 0);
uint8_t dmpGet6AxisQuaternion(int32_t* data, const uint8_t* packet = 0);
uint8_t dmpGet6AxisQuaternion(int16_t* data, const uint8_t* packet = 0);
uint8_t dmpGet6AxisQuaternion(Quaternion* q, const uint8_t* packet = 0);
uint8_t dmpGetRelativeQuaternion(int32_t* data, const uint8_t* packet = 0);
uint8_t dmpGetRelativeQuaternion(int16_t* data, const uint8_t* packet = 0);
uint8_t dmpGetRelativeQuaternion(Quaternion* data, const uint8_t* packet = 0);
uint8_t dmpGetGyro(int32_t* data, const uint8_t* packet = 0);
uint8_t dmpGetGyro(int16_t* data, const uint8_t* packet = 0);
uint8_t dmpGetGyro(VectorInt16* v, const uint8_t* packet = 0);
uint8_t dmpSetLinearAccelFilterCoefficient(float coef);
uint8_t dmpGetLinearAccel(int32_t* data, const uint8_t* packet = 0);
uint8_t dmpGetLinearAccel(int16_t* data, const uint8_t* packet = 0);
uint8_t dmpGetLinearAccel(VectorInt16* v, const uint8_t* packet = 0);
uint8_t dmpGetLinearAccel(VectorInt16* v, VectorInt16* vRaw, VectorFloat* gravity);
uint8_t dmpGetLinearAccelInWorld(int32_t* data, const uint8_t* packet = 0);
uint8_t dmpGetLinearAccelInWorld(int16_t* data, const uint8_t* packet = 0);
uint8_t dmpGetLinearAccelInWorld(VectorInt16* v, const uint8_t* packet = 0);
uint8_t dmpGetLinearAccelInWorld(VectorInt16* v, VectorInt16* vReal, Quaternion* q);
uint8_t dmpGetGyroAndAccelSensor(int32_t* data, const uint8_t* packet = 0);
uint8_t dmpGetGyroAndAccelSensor(int16_t* data, const uint8_t* packet = 0);
uint8_t dmpGetGyroAndAccelSensor(VectorInt16* g, VectorInt16* a, const uint8_t* packet = 0);
uint8_t dmpGetGyroSensor(int32_t* data, const uint8_t* packet = 0);
uint8_t dmpGetGyroSensor(int16_t* data, const uint8_t* packet = 0);
uint8_t dmpGetGyroSensor(VectorInt16* v, const uint8_t* packet = 0);
uint8_t dmpGetControlData(int32_t* data, const uint8_t* packet = 0);
uint8_t dmpGetTemperature(int32_t* data, const uint8_t* packet = 0);
uint8_t dmpGetGravity(int32_t* data, const uint8_t* packet = 0);
uint8_t dmpGetGravity(int16_t* data, const uint8_t* packet = 0);
uint8_t dmpGetGravity(VectorInt16* v, const uint8_t* packet = 0);
uint8_t dmpGetGravity(VectorFloat* v, Quaternion* q);
uint8_t dmpGetUnquantizedAccel(int32_t* data, const uint8_t* packet = 0);
uint8_t dmpGetUnquantizedAccel(int16_t* data, const uint8_t* packet = 0);
uint8_t dmpGetUnquantizedAccel(VectorInt16* v, const uint8_t* packet = 0);
uint8_t dmpGetQuantizedAccel(int32_t* data, const uint8_t* packet = 0);
uint8_t dmpGetQuantizedAccel(int16_t* data, const uint8_t* packet = 0);
uint8_t dmpGetQuantizedAccel(VectorInt16* v, const uint8_t* packet = 0);
uint8_t dmpGetExternalSensorData(int32_t* data, uint16_t size, const uint8_t* packet = 0);
uint8_t dmpGetEIS(int32_t* data, const uint8_t* packet = 0);

uint8_t dmpGetEuler(float* data, Quaternion* q);
uint8_t dmpGetYawPitchRoll(float* data, Quaternion* q, VectorFloat* gravity);

// Get Floating Point data from FIFO
uint8_t dmpGetAccelFloat(float* data, const uint8_t* packet = 0);
uint8_t dmpGetQuaternionFloat(float* data, const uint8_t* packet = 0);

uint8_t dmpProcessFIFOPacket(const unsigned char* dmpData);
uint8_t dmpReadAndProcessFIFOPacket(uint8_t numPackets, uint8_t* processed = NULL);

uint8_t dmpSetFIFOProcessedCallback(void (*func)(void));

uint8_t dmpInitFIFOParam();
uint8_t dmpCloseFIFO();
uint8_t dmpSetGyroDataSource(uint8_t source);
uint8_t dmpDecodeQuantizedAccel();
uint32_t dmpGetGyroSumOfSquare();
uint32_t dmpGetAccelSumOfSquare();
void dmpOverrideQuaternion(long* q);
uint16_t dmpGetFIFOPacketSize();
#endif

// special methods for MotionApps 4.1 implementation
#ifdef MPU6050_INCLUDE_DMP_MOTIONAPPS41
uint8_t* dmpPacketBuffer;
uint16_t dmpPacketSize;

uint8_t dmpInitialize();
bool dmpPacketAvailable();

uint8_t dmpSetFIFORate(uint8_t fifoRate);
uint8_t dmpGetFIFORate();
uint8_t dmpGetSampleStepSizeMS();
uint8_t dmpGetSampleFrequency();
int32_t dmpDecodeTemperature(int8_t tempReg);

// Register callbacks after a packet of FIFO data is processed
// uint8_t dmpRegisterFIFORateProcess(inv_obj_func func, int16_t priority);
// uint8_t dmpUnregisterFIFORateProcess(inv_obj_func func);
uint8_t dmpRunFIFORateProcesses();

// Setup FIFO for various output
uint8_t dmpSendQuaternion(uint_fast16_t accuracy);
uint8_t dmpSendGyro(uint_fast16_t elements, uint_fast16_t accuracy);
uint8_t dmpSendAccel(uint_fast16_t elements, uint_fast16_t accuracy);
uint8_t dmpSendLinearAccel(uint_fast16_t elements, uint_fast16_t accuracy);
uint8_t dmpSendLinearAccelInWorld(uint_fast16_t elements, uint_fast16_t accuracy);
uint8_t dmpSendControlData(uint_fast16_t elements, uint_fast16_t accuracy);
uint8_t dmpSendSensorData(uint_fast16_t elements, uint_fast16_t accuracy);
uint8_t dmpSendExternalSensorData(uint_fast16_t elements, uint_fast16_t accuracy);
uint8_t dmpSendGravity(uint_fast16_t elements, uint_fast16_t accuracy);
uint8_t dmpSendPacketNumber(uint_fast16_t accuracy);
uint8_t dmpSendQuantizedAccel(uint_fast16_t elements, uint_fast16_t accuracy);
uint8_t dmpSendEIS(uint_fast16_t elements, uint_fast16_t accuracy);

// Get Fixed Point data from FIFO
uint8_t dmpGetAccel(int32_t* data, const uint8_t* packet = 0);
uint8_t dmpGetAccel(int16_t* data, const uint8_t* packet = 0);
uint8_t dmpGetAccel(VectorInt16* v, const uint8_t* packet = 0);
uint8_t dmpGetQuaternion(int32_t* data, const uint8_t* packet = 0);
uint8_t dmpGetQuaternion(int16_t* data, const uint8_t* packet = 0);
uint8_t dmpGetQuaternion(Quaternion* q, const uint8_t* packet = 0);
uint8_t dmpGet6AxisQuaternion(int32_t* data, const uint8_t* packet = 0);
uint8_t dmpGet6AxisQuaternion(int16_t* data, const uint8_t* packet = 0);
uint8_t dmpGet6AxisQuaternion(Quaternion* q, const uint8_t* packet = 0);
uint8_t dmpGetRelativeQuaternion(int32_t* data, const uint8_t* packet = 0);
uint8_t dmpGetRelativeQuaternion(int16_t* data, const uint8_t* packet = 0);
uint8_t dmpGetRelativeQuaternion(Quaternion* data, const uint8_t* packet = 0);
uint8_t dmpGetGyro(int32_t* data, const uint8_t* packet = 0);
uint8_t dmpGetGyro(int16_t* data, const uint8_t* packet = 0);
uint8_t dmpGetGyro(VectorInt16* v, const uint8_t* packet = 0);
uint8_t dmpGetMag(int16_t* data, const uint8_t* packet = 0);
uint8_t dmpSetLinearAccelFilterCoefficient(float coef);
uint8_t dmpGetLinearAccel(int32_t* data, const uint8_t* packet = 0);
uint8_t dmpGetLinearAccel(int16_t* data, const uint8_t* packet = 0);
uint8_t dmpGetLinearAccel(VectorInt16* v, const uint8_t* packet = 0);
uint8_t dmpGetLinearAccel(VectorInt16* v, VectorInt16* vRaw, VectorFloat* gravity);
uint8_t dmpGetLinearAccelInWorld(int32_t* data, const uint8_t* packet = 0);
uint8_t dmpGetLinearAccelInWorld(int16_t* data, const uint8_t* packet = 0);
uint8_t dmpGetLinearAccelInWorld(VectorInt16* v, const uint8_t* packet = 0);
uint8_t dmpGetLinearAccelInWorld(VectorInt16* v, VectorInt16* vReal, Quaternion* q);
uint8_t dmpGetGyroAndAccelSensor(int32_t* data, const uint8_t* packet = 0);
uint8_t dmpGetGyroAndAccelSensor(int16_t* data, const uint8_t* packet = 0);
uint8_t dmpGetGyroAndAccelSensor(VectorInt16* g, VectorInt16* a, const uint8_t* packet = 0);
uint8_t dmpGetGyroSensor(int32_t* data, const uint8_t* packet = 0);
uint8_t dmpGetGyroSensor(int16_t* data, const uint8_t* packet = 0);
uint8_t dmpGetGyroSensor(VectorInt16* v, const uint8_t* packet = 0);
uint8_t dmpGetControlData(int32_t* data, const uint8_t* packet = 0);
uint8_t dmpGetTemperature(int32_t* data, const uint8_t* packet = 0);
uint8_t dmpGetGravity(int32_t* data, const uint8_t* packet = 0);
uint8_t dmpGetGravity(int16_t* data, const uint8_t* packet = 0);
uint8_t dmpGetGravity(VectorInt16* v, const uint8_t* packet = 0);
uint8_t dmpGetGravity(VectorFloat* v, Quaternion* q);
uint8_t dmpGetUnquantizedAccel(int32_t* data, const uint8_t* packet = 0);
uint8_t dmpGetUnquantizedAccel(int16_t* data, const uint8_t* packet = 0);
uint8_t dmpGetUnquantizedAccel(VectorInt16* v, const uint8_t* packet = 0);
uint8_t dmpGetQuantizedAccel(int32_t* data, const uint8_t* packet = 0);
uint8_t dmpGetQuantizedAccel(int16_t* data, const uint8_t* packet = 0);
uint8_t dmpGetQuantizedAccel(VectorInt16* v, const uint8_t* packet = 0);
uint8_t dmpGetExternalSensorData(int32_t* data, uint16_t size, const uint8_t* packet = 0);
uint8_t dmpGetEIS(int32_t* data, const uint8_t* packet = 0);

uint8_t dmpGetEuler(float* data, Quaternion* q);
uint8_t dmpGetYawPitchRoll(float* data, Quaternion* q, VectorFloat* gravity);

// Get Floating Point data from FIFO
uint8_t dmpGetAccelFloat(float* data, const uint8_t* packet = 0);
uint8_t dmpGetQuaternionFloat(float* data, const uint8_t* packet = 0);

uint8_t dmpProcessFIFOPacket(const unsigned char* dmpData);
uint8_t dmpReadAndProcessFIFOPacket(uint8_t numPackets, uint8_t* processed = NULL);

uint8_t dmpSetFIFOProcessedCallback(void (*func)(void));

uint8_t dmpInitFIFOParam();
uint8_t dmpCloseFIFO();
uint8_t dmpSetGyroDataSource(uint8_t source);
uint8_t dmpDecodeQuantizedAccel();
uint32_t dmpGetGyroSumOfSquare();
uint32_t dmpGetAccelSumOfSquare();
void dmpOverrideQuaternion(long* q);
uint16_t dmpGetFIFOPacketSize();
#endif

void CalibrateGyro(uint8_t Loops = 15); // Fine tune after setting offsets with less Loops.
void CalibrateAccel(uint8_t Loops = 15); // Fine tune after setting offsets with less Loops.
void PID(uint8_t ReadAddress, float kP, float kI, uint8_t Loops); // Does the
Expand Down
Loading

0 comments on commit 6fd135a

Please sign in to comment.