00001
00002
00003
00004
00005
00006
00007
00008
00009 #ifndef BHANDEXT_H
00010 #define BHANDEXT_H
00011
00012 #include <bhand.h>
00013 #include "event_handler.h"
00014 #include <exception>
00015
00023 struct MotorFeedback
00024 {
00025 char loopFeedbackVel;
00026 unsigned char loopFeedbackStrain;
00027 unsigned short loopFeedbackAbsPos;
00028 char loopFeedbackDeltaPos;
00029 };
00030
00035 struct FeedbackBlock
00036 {
00037 MotorFeedback mf[4];
00038 unsigned short loopFeedbackTemp;
00039 } ;
00040
00045 struct MotorControl
00046 {
00047 char loopCtrlVel;
00048 unsigned char loopCtrlPropGain;
00049 };
00050
00055 struct ControlBlock
00056 {
00057 MotorControl mc[4];
00058 };
00059
00060
00068 class BHandExt : public BHand, public Event_Handler
00069 {
00070
00071
00072 public:
00078 BHandExt(const std::string devName);
00079
00080 ~BHandExt();
00081
00091 void rtMode(const Motors motors);
00092
00098 FeedbackBlock send(ControlBlock cb) throw (BHandException);
00099
00104 FeedbackBlock getFeedbackBlock() throw (BHandException);
00105
00106
00108
00109 protected:
00110 int lcv, lcvc, lcpg, lfv, lfvc, lfs, lfap, lfdp, lfdpc, lft;
00111 int fbSize;
00112 void send (char* s, int size) throw (BHandException);
00113 void read(char* s) throw (BHandException);
00114 virtual void handle_signal (int) {stop();abort();};
00115 FeedbackBlock receiveFeedbackBlock() throw (BHandException);
00116
00117 };
00118
00119 #endif