27#ifndef DynamixelAX12Driverh
28#define DynamixelAX12Driverh
47#define MOTION_COMPLETION_TOLERANCE 3
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
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);
311 int normalisePosition(
double position);
312 int normaliseSpeed(
double speed);
321 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
yarp::dev::ReturnValue getEncoderSpeed(int j, double *sp) override
Read the istantaneous speed of an axis.
yarp::dev::ReturnValue resetEncoders() override
Reset encoders.
yarp::dev::ReturnValue setTorqueErrorLimits(const double *limits)
yarp::dev::ReturnValue getTargetPositions(double *refs) override
Get the last position reference for all axes.
yarp::dev::ReturnValue getEncoderSpeeds(double *spds) override
Read the instantaneous speed of all axes.
yarp::dev::ReturnValue getTrajAccelerations(double *accs) override
not implemented
yarp::dev::ReturnValue relativeMove(int j, double delta) override
Set relative position.
yarp::dev::ReturnValue setTrajSpeed(int j, double sp) override
Set reference speed for a joint, this is the speed used during the interpolation of the trajectory.
yarp::dev::ReturnValue setEncoder(int j, double val) override
Set the value of the encoder for a given joint.
yarp::dev::ReturnValue checkMotionDone(bool &flag) override
Check if the current trajectory is terminated.
yarp::dev::ReturnValue getTorquePid(int j, Pid *pid)
bool close() override
Close device Closes the device and shuts down connection.
yarp::dev::ReturnValue setRefTorques(const double *t) override
Set the reference value of the torque for all joints.
yarp::dev::ReturnValue setTrajSpeeds(const double *spds) override
Set reference speed on all joints.
bool configure(yarp::os::Searchable &config)
Configure device online Configures parts of the device that can be configures online.
yarp::dev::ReturnValue resetEncoder(int j) override
Reset encoder, single joint.
yarp::dev::ReturnValue setTrajAcceleration(int j, double acc) override
not implemented
yarp::dev::ReturnValue getTorquePidOutput(int j, double *out)
yarp::dev::ReturnValue getEncoderAccelerations(double *accs) override
Read the instantaneous acceleration of all axes.
yarp::dev::ReturnValue getTorqueRange(int j, double *min, double *max) override
Get the full scale of the torque sensor of a given joint.
virtual int sendCommand(unsigned char id, unsigned char inst[], int size, unsigned char ret[], int &retSize)
Send instruction to device Send an instruction to a device of given ID.
yarp::dev::ReturnValue getTrajSpeeds(double *spds) override
Get reference speed of all joints.
yarp::dev::ReturnValue positionMove(int j, double ref) override
Set new reference point for a single axis.
yarp::dev::ReturnValue getTorquePids(Pid *pids)
virtual int readParameter(unsigned char id, unsigned char param)
Read parameter from motor Requests the value of a parameter from motor.
yarp::dev::ReturnValue enableTorquePid(int j)
yarp::dev::ReturnValue getMotorTorqueParams(int j, yarp::dev::MotorTorqueParameters *params) override
Get a subset of motor parameters (bemf, ktau etc) useful for torque control.
yarp::dev::ReturnValue getEncoders(double *encs) override
Read the position of all axes.
yarp::dev::ReturnValue setTorquePid(int j, const Pid &pid)
yarp::dev::ReturnValue setEncoders(const double *vals) override
Set the value of all encoders.
yarp::dev::ReturnValue setTorqueOffset(int j, double v)
yarp::dev::ReturnValue getTorquePidOutputs(double *outs)
yarp::dev::ReturnValue resetTorquePid(int j)
yarp::dev::ReturnValue getTrajSpeed(int j, double *ref) override
Get reference speed for a joint.
yarp::dev::ReturnValue getTargetPosition(const int joint, double *ref) override
Get the last position reference for the specified axis.
bool open(yarp::os::Searchable &config) override
Open device Opens and configures the device.
yarp::dev::ReturnValue setTorquePids(const Pid *pids)
yarp::dev::ReturnValue setTorque(int j, double t)
yarp::dev::ReturnValue getTorqueErrorLimit(int j, double *limit)
yarp::dev::ReturnValue getBemfParam(int j, double *bemf)
yarp::dev::ReturnValue getTorque(int j, double *t) override
Get the value of the torque on a given joint (this is the feedback if you have a torque sensor).
DynamixelAX12FtdiDriver()
Constructor Initializes handle but doesn't open channel yet.
yarp::dev::ReturnValue setBemfParam(int j, double bemf)
virtual ~DynamixelAX12FtdiDriver()
Destructor Closes connection and destroys device object.
yarp::dev::ReturnValue setTorques(const double *t)
yarp::dev::ReturnValue getTorqueErrors(double *errs)
yarp::dev::ReturnValue setTrajAccelerations(const double *accs) override
not implemented
yarp::dev::ReturnValue getEncoderAcceleration(int j, double *spds) override
Read the instantaneous acceleration of an axis.
yarp::dev::ReturnValue setMotorTorqueParams(int j, const yarp::dev::MotorTorqueParameters params) override
Set a subset of motor parameters (bemf, ktau etc) useful for torque control.
yarp::dev::ReturnValue getRefTorques(double *t) override
Get the reference value of the torque for all joints.
yarp::dev::ReturnValue setRefTorque(int j, double t) override
Set the reference value of the torque for a given joint.
yarp::dev::ReturnValue setTorqueErrorLimit(int j, double limit)
yarp::dev::ReturnValue getTrajAcceleration(int j, double *acc) override
not implemented
yarp::dev::ReturnValue getTorqueError(int j, double *err)
yarp::dev::ReturnValue getTorqueErrorLimits(double *limits)
yarp::dev::ReturnValue getTorques(double *t) override
Get the value of the torque for all joints (this is the feedback if you have torque sensors).
yarp::dev::ReturnValue stop() override
Stop motion, multiple joints.
yarp::dev::ReturnValue getTorqueRanges(double *min, double *max) override
Get the full scale of the torque sensors of all joints.
yarp::dev::ReturnValue disableTorquePid(int j)
yarp::dev::ReturnValue getRefTorque(int j, double *t) override
Get the reference value of the torque for a given joint.
yarp::dev::ReturnValue getAxes(size_t &ax) override
Interfaces methods.
yarp::dev::ReturnValue getEncoder(int j, double *v) override
Get the angle of servo.
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 yarp::dev::ReturnValue 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 mini-server for performing network communication in the background.
A base class for nested structures that can be searched.
For streams capable of holding different kinds of content, check what they actually have.
An interface to the operating system, including Port based communication.