Sam Shum / ros_mbed_base_controller
Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers ActionEncoder.hpp Source File

ActionEncoder.hpp

00001 /*
00002  * ActionEncoder.hpp
00003  *
00004  *  Created on: 7 Mar 2018
00005  *      Author: tung
00006  */
00007 
00008 #ifndef INCLUDE_ACTIONENCODER_HPP_
00009 #define INCLUDE_ACTIONENCODER_HPP_
00010 
00011 #include <stdint.h>
00012 //#include <Serial.hpp>
00013 
00014 class ActionEncoder
00015 {
00016 private:
00017     uint8_t count,i,done;
00018     union{
00019         uint8_t data[24];
00020         float val[6];
00021     }posture;
00022     float xangle,yangle,zangle,pos_x,pos_y,angleSpeed,d_angle;
00023     float temp_zangle;
00024     bool newDataArrived;
00025 public:
00026     ActionEncoder();
00027     void readEncoder(char);
00028     bool updated();
00029     float getXangle();
00030     float getYangle();
00031     float getZangle();
00032     float getXpos();
00033     float getYpos();
00034     float getAngleSpeed();
00035     char * reset();
00036     char * calibrate();
00037     bool isAlive();
00038     bool newDataAvailable();
00039     uint32_t LastRead;
00040 
00041 };
00042 
00043 
00044 
00045 
00046 
00047 
00048 
00049 #endif /* INCLUDE_ACTIONENCODER_HPP_ */