00001 #ifndef __MCD3006S_H__ 00002 #define __MCD3006S_H__ 00003 00029 #include <ros/ros.h> 00030 #include <sr_communications/serial_port/rs232.h> 00031 #include "motor_driver_interface.h" 00032 00033 class Mcdc3006s : public MotorDriverInterface { 00034 public: 00038 Mcdc3006s(); 00039 00043 ~Mcdc3006s(); 00044 00048 int init(int baudrate, char *dev, char *sem); 00049 00055 int enable_driver(); 00056 00062 int disable_driver(); 00063 00075 int get_config(driverConf_t *dc); 00076 00086 long int get_max_pos(); 00087 00098 long int get_min_pos(); 00099 00109 long int get_max_vel(); 00110 00119 long int get_max_acc(); 00120 00131 long int get_max_dec(); 00132 00143 int get_cur_lim(); 00144 00155 int get_peak_cur_lim(); 00156 00164 int get_status(driverStatus_t *drvStatus); 00165 00173 int get_sensor(driverSensor_t *sensor); 00174 00182 int get_instant_pos(long int *positon); 00183 00191 int get_instant_vel(long int *velocity); 00192 00200 int get_instant_current(int *current); 00201 00208 int set_config(driverConf_t dc); 00209 00218 int set_max_pos(long int maxPos); 00219 00228 int set_min_pos(long int minPos); 00229 00236 int set_max_vel(long int maxVel); 00237 00244 int set_max_acc(long int maxAcc); 00245 00253 int set_max_dec(long int maxDec); 00254 00261 int set_cur_lim(int cl); 00262 00269 int set_peak_cur_lim(int pcl); 00270 00278 int set_baudrate(int baud); 00279 00286 int move_abs_pos(long int pos); 00287 00294 int move_rel_pos(long int pos); 00295 00302 int move_vel(long int vel); 00303 00317 int save_to_flash(); 00318 00329 int activate_limits(int action); 00330 00341 int set_home_position(long int home); 00342 00349 int calibrate(int limit); 00350 00351 private: 00352 Rs232 _comm; 00353 }; 00354 00355 #endif