hidaka sato / IMUInterface
Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers imu_interface.hpp Source File

imu_interface.hpp

00001 #ifndef IMU_INTERFACE_HPP
00002 #define IMU_INTERFACE_HPP
00003 
00004 #include "PMSU_100.hpp"
00005 
00006 class IMUInterface
00007 {
00008     public:
00009     IMUInterface()
00010     {
00011     }
00012     virtual double GetYawRadians();
00013 };
00014 
00015 class PMSUInterface : public IMUInterface
00016 {
00017     public:
00018     PMSUInterface(PinName tx, PinName rx) : IMUInterface(), device_(tx, rx)
00019     {
00020     }
00021     double GetYawRadians()
00022     {
00023         device_.update();
00024         return device_.yaw_rad;
00025     }
00026     
00027     private:
00028     PMSUSerial device_;
00029 };
00030 
00031 
00032 #endif