BeoPilot.H
00001 #include <vector>
00002 #include <deque>
00003 #include <list>
00004 #include "Serial.H"
00005 #include <control_toolbox/pid.h>
00006 #ifndef __BEOPILOT_H__
00007 #define __BEOPILOT_H__
00008
00009
00010 typedef struct{
00011 float time,transVel,rotVel,encoderX,encoderY,encoderOri,rcTransVel,rcRotVel;
00012 int rcMode;
00013 } motorData;
00014 typedef struct{
00015 double x;
00016 double y;
00017 double z;
00018
00019 }Point3D;
00020
00021
00022 class BeoPilot {
00023 public:
00024
00025 BeoPilot();
00026 ~BeoPilot();
00027
00028
00029
00030
00031 void start();
00032
00033
00034 void SetMotors(float motor1speed, float motor2speed);
00035
00036
00037 void SetMotorsPid(float motor1speed, float motor2speed);
00038
00039
00040 unsigned char getRCStatus();
00041
00042
00043 unsigned int getRCChannel(int channel);
00044
00045
00046 unsigned char getRCEnabled();
00047
00048
00049 unsigned int getRCSpeed();
00050
00051
00052 void UpdateRCStatus();
00053
00054
00055
00056
00057 void UpdatePosition(void);
00058
00059 void resetEncoder();
00060 Serial* itsSerial;
00061
00062
00063
00064
00065 std::vector<int> itsRCChannels;
00066 int itsEmergencyMode;
00067 int itsRemoteMode;
00068 float itsMotor1Speed;
00069 float itsMotor2Speed;
00070 int itsLeftEncoder;
00071 int itsRightEncoder;
00072 ros::Time itsPreviousTime;
00073 Point3D itsPosition;
00074 Point3D itsDiffPosition;
00075 Point3D itsVelocity;
00076 int itsLastRightEncoder;
00077 int itsLastLeftEncoder;
00078 double itsLeftMotorVelocity;
00079 double itsRightMotorVelocity;
00080 control_toolbox::Pid itsPidSpeed;
00081 control_toolbox::Pid itsPidRot;
00082 ros::Duration dt ;
00083
00084 };
00085 #endif