IMU Interface library to use MecanumController library

imu_interface.hpp

Committer:
sgrsn
Date:
2021-08-23
Revision:
0:981e748c841a

File content as of revision 0:981e748c841a:

#ifndef IMU_INTERFACE_HPP
#define IMU_INTERFACE_HPP

#include "PMSU_100.hpp"

class IMUInterface
{
    public:
    IMUInterface()
    {
    }
    virtual double GetYawRadians();
};

class PMSUInterface : public IMUInterface
{
    public:
    PMSUInterface(PinName tx, PinName rx) : IMUInterface(), device_(tx, rx)
    {
    }
    double GetYawRadians()
    {
        device_.update();
        return device_.yaw_rad;
    }
    
    private:
    PMSUSerial device_;
};


#endif