Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependencies: BNO055_fusion mbed
LOCALIZE.h
- Committer:
- 12104404
- Date:
- 2016-03-01
- Revision:
- 1:8966a48ce8d5
- Parent:
- 0:96d6eb224379
- Child:
- 2:634c1adf89b2
File content as of revision 1:8966a48ce8d5:
#ifndef LOCALIZE_H
#define LOCALIZE_H
#include "mbed.h"
#include "BNO055.h"
#define R_P_ADDR 0x04
#define FRAME_H 180
#define FRAME_W 150
#define RX_OFF 7
#define RY_OFF 6
#define R_ERROR 14
#define ERROR_IMU -1
#define ERROR_RX_P -2
#define ERROR_RX_N -3
#define ERROR_RY_P -4
#define ERROR_RY_N -5
typedef struct {
int x;
int y;
int a;
}LOCALIZE_xya;
class LOCALIZE
{
public:
LOCALIZE(I2C& y_i2c, I2C& x_imu_i2c, PinName imu_reset);
int init(void);
void get_angle(LOCALIZE_xya *xya);
void get_xy(LOCALIZE_xya *xya);
protected:
I2C _y_i2c;
I2C _x_imu_i2c;
BNO055 _imu;
BNO055_EULER_TypeDef _euler;
BNO055_GRAVITY_TypeDef _gravity;
BNO055_LIN_ACC_TypeDef _accel;
LOCALIZE_xya _xya;
};
#endif //LOCALIZE_H