10# define rad2deg(x) ((x)*180.0/M_PI)
11# define deg2rad(x) ((x)*M_PI/180.0)
14 :
yarp::os::PeriodicThread(0.001)
24 if (!parseParams(config))
26 yCError(
CB) <<
"Failed to parse parameters for xHandControlBoard.";
31 if(m_GENERAL_AxisName.size() != EV_HAND_JOINT_NUM)
33 yCError(
CB) <<
"Number of Axis names provided (" << m_GENERAL_AxisName.size() <<
") does not match the number of joints supported by the hand (" << EV_HAND_JOINT_NUM <<
").";
36 if(m_GENERAL_AxisMap.size() != EV_HAND_JOINT_NUM)
38 yCError(
CB) <<
"Number of Axis map entries provided (" << m_GENERAL_AxisMap.size() <<
") does not match the number of joints supported by the hand (" << EV_HAND_JOINT_NUM <<
").";
41 if(m_GENERAL_AxisType.size() != EV_HAND_JOINT_NUM)
43 yCError(
CB) <<
"Number of Axis types provided (" << m_GENERAL_AxisType.size() <<
") does not match the number of joints supported by the hand (" << EV_HAND_JOINT_NUM <<
").";
46 if(m_LIMITS_jntPosMax.size() != EV_HAND_JOINT_NUM)
48 yCError(
CB) <<
"Number of joint position max limits provided (" << m_LIMITS_jntPosMax.size() <<
") does not match the number of joints supported by the hand (" << EV_HAND_JOINT_NUM <<
").";
51 if(m_LIMITS_jntPosMin.size() != EV_HAND_JOINT_NUM)
53 yCError(
CB) <<
"Number of joint position min limits provided (" << m_LIMITS_jntPosMin.size() <<
") does not match the number of joints supported by the hand (" << EV_HAND_JOINT_NUM <<
").";
56 if(m_LIMITS_jntVelMin.size() != EV_HAND_JOINT_NUM)
58 yCError(
CB) <<
"Number of joint velocity min limits provided (" << m_LIMITS_jntVelMin.size() <<
") does not match the number of joints supported by the hand (" << EV_HAND_JOINT_NUM <<
").";
61 if(m_LIMITS_jntVelMax.size() != EV_HAND_JOINT_NUM)
63 yCError(
CB) <<
"Number of joint velocity max limits provided (" << m_LIMITS_jntVelMax.size() <<
") does not match the number of joints supported by the hand (" << EV_HAND_JOINT_NUM <<
").";
66 for(
size_t i=0; i<EV_HAND_JOINT_NUM; i++)
68 if(m_LIMITS_jntPosMin[i] >= m_LIMITS_jntPosMax[i])
70 yCError(
CB) <<
"Joint position limits for joint " << i <<
" are invalid: min limit (" << m_LIMITS_jntPosMin[i] <<
") >= max limit (" << m_LIMITS_jntPosMax[i] <<
").";
74 for(
size_t i=0; i<EV_HAND_JOINT_NUM; i++){
75 if(m_LIMITS_jntVelMin[i] >= m_LIMITS_jntVelMax[i]){
76 yCError(
CB) <<
"Joint velocity limits for joint " << i <<
" are invalid: min limit (" << m_LIMITS_jntVelMin[i] <<
") >= max limit (" << m_LIMITS_jntVelMax[i] <<
").";
82 std::vector<std::string> ifnames = m_XHCtrl.enumerate_devices(m_connection_type);
83 if (ifnames.empty()) {
84 yCError(
CB) <<
"No devices found for connection type: " << m_connection_type;
88 std::string debugMsg{};
90 xhand_control::ErrorStruct ret;
91 std::vector<std::string>::iterator ifnames_it{};
92 if (m_connection_type ==
"RS485"){
94 ifnames_it = std::find(ifnames.begin(), ifnames.end(), m_RS485_port);
96 if (ifnames_it == ifnames.end()){
97 for (
const auto& ifname : ifnames) {debugMsg+=ifname +
" ";}
98 yCError(
CB) <<
"Specified RS485 port" << m_RS485_port <<
"not found among available devices: " << debugMsg;
102 ret = m_XHCtrl.open_serial(m_RS485_port, m_RS485_baudrate);
104 else if (m_connection_type ==
"EtherCAT"){
105 ifnames_it = std::find(ifnames.begin(), ifnames.end(), m_ETHERCAT_eth_ifname);
107 if (ifnames_it == ifnames.end()){
108 for (
const auto& ifname : ifnames) {debugMsg+=ifname +
" ";}
109 yCError(
CB) <<
"Specified EtherCAT interface" << m_ETHERCAT_eth_ifname <<
"not found among available devices: " << debugMsg;
113 ret = m_XHCtrl.open_ethercat(m_ETHERCAT_eth_ifname);
116 yCError(
CB) <<
"Unknown connection type: " << m_connection_type;
121 yCError(
CB) <<
"Failed to open " << m_connection_type;
122 printErrorStruct(ret);
126 yDebug() <<
"Successfully connected to " << (m_connection_type ==
"RS485" ? m_RS485_port : m_ETHERCAT_eth_ifname);
128 std::vector<uint8_t> hand_list = m_XHCtrl.list_hands_id();
129 if (hand_list.empty()){
130 yCError(
CB) <<
"No hands found on the network.";
135 for (
const auto& hand : hand_list) {debugMsg+=std::to_string(hand) +
" ";}
138 yCDebug(
CB) <<
"Using hand with ID:" <<
static_cast<int>(m_id);
144 yCError(
CB) <<
"Unable to start xHandControlBoard periodic thread"; ;
150 yCInfo(
CB) <<
"Waiting " << delay <<
" s for the hand to be ready...";
157 m_controlModes =
new int [EV_HAND_JOINT_NUM];
160 memset(&m_handCommand, 0,
sizeof(m_handCommand));
161 for(uint16_t i = 0; i < EV_HAND_JOINT_NUM; i++){
162 m_handCommand.finger_command[i].id = i;
165 m_handCommand.finger_command[i].position =
static_cast<float>(
deg2rad(enc));
166 m_handCommand.finger_command[i].kp = m_PID_kp;
167 m_handCommand.finger_command[i].ki = m_PID_ki;
168 m_handCommand.finger_command[i].kd = m_PID_kd;
169 m_handCommand.finger_command[i].mode = m_MODE_mode;
170 m_handCommand.finger_command[i].tor_max = m_TORQUE_tor_max;
173 sendCommandToHand(m_id, m_handCommand);
176 yarp::dev::Pid positionPidInit(m_PID_kp, m_PID_kd, m_PID_ki, 0.0, 1.0, 1.0);
177 std::vector<yarp::dev::Pid> positionPids(EV_HAND_JOINT_NUM, positionPidInit);
185 if (this->isRunning()){
186 std::lock_guard lock(m_mutex);
190 m_XHCtrl.close_device();
196 delete[] m_controlModes;
201void yarp::dev::xHandControlBoard::printErrorStruct(
const xhand_control::ErrorStruct& err){
203 <<
"\n error_code:" << err.error_code
204 <<
"\n error_message:" << err.error_message
205 <<
"\n error_type: " << err.error_details.error_type
206 <<
"\n error_name: " << err.error_details.error_name;
215 m_handCommand.finger_command[j].
kp = p.
kp;
216 m_handCommand.finger_command[j].ki = p.
ki;
217 m_handCommand.finger_command[j].kd = p.
kd;
218 sendCommandToHand(m_id, m_handCommand);
242 for (
int j = 0; j < EV_HAND_JOINT_NUM; j++){ ret &= setPid(pidtype, j, ps[j]); }
245 for (
int j = 0; j < EV_HAND_JOINT_NUM; j++){ ret &= setPid(pidtype, j, ps[j]); }
248 for (
int j = 0; j < EV_HAND_JOINT_NUM; j++){ ret &= setPid(pidtype, j, ps[j]); }
251 for (
int j = 0; j < EV_HAND_JOINT_NUM; j++){ ret &= setPid(pidtype, j, ps[j]); }
334 for (
int j = 0; j < EV_HAND_JOINT_NUM; j++){ ret &=getPid(pidtype, j, &pids[j]); }
337 for (
int j = 0; j < EV_HAND_JOINT_NUM; j++){ ret &=getPid(pidtype, j, &pids[j]); }
340 for (
int j = 0; j < EV_HAND_JOINT_NUM; j++){ ret &=getPid(pidtype, j, &pids[j]); }
343 for (
int j = 0; j < EV_HAND_JOINT_NUM; j++){ ret &=getPid(pidtype, j, &pids[j]); }
394 *ax = EV_HAND_JOINT_NUM;
400 return setPosition(j, ref);
405 return setPositions(refs);
410 return setPositions(n_joints, joints, refs);
415 std::lock_guard lock(m_mutex);
416 *ref =
rad2deg(
static_cast<double>(m_handState.state.finger_state[joint].position));
422 std::lock_guard lock(m_mutex);
423 for(uint16_t i = 0; i < EV_HAND_JOINT_NUM; i++){refs[i] =
rad2deg(
static_cast<double>(m_handCommand.finger_command[i].position));}
429 std::lock_guard lock(m_mutex);
430 for(uint16_t i = 0; i < n_joint; i++){refs[i] =
rad2deg(
static_cast<double>(m_handCommand.finger_command[joints[i]].position));}
581 std::lock_guard lock(m_mutex);
582 *v =
rad2deg(
static_cast<double>(m_handState.state.finger_state[j].position));
588 std::lock_guard lock(m_mutex);
589 for(
size_t f=0; f< EV_HAND_JOINT_NUM; f++){encs[f] =
rad2deg(
static_cast<double>(m_handState.state.finger_state[f].position));}
595 std::lock_guard lock(m_mutex);
596 for(
size_t i=0; i< EV_HAND_JOINT_NUM; i++){
597 encs[i] =
rad2deg(
static_cast<double>(m_handState.state.finger_state[i].position));
598 t[i] = m_handState.timestamp;
775 m_LIMITS_jntPosMin[j] = min;
776 m_LIMITS_jntPosMax[j] = max;
782 *min = m_LIMITS_jntPosMin[j];
783 *max = m_LIMITS_jntPosMax[j];
789 m_LIMITS_jntVelMin[j] = min;
790 m_LIMITS_jntVelMax[j] = max;
796 *min = m_LIMITS_jntVelMin[j];
797 *max = m_LIMITS_jntVelMax[j];
928 name = m_GENERAL_AxisName[j];
934 if(m_GENERAL_AxisType[j] ==
"revolute"){
938 else if(m_GENERAL_AxisType[j] ==
"prismatic"){
1031 *mode = m_controlModes[j];
1038 for(
int j=0; j< EV_HAND_JOINT_NUM; j++){ret = ret && getControlMode(j, &modes[j]);}
1045 for(
int j=0; j< n_joint; j++){ret = ret && getControlMode(joints[j], &modes[j]);}
1051 if (yarpToXhandControlModes.find(mode) == yarpToXhandControlModes.end())
1053 yCError(
CB) <<
"Control mode" << mode <<
"not supported. Supported modes are: VOCAB_CM_IDLE, VOCAB_CM_POSITION and VOCAB_CM_POSITION_DIRECT.";
1059 m_handCommand.finger_command[j].position = m_handState.state.finger_state[j].position;
1062 m_controlModes[j] = mode;
1063 m_handCommand.finger_command[j].mode = m_MODE_mode = yarpToXhandControlModes[mode];
1064 sendCommandToHand(m_id, m_handCommand);
1073 for(
int i=0; i<n_joints; i++) {ret &= setControlMode(joints[i], modes[i]);}
1080 for (
int j = 0; j < EV_HAND_JOINT_NUM; j++){ ret &= setControlMode(j, modes[j]); }
1087 m_handCommand.finger_command[j].position =
deg2rad(ref);
1088 return sendCommandToHand(m_id, m_handCommand);
1093 for(uint16_t i = 0; i < n_joints; i++){m_handCommand.finger_command[joints[i]].position =
deg2rad(dpos[i]);}
1094 return sendCommandToHand(m_id, m_handCommand);
1099 for(uint16_t i = 0; i < EV_HAND_JOINT_NUM; i++){m_handCommand.finger_command[i].position =
deg2rad(refs[i]);}
1100 return sendCommandToHand(m_id, m_handCommand);
1252 std::pair<xhand_control::ErrorStruct, HandState_t> ret = m_XHCtrl.read_state(m_id,
true);
1255 printErrorStruct(ret.first);
1256 yCError(
CB) <<
"[run] See error(s) above.";
1259 std::lock_guard lock(m_mutex);
1261 m_handState.state = ret.second;
1273bool yarp::dev::xHandControlBoard::sendCommandToHand(
const uint8_t hand_id,
const HandCommand_t& command)
1275 auto err = m_XHCtrl.send_command(hand_id, command);
1278 printErrorStruct(err);
1279 yCError(
CB) <<
"[sendCommandToHand] See error(s) above.";
IRemoteCalibrator interface is meant to remotize the access of the calibration device in order to all...
double ki
integrative gain
double kp
proportional gain
Contains the parameters for a PID.
bool setLimits(int j, double min, double max) override
bool getMotorTorqueParams(int j, yarp::dev::MotorTorqueParameters *params) override
Get a subset of motor parameters (bemf, ktau etc) useful for torque control.
bool setMotorEncoders(const double *vals) override
Set the value of all motor encoders.
bool getPid(const yarp::dev::PidControlTypeEnum &pidtype, int j, yarp::dev::Pid *p) override
Get current PID value for a specific joint.
bool setMotorTorqueParams(int j, const yarp::dev::MotorTorqueParameters params) override
Set a subset of motor parameters (bemf, ktau etc) useful for torque control.
bool getRemoteVariable(std::string key, yarp::os::Bottle &val) override
bool setPeakCurrent(int m, const double val) override
bool setRefCurrent(int m, double curr) override
Set the reference value of the current for a single motor.
bool resetEncoders() override
Reset encoders.
bool resetMotorEncoder(int m) override
Reset motor encoder, single motor.
bool homingWholePart() override
homingWholePart: call the homing procedure for a the whole part/device
bool disableAmp(int j) override
Disable the amplifier on a specific joint.
bool getRefDutyCycle(int m, double *ref) override
Gets the last reference sent using the setRefDutyCycle function.
bool getRefAcceleration(int j, double *acc) override
bool resetMotorEncoders() override
Reset motor encoders.
bool getRefAccelerations(double *accs) override
bool setControlMode(const int j, const int mode) override
bool setPidErrorLimits(const yarp::dev::PidControlTypeEnum &pidtype, const double *limits) override
Get the error limit for the controller on all joints.
bool getEncodersTimed(double *encs, double *t) override
Read the instantaneous acceleration of all axes.
bool getEncoderAccelerations(double *accs) override
Read the instantaneous acceleration of all axes.
bool velocityMove(int j, double v) override
Start motion at a given speed, single joint.
bool getPidErrorLimits(const yarp::dev::PidControlTypeEnum &pidtype, double *limits) override
Get the error limit for all controllers.
bool disablePid(const yarp::dev::PidControlTypeEnum &pidtype, int j) override
Disable the PID computation for a joint.
bool getMotorEncoderAcceleration(int m, double *acc) override
Read the instantaneous acceleration of a motor encoder.
bool setPWMLimit(int m, const double val) override
bool getNominalCurrent(int m, double *val) override
bool getPeakCurrent(int m, double *val) override
bool getPidReferences(const yarp::dev::PidControlTypeEnum &pidtype, double *refs) override
Get the current reference of all PID controllers.
bool getCurrentRange(int m, double *min, double *max) override
Get the full scale of the current measurement for a given motor (e.g.
bool getMotorEncoder(int m, double *v) override
Read the value of a motor encoder.
bool checkMotionDone(int j, bool *flag) override
bool setControlModes(const int n_joints, const int *joints, int *modes) override
bool getImpedanceOffset(int j, double *offset) override
Get current force Offset for a specific joint.
bool setMotorEncoder(int m, const double val) override
Set the value of the motor encoder for a given motor.
bool getTorqueRanges(double *min, double *max) override
Get the full scale of the torque sensors of all joints.
bool positionMove(int j, double ref) override
Set new reference point for a single axis.
bool getNumberOfMotorEncoders(int *num) override
Get the number of available motor encoders.
bool getTorques(double *t) override
Get the value of the torque for all joints (this is the feedback if you have torque sensors).
bool getTargetPositions(double *refs) override
Get the last position reference for all axes.
bool getDutyCycle(int m, double *val) override
Gets the current dutycycle of the output of the amplifier (i.e.
bool getRefVelocity(const int joint, double *vel) override
bool enableAmp(int j) override
Enable the amplifier on a specific joint.
bool getLastJointFault(int j, int &fault, std::string &message) override
bool setRefTorque(int j, double t) override
Set the reference value of the torque for a given joint.
bool open(yarp::os::Searchable &config) override
Open the DeviceDriver.
bool getEncoderAcceleration(int j, double *acc) override
Read the instantaneous acceleration of an axis.
bool setPid(const yarp::dev::PidControlTypeEnum &pidtype, int j, const yarp::dev::Pid &p) override
Set new PID value for a joint axis.
yarp::os::Stamp getLastInputStamp() override
Return the time stamp relative to the last acquisition.
bool getMotorEncoderCountsPerRevolution(int m, double *cpr) override
Gets number of counts per revolution for motor encoder m.
bool parkSingleJoint(int j, bool _wait=true) override
parkSingleJoint(): start the parking procedure for the single joint
bool getPWMLimit(int m, double *val) override
bool homingSingleJoint(int j) override
homingSingleJoint: call the homing procedure for a single joint
bool getMotorEncodersTimed(double *encs, double *t) override
Read the instantaneous position of all motor encoders.
bool getTemperatureLimit(int m, double *val) override
Retrieves the current temperature limit for a specific motor.
bool setPidReferences(const yarp::dev::PidControlTypeEnum &pidtype, const double *refs) override
Set the controller reference, multiple axes.
bool getCurrentImpedanceLimit(int j, double *min_stiff, double *max_stiff, double *min_damp, double *max_damp) override
Get the current impedance limits for a specific joint.
bool getRefCurrents(double *currs) override
Get the reference value of the currents for all motors.
bool setRefAccelerations(const double *accs) override
bool getPidErrorLimit(const yarp::dev::PidControlTypeEnum &pidtype, int j, double *limit) override
Get the error limit for the controller on a specific joint.
bool getMotorEncoderSpeed(int m, double *sp) override
Read the instantaneous speed of a motor encoder.
bool 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).
bool getMotorEncoders(double *encs) override
Read the position of all motor encoders.
bool setInteractionMode(int j, yarp::dev::InteractionModeEnum mode) override
Set the interaction mode of the robot, values can be stiff or compliant.
bool getTargetPosition(const int joint, double *ref) override
Get the last position reference for the specified axis.
bool getMotorEncoderAccelerations(double *accs) override
Read the instantaneous acceleration of all motor encoders.
bool setImpedanceOffset(int j, double offset) override
Set current force Offset for a specific joint.
bool getRefVelocities(double *vels) override
bool setPidErrorLimit(const yarp::dev::PidControlTypeEnum &pidtype, int j, double limit) override
Set the error limit for the controller on a specific joint.
bool setCalibrationParameters(int j, const yarp::dev::CalibrationParameters ¶ms) override
Start calibration, this method is very often platform specific.
bool setRefDutyCycle(int m, double ref) override
Sets the reference dutycycle to a single motor.
bool setGearboxRatio(int m, const double val) override
Set the gearbox ratio for a specific motor.
bool stop() override
Stop motion, multiple joints.
bool getRefDutyCycles(double *refs) override
Gets the last reference sent using the setRefDutyCycles function.
bool calibrateWholePart() override
calibrateWholePart: call the procedure for calibrating the whole device
bool enablePid(const yarp::dev::PidControlTypeEnum &pidtype, int j) override
Enable the PID computation for a joint.
bool setPids(const yarp::dev::PidControlTypeEnum &pidtype, const yarp::dev::Pid *ps) override
Set new PID value on multiple axes.
bool isPidEnabled(const yarp::dev::PidControlTypeEnum &pidtype, int j, bool *enabled) override
bool setRefAcceleration(int j, double acc) override
bool setMotorEncoderCountsPerRevolution(int m, const double cpr) override
Sets number of counts per revolution for motor encoder m.
bool getAmpStatus(int *st) override
bool getEncoderSpeeds(double *spds) override
Read the instantaneous speed of all axes.
bool abortCalibration() override
bool getControlMode(int j, int *mode) override
bool setImpedance(int j, double stiff, double damp) override
Set current impedance gains (stiffness,damping) for a specific joint.
bool getMotorEncoderTimed(int m, double *v, double *t) override
Read the instantaneous position of a motor encoder.
void threadRelease() override
Release method.
bool getRefPosition(const int joint, double *ref) override
Get the last position reference for the specified axis.
bool setRefCurrents(const double *currs) override
Set the reference value of the currents for all motors.
bool getCurrent(int m, double *curr) override
Get the instantaneous current measurement for a single motor.
bool relativeMove(int j, double delta) override
Set relative position.
bool getAxisName(int j, std::string &name) override
bool getNumberOfMotors(int *num) override
Retrieves the number of controlled motors from the current physical interface.
bool setRefDutyCycles(const double *refs) override
Sets the reference dutycycle for all the motors.
bool getCurrentRanges(double *min, double *max) override
Get the full scale of the current measurements for all motors motor (e.g.
bool calibrateSingleJoint(int j) override
calibrateSingleJoint: call the calibration procedure for the single joint
bool getPidErrors(const yarp::dev::PidControlTypeEnum &pidtype, double *errs) override
Get the error of all joints.
bool getEncoders(double *encs) override
Read the position of all axes.
bool getPidError(const yarp::dev::PidControlTypeEnum &pidtype, int j, double *err) override
Get the current error for a joint.
bool getMotorEncoderSpeeds(double *spds) override
Read the instantaneous speed of all motor encoders.
bool calibrateAxisWithParams(int j, unsigned int ui, double v1, double v2, double v3) override
Start calibration, this method is very often platform specific.
void run() override
Loop function.
bool getRefTorques(double *refs) override
Get the reference value of the torque for all joints.
~xHandControlBoard() override
bool setVelLimits(int j, double min, double max) override
Set the software speed limits for a particular axis, the behavior of the control card when these limi...
bool getJointType(int j, yarp::dev::JointTypeEnum &type) override
yarp::dev::IRemoteCalibrator * getCalibratorDevice() override
getCalibratorDevice: return the pointer stored with the setCalibratorDevice
bool getEncoderSpeed(int j, double *sp) override
Read the istantaneous speed of an axis.
bool getImpedance(int j, double *stiff, double *damp) override
Get current impedance gains (stiffness,damping,offset) for a specific joint.
bool getPidOutput(const yarp::dev::PidControlTypeEnum &pidtype, int j, double *out) override
Get the output of the controller (e.g.
bool setPidOffset(const yarp::dev::PidControlTypeEnum &pidtype, int j, double v) override
Set an offset value for a given controller.
bool setInteractionModes(int n_joints, int *joints, yarp::dev::InteractionModeEnum *modes) override
bool getTemperature(int m, double *val) override
Get temperature of a motor.
bool threadInit() override
Initialization method.
bool getRemoteVariablesList(yarp::os::Bottle *listOfKeys) override
bool quitCalibrate() override
quitCalibrate: interrupt the calibration procedure
bool getInteractionModes(int n_joints, int *joints, yarp::dev::InteractionModeEnum *modes) override
bool resetPid(const yarp::dev::PidControlTypeEnum &pidtype, int j) override
Reset the controller of a given joint, usually sets the current status of the joint as the reference ...
bool getPids(const yarp::dev::PidControlTypeEnum &pidtype, yarp::dev::Pid *pids) override
Get current PID value for a specific joint.
bool setPosition(int j, double ref) override
Set new position for a single axis.
bool getPWM(int m, double *val) override
bool getRefSpeeds(double *spds) override
bool getPidReference(const yarp::dev::PidControlTypeEnum &pidtype, int j, double *ref) override
Get the current reference of the PID controller for a specific joint.
bool calibrationDone(int j) override
Check if the calibration is terminated, on a particular joint.
bool getPidOutputs(const yarp::dev::PidControlTypeEnum &pidtype, double *outs) override
Get the output of the controllers (e.g.
bool resetEncoder(int j) override
Reset encoder, single joint.
bool getRefPositions(double *refs) override
Get the last position reference for all axes.
bool getVelLimits(int j, double *min, double *max) override
Get the software speed limits for a particular axis.
bool setRefTorques(const double *t) override
Set the reference value of the torque for all joints.
bool getRefCurrent(int m, double *curr) override
Get the reference value of the current for a single motor.
bool abortPark() override
bool getCurrents(double *currs) override
Get the instantaneous current measurement for all motors.
bool getAxes(int *ax) override
bool setNominalCurrent(int m, const double val) override
bool setPositions(const int n_joints, const int *joints, const double *dpos) override
Set new reference point for all axes.
bool getEncoderTimed(int j, double *v, double *t) override
Read the instantaneous acceleration of all axes.
bool getTemperatures(double *vals) override
Get temperature of all the motors.
bool getEncoder(int j, double *v) override
Read the value of an encoder.
bool getPowerSupplyVoltage(int m, double *val) override
bool getInteractionMode(int j, yarp::dev::InteractionModeEnum *mode) override
bool quitPark() override
quitPark: interrupt the park procedure
bool getTorqueRange(int j, double *min, double *max) override
Get the full scale of the torque sensor of a given joint.
bool setRefSpeed(int j, double sp) override
bool setMaxCurrent(int j, double v) override
bool setPidReference(const yarp::dev::PidControlTypeEnum &pidtype, int j, double ref) override
Set the controller reference for a given axis.
bool getRefTorque(int j, double *t) override
Get the reference value of the torque for a given joint.
bool getRefSpeed(int j, double *ref) override
bool setTemperatureLimit(int m, const double val) override
Set the temperature limit for a specific motor.
bool getGearboxRatio(int m, double *val) override
Get the gearbox ratio for a specific motor.
bool setEncoders(const double *vals) override
Set the value of all encoders.
bool getMaxCurrent(int j, double *v) override
Returns the maximum electric current allowed for a given motor.
bool getDutyCycles(double *vals) override
Gets the current dutycycle of the output of the amplifier (i.e.
bool setRefSpeeds(const double *spds) override
bool close() override
Close the DeviceDriver.
bool isCalibratorDevicePresent(bool *isCalib) override
isCalibratorDevicePresent: check if a calibrator device has been set
bool setEncoder(int j, double val) override
Set the value of the encoder for a given joint.
bool getControlModes(int *modes) override
bool parkWholePart() override
parkWholePart: start the parking procedure for the whole part
bool getLimits(int j, double *min, double *max) override
bool setRemoteVariable(std::string key, const yarp::os::Bottle &val) override
A simple collection of objects that can be described and transmitted in a portable way.
void askToStop()
Stop the thread.
bool start()
Call this to start the thread.
A base class for nested structures that can be searched.
An abstraction for a time stamp and/or sequence number.
#define yCInfo(component,...)
#define yCError(component,...)
#define yCDebugOnce(component,...)
#define YARP_DECLARE_LOG_COMPONENT(name)
#define yCDebug(component,...)
#define YARP_LOG_COMPONENT(name,...)
@ VOCAB_CM_POSITION_DIRECT
@ VOCAB_JOINTTYPE_REVOLUTE
@ VOCAB_JOINTTYPE_PRISMATIC
double now()
Return the current time in seconds, relative to an arbitrary starting point.
void delay(double seconds)
Wait for a certain number of seconds.
The main, catch-all namespace for YARP.
const yarp::os::LogComponent & CB()