00001 #ifndef __MCD3006S_H__ 00002 #define __MCD3006S_H__ 00003 00029 #include <ros/ros.h> 00030 00031 #include "motor_driver_interface.h" 00032 #include "serial_port/rs232.h" 00033 00034 class Mcdc3006s : public MotorDriverInterface { 00035 public: 00039 Mcdc3006s(); 00040 00044 ~Mcdc3006s(); 00045 00049 int init(int baudrate, char *dev, char *sem); 00050 00056 int enableDriver(); 00057 00063 int disableDriver(); 00064 00076 int getDriverConf(driverConf_t *dc); 00077 00084 int setDriverConf(driverConf_t dc); 00085 00099 int saveToFlash(); 00100 00101 /* set configuration to the driver */ 00102 00113 int activateLimits(int action); 00114 00115 /* get configuration from the driver */ 00116 00127 long int getDriverMaxPos(); 00128 00137 long int getDriverMinPos(); 00138 00148 long int getDriverMaxVel(); 00149 00158 long int getDriverMaxAcc(); 00159 00170 long int getDriverMaxDec(); 00171 00182 int getDriverCurLim(); 00183 00194 int getDriverPCurLim(); 00195 00196 /* get status from the driver */ 00197 00204 int getDriverStatus(driverStatus_t * drvStatus); 00205 00206 /* get motorSensor from the driver */ 00207 00214 int getDriverSensor(driverSensor_t *sensor); 00215 00222 int getDriverInstantPos(long int *positon); 00223 00230 int getDriverInstantVel(long int *velocity); 00231 00239 int getDriverInstantCurrent(int *current); 00240 00249 int setDriverMaxPos(long int maxPos); 00250 00259 int setDriverMinPos(long int minPos); 00260 00267 int setDriverMaxVel(long int maxVel); 00268 00275 int setDriverMaxAcc(long int maxAcc); 00276 00284 int setDriverMaxDec(long int maxDec); 00285 00292 int setDriverCurLim(int cl); 00293 00300 int setDriverPCurLim(int pcl); 00301 00309 int setDriverBaud(int baud); 00310 00311 /* direct movement */ 00312 00319 int moveDriverAbsPos(long int pos); 00320 00327 int moveDriverRelPos(long int pos); 00328 00335 int moveDriverVel(long int vel); 00336 00337 /* Calibrate Driver */ 00338 00349 int setDriverHomePosition(long int home); 00350 00365 int calibrateDriver(long int limit, int current_limit, int calibration_speed, int time_out); 00366 00367 private: 00368 Rs232 _comm; 00369 }; 00370 00371 #endif