27 #ifndef DynamixelAX12Driverh
28 #define DynamixelAX12Driverh
47 #define MOTION_COMPLETION_TOLERANCE 3
51 #define INST_PING 0x01
52 #define INST_READ 0x02
53 #define INST_WRITE 0x03
54 #define INST_REGWRITE 0x04
55 #define INST_ACTION 0x05
56 #define INST_RESET 0x06
57 #define INST_SYNCWRITE 0x83
60 #define AX12_BROADCAST_ID 0xFE
65 #define CT_MODEL_NUMBER 00
66 #define CT_FIRMWARE_VERSION 2
67 #define CT_RETURN_DELAY_TIME 5
68 #define CT_CW_ANGLE_LIMIT 06
69 #define CT_CWW_ANGLE_LIMIT 08
70 #define CT_LIMIT_TEMPERATURE_H 11
71 #define CT_LIMIT_VOLTAGE_L 12
72 #define CT_LIMIT_VOLTAGE_H 13
73 #define CT_MAX_TORQUE 14
74 #define CT_STATUS_RETURN_LEVEL 16
78 #define CT_TORQUE_ENABLE 24
79 #define CT_CW_COMP_MARGIN 26
80 #define CT_CWW_COMP_MARGIN 27
81 #define CT_CW_COMP_SLOPE 28
82 #define CT_CWW_COMP_SLOPE 29
83 #define CT_GOAL_POSITION 30
84 #define CT_MOVING_SPEED 32
85 #define CT_TORQUE_LIMIT 34
86 #define CT_PRESENT_POSITION 0x24
87 #define CT_PRESENT_SPEED 0x26
88 #define CT_PRESENT_LOAD 0x28
89 #define CT_PRESENT_VOLTAGE 42
90 #define CT_PRESENT_TEMPERATURE 43
91 #define CT_REG_INSTRUCTION 44
120 char description[100];
121 char manufacturer[100];
147 struct ftdi_context ftdic;
151 ErrorCode checkAnswerPacket(
unsigned char* packet,
const char*& message);
155 unsigned char *jointNumbers;
184 bool close()
override;
203 virtual int sendCommand(
unsigned char id,
unsigned char inst[],
int size,
unsigned char ret[],
int &retSize);
212 virtual int readParameter(
unsigned char id,
unsigned char param);
214 bool getAxes(
int *ax)
override;
219 bool positionMove(
int j,
double ref)
override;
220 bool positionMove(
const double *refs)
override;
221 bool relativeMove(
int j,
double delta)
override;
222 bool relativeMove(
const double *deltas)
override;
223 bool checkMotionDone(
int j,
bool *flag)
override;
224 bool checkMotionDone(
bool *flag)
override;
225 bool setRefSpeed(
int j,
double sp)
override;
226 bool setRefSpeeds(
const double *spds)
override;
227 bool setRefAcceleration(
int j,
double acc)
override;
228 bool setRefAccelerations(
const double *accs)
override;
229 bool getRefSpeed(
int j,
double *ref)
override;
230 bool getRefSpeeds(
double *spds)
override;
231 bool getRefAcceleration(
int j,
double *acc)
override;
232 bool getRefAccelerations(
double *accs)
override;
233 bool stop(
int j)
override;
234 bool stop()
override;
236 bool getRefTorques(
double *
t)
override;
237 bool getRefTorque(
int j,
double *
t)
override;
238 bool setTorques(
const double *
t);
239 bool setTorque(
int j,
double t);
240 bool setTorquePid(
int j,
const Pid &pid);
241 bool getTorque(
int j,
double *
t)
override;
242 bool getTorques(
double *
t)
override;
243 bool setTorquePids(
const Pid *pids);
244 bool setTorqueErrorLimit(
int j,
double limit);
245 bool setTorqueErrorLimits(
const double *limits);
246 bool getTorqueError(
int j,
double *err);
247 bool getTorqueErrors(
double *errs);
248 bool getTorquePidOutput(
int j,
double *out);
249 bool getTorquePidOutputs(
double *outs);
250 bool getTorquePid(
int j,
Pid *pid);
251 bool getTorquePids(
Pid *pids);
252 bool getTorqueErrorLimit(
int j,
double *limit);
253 bool getTorqueErrorLimits(
double *limits);
254 bool resetTorquePid(
int j);
255 bool disableTorquePid(
int j);
256 bool enableTorquePid(
int j);
257 bool setTorqueOffset(
int j,
double v);
259 bool getBemfParam(
int j,
double *bemf);
260 bool setBemfParam(
int j,
double bemf);
262 bool resetEncoder(
int j)
override;
263 bool resetEncoders()
override;
265 bool setEncoder(
int j,
double val)
override;
266 bool setEncoders(
const double *vals)
override;
270 bool getEncoder(
int j,
double *v)
override;
271 bool getEncoders(
double *encs)
override;
272 bool getEncoderSpeed(
int j,
double *sp)
override;
273 bool getEncoderSpeeds(
double *spds)
override;
274 bool getEncoderAcceleration(
int j,
double *spds)
override;
275 bool getEncoderAccelerations(
double *accs)
override;
278 bool setRefTorques(
const double*
t)
override;
280 bool setRefTorque(
int j,
double t)
override;
281 bool getTorqueRange(
int j,
double* min,
double* max)
override;
282 bool getTorqueRanges(
double* min,
double* max)
override;
285 bool positionMove(
const int n_joint,
const int *joints,
const double *refs)
override;
286 bool relativeMove(
const int n_joint,
const int *joints,
const double *deltas)
override;
287 bool checkMotionDone(
const int n_joint,
const int *joints,
bool *flag)
override;
288 bool setRefSpeeds(
const int n_joint,
const int *joints,
const double *spds)
override;
289 bool setRefAccelerations(
const int n_joint,
const int *joints,
const double *accs)
override;
290 bool getRefSpeeds(
const int n_joint,
const int *joints,
double *spds)
override;
291 bool getRefAccelerations(
const int n_joint,
const int *joints,
double *accs)
override;
292 bool stop(
const int n_joint,
const int *joints)
override;
299 struct ftdi_device_list *devlist;
300 struct ftdi_device_list *curdev;
304 int normalisePosition(
double position);
305 int normaliseSpeed(
double speed);
314 int syncSendCommand(
unsigned char id,
unsigned char inst[],
int size,
unsigned char ret[],
int &retSize);
define control board standard interfaces
dynamixelAX12Ftdi: Documentation to be added
FtdiDeviceSettings contains information to identify specific device Such a device can contain informa...
unsigned int write_chunksize
unsigned int read_chunksize
Interface implemented by all device drivers.
Control board, encoder interface.
Interface for a generic control board device implementing position control.
Interface for control boards implementing torque control.
virtual bool setRefTorques(const double *t)=0
Set the reference value of the torque for all joints.
Contains the parameters for a PID.
A simple collection of objects that can be described and transmitted in a portable way.
A base class for nested structures that can be searched.
An interface for the device drivers.
An interface to the operating system, including Port based communication.