22 int count =
st.getCount();
23 double time =
st.getTime();
109 double min_stiff = 0;
110 double max_stiff = 0;
205 yCError(
CONTROLBOARD) <<
"Unable to handle setControlMode request! This should not happen!";
215 int*
js =
new int[n_joints];
216 int*
modes =
new int[n_joints];
218 for (
int i = 0;
i < n_joints;
i++) {
222 for (
int i = 0;
i < n_joints;
i++) {
240 yCError(
CONTROLBOARD,
"received an invalid setControlMode message. Size of vector doesn´t match the number of controlled joints");
262 yCError(
CONTROLBOARD) <<
" Error, received a set control mode message using a legacy version, trying to be handle the message anyway "
263 <<
" but please update your client to be compatible with the IControlMode interface";
298 yCError(
CONTROLBOARD) <<
"The 'impedancePosition' control mode is deprecated. \nUse setInteractionMode(axis, VOCAB_IM_COMPLIANT) + setControlMode(axis, VOCAB_CM_POSITION) instead";
302 yCError(
CONTROLBOARD) <<
"The 'impedanceVelocity' control mode is deprecated. \nUse setInteractionMode(axis, VOCAB_IM_COMPLIANT) + setControlMode(axis, VOCAB_CM_VELOCITY) instead";
403 int*
js =
new int[n_joints];
404 int*
modes =
new int[n_joints];
405 for (
int i = 0;
i < n_joints;
i++) {
419 for (
int i = 0;
i < n_joints;
i++) {
480 if (b->
size() != 9) {
481 yCError(
CONTROLBOARD,
"received a SET VOCAB_MOTOR_PARAMS command not understood, size != 9");
506 auto*
p =
new double[
njs];
507 for (
size_t i = 0;
i <
njs;
i++) {
588 b1.addFloat64(
p1[
i]);
592 b2.addFloat64(
p2[
i]);
650 auto n_joints =
static_cast<size_t>(cmd.
get(3).
asInt32());
654 yCWarning(
CONTROLBOARD,
"Received an invalid setInteractionMode message. Size of vectors doesn´t match");
658 int*
joints =
new int[n_joints];
660 for (
size_t i = 0;
i < n_joints;
i++) {
676 yCWarning(
CONTROLBOARD,
"Received an invalid setInteractionMode message. Size of vector doesn´t match the number of controlled joints");
713 if (
jointList->size() !=
static_cast<size_t>(n_joints)) {
714 yCError(
CONTROLBOARD,
"Received an invalid getInteractionMode message. Size of vectors doesn´t match");
718 int*
joints =
new int[n_joints];
720 for (
int i = 0;
i < n_joints;
i++) {
726 for (
int i = 0;
i < n_joints;
i++) {
757 yCError(
CONTROLBOARD,
"Error while Handling IInteractionMode message, command was not SET nor GET");
843 b1.addFloat64(
p1[
i]);
846 b2.addFloat64(
p2[
i]);
934 for (
size_t i = 0;
i <
njs;
i++) {
937 p[
i].kp =
c->get(0).asFloat64();
938 p[
i].kd =
c->get(1).asFloat64();
939 p[
i].ki =
c->get(2).asFloat64();
940 p[
i].max_int =
c->get(3).asFloat64();
941 p[
i].max_output =
c->get(4).asFloat64();
942 p[
i].offset =
c->get(5).asFloat64();
943 p[
i].scale =
c->get(6).asFloat64();
944 p[
i].stiction_up_val =
c->get(7).asFloat64();
945 p[
i].stiction_down_val =
c->get(8).asFloat64();
946 p[
i].kff =
c->get(9).asFloat64();
974 auto*
p =
new double[
njs];
975 for (
size_t i = 0;
i <
njs;
i++) {
996 auto*
p =
new double[
njs];
997 for (
size_t i = 0;
i <
njs;
i++) {
1024 response.
add(cmd.
get(1));
1095 c.addFloat64(
p[
i].kp);
1096 c.addFloat64(
p[
i].kd);
1097 c.addFloat64(
p[
i].ki);
1098 c.addFloat64(
p[
i].max_int);
1099 c.addFloat64(
p[
i].max_output);
1100 c.addFloat64(
p[
i].offset);
1101 c.addFloat64(
p[
i].scale);
1102 c.addFloat64(
p[
i].stiction_up_val);
1103 c.addFloat64(
p[
i].stiction_down_val);
1104 c.addFloat64(
p[
i].kff);
1180 response.
add(cmd.
get(1));
1250 std::string s =
btail.toString();
1267 response.
add(cmd.
get(1));
1358 response.
add(cmd.
get(1));
1383 if (cmd.
size() < 2) {
1516 for (
size_t i = 0;
i <
njs;
i++) {
1527 auto len =
static_cast<size_t>(cmd.
get(2).
asInt32());
1538 if (len !=
jlut->size() || len !=
pos_val->size()) {
1542 auto*
j_tmp =
new int[len];
1543 auto*
pos_tmp =
new double[len];
1544 for (
size_t i = 0;
i < len;
i++) {
1567 for (
size_t i = 0;
i <
njs;
i++) {
1583 auto len =
static_cast<size_t>(cmd.
get(2).
asInt32());
1598 int*
j_tmp =
new int[len];
1599 auto*
pos_tmp =
new double[len];
1601 for (
size_t i = 0;
i < len;
i++) {
1605 for (
size_t i = 0;
i < len;
i++) {
1627 auto*
p =
new double[
njs];
1628 for (
size_t i = 0;
i <
njs;
i++) {
1642 auto len =
static_cast<size_t>(cmd.
get(2).
asInt32());
1657 int*
j_tmp =
new int[len];
1660 for (
size_t i = 0;
i < len;
i++) {
1664 for (
size_t i = 0;
i < len;
i++) {
1685 auto*
p =
new double[
njs];
1686 for (
size_t i = 0;
i <
njs;
i++) {
1700 auto len =
static_cast<size_t>(cmd.
get(2).
asInt32());
1715 int*
j_tmp =
new int[len];
1718 for (
size_t i = 0;
i < len;
i++) {
1722 for (
size_t i = 0;
i < len;
i++) {
1743 auto*
p =
new double[
njs];
1744 for (
size_t i = 0;
i <
njs;
i++) {
1758 auto len =
static_cast<size_t>(cmd.
get(2).
asInt32());
1772 int*
j_tmp =
new int[len];
1774 for (
size_t i = 0;
i < len;
i++) {
1814 auto*
p =
new double[
njs];
1815 for (
size_t i = 0;
i <
njs;
i++) {
1854 auto*
p =
new double[
njs];
1855 for (
size_t i = 0;
i <
njs;
i++) {
1863 if (!
rcp_IAmp) { ok =
false;
break; }
1868 if (!
rcp_IAmp) { ok =
false;
break; }
1873 if (!
rcp_IAmp) { ok =
false;
break; }
1878 if (!
rcp_IAmp) { ok =
false;
break; }
1883 if (!
rcp_IAmp) { ok =
false;
break; }
1888 if (!
rcp_IAmp) { ok =
false;
break; }
1909 if (!
rcp_Ilim) { ok =
false;
break; }
1928 response.
add(cmd.
get(1));
1962 if (!
rcp_IAmp) { ok =
false;
break; }
1981 auto*
refs =
new double[len];
1983 for (
int j = 0;
j < len;
j++) {
1989 for (
int i = 0;
i < len;
i++) {
2022 auto*
refs =
new double[len];
2024 for (
int j = 0;
j < len;
j++) {
2030 for (
int i = 0;
i < len;
i++) {
2064 auto*
refs =
new double[len];
2066 for (
int j = 0;
j < len;
j++) {
2072 for (
int i = 0;
i < len;
i++) {
2123 for (
int j = 0;
j < len;
j++) {
2152 auto* speeds =
new double[len];
2154 for (
int j = 0;
j < len;
j++) {
2160 for (
int i = 0;
i < len;
i++) {
2190 auto*
accs =
new double[len];
2192 for (
int j = 0;
j < len;
j++) {
2198 for (
int i = 0;
i < len;
i++) {
2333 if (!
rcp_IAmp) { ok =
false;
break; }
2339 if (!
rcp_IAmp) { ok =
false;
break; }
2350 if (!
rcp_IAmp) { ok =
false;
break; }
2363 if (!
rcp_IAmp) { ok =
false;
break; }
2370 if (!
rcp_IAmp) { ok =
false;
break; }
2377 if (!
rcp_IAmp) { ok =
false;
break; }
2384 if (!
rcp_IAmp) { ok =
false;
break; }
2392 if (!
rcp_IAmp) { ok =
false;
break; }
2399 if (!
rcp_IAmp) { ok =
false;
break; }
2407 if (!
rcp_Ilim) { ok =
false;
break; }
2416 if (!
rcp_Ilim) { ok =
false;
break; }
2423 std::string name =
"undocumented";
2479 addUsage(
"[get] [axes]",
"get the number of axes");
2480 addUsage(
"[get] [name] $iAxisNumber",
"get a human-readable name for an axis, if available");
2481 addUsage(
"[set] [pos] $iAxisNumber $fPosition",
"command the position of an axis");
2482 addUsage(
"[set] [rel] $iAxisNumber $fPosition",
"command the relative position of an axis");
2483 addUsage(
"[set] [vmo] $iAxisNumber $fVelocity",
"command the velocity of an axis");
2484 addUsage(
"[get] [enc] $iAxisNumber",
"get the encoder value for an axis");
2494 addUsage((std::string(
"[set] [poss] (") + args +
")").
c_str(),
2495 "command the position of all axes");
2496 addUsage((std::string(
"[set] [rels] (") + args +
")").
c_str(),
2497 "command the relative position of all axes");
2498 addUsage((std::string(
"[set] [vmos] (") + args +
")").
c_str(),
2499 "command the velocity of all axes");
2501 addUsage(
"[set] [aen] $iAxisNumber",
"enable (amplifier for) the given axis");
2502 addUsage(
"[set] [adi] $iAxisNumber",
"disable (amplifier for) the given axis");
2503 addUsage(
"[get] [acu] $iAxisNumber",
"get current for the given axis");
2504 addUsage(
"[get] [acus]",
"get current for all axes");
constexpr yarp::conf::vocab32_t VOCAB_PARK_SINGLE_JOINT
constexpr yarp::conf::vocab32_t VOCAB_REMOTE_CALIBRATOR_INTERFACE
constexpr yarp::conf::vocab32_t VOCAB_HOMING_WHOLE_PART
constexpr yarp::conf::vocab32_t VOCAB_PARK_WHOLE_PART
constexpr yarp::conf::vocab32_t VOCAB_QUIT_PARK
constexpr yarp::conf::vocab32_t VOCAB_IS_CALIBRATOR_PRESENT
constexpr yarp::conf::vocab32_t VOCAB_CALIBRATE_SINGLE_JOINT
constexpr yarp::conf::vocab32_t VOCAB_HOMING_SINGLE_JOINT
constexpr yarp::conf::vocab32_t VOCAB_CALIBRATE_WHOLE_PART
constexpr yarp::conf::vocab32_t VOCAB_QUIT_CALIBRATE
const yarp::os::LogComponent & CONTROLBOARD()
constexpr yarp::conf::vocab32_t VOCAB_TIMESTAMP
constexpr yarp::conf::vocab32_t VOCAB_VELOCITY_MOVE
constexpr yarp::conf::vocab32_t VOCAB_REF_SPEED
constexpr yarp::conf::vocab32_t VOCAB_STOPS
constexpr yarp::conf::vocab32_t VOCAB_MOTION_DONE
constexpr yarp::conf::vocab32_t VOCAB_STOP
constexpr yarp::conf::vocab32_t VOCAB_REF_ACCELERATIONS
constexpr yarp::conf::vocab32_t VOCAB_MOTION_DONES
constexpr yarp::conf::vocab32_t VOCAB_PROTOCOL_VERSION
constexpr yarp::conf::vocab32_t VOCAB_POSITION_MOVE
constexpr yarp::conf::vocab32_t VOCAB_REF_ACCELERATION
constexpr yarp::conf::vocab32_t VOCAB_VELOCITY_MOVES
constexpr yarp::conf::vocab32_t VOCAB_RELATIVE_MOVE
constexpr yarp::conf::vocab32_t VOCAB_REF_SPEEDS
constexpr yarp::conf::vocab32_t VOCAB_RELATIVE_MOVES
constexpr yarp::conf::vocab32_t VOCAB_POSITION_MOVES
constexpr yarp::conf::vocab32_t VOCAB_LIM
constexpr yarp::conf::vocab32_t VOCAB_OUTPUTS
constexpr yarp::conf::vocab32_t VOCAB_ENABLE
constexpr yarp::conf::vocab32_t VOCAB_DISABLE
constexpr yarp::conf::vocab32_t VOCAB_OK
constexpr yarp::conf::vocab32_t VOCAB_REF
constexpr yarp::conf::vocab32_t VOCAB_IS
constexpr yarp::conf::vocab32_t VOCAB_ERRS
constexpr yarp::conf::vocab32_t VOCAB_GET
constexpr yarp::conf::vocab32_t VOCAB_OUTPUT
constexpr yarp::conf::vocab32_t VOCAB_REFERENCE
constexpr yarp::conf::vocab32_t VOCAB_FAILED
constexpr yarp::conf::vocab32_t VOCAB_ERR
constexpr yarp::conf::vocab32_t VOCAB_REFS
constexpr yarp::conf::vocab32_t VOCAB_REFERENCES
constexpr yarp::conf::vocab32_t VOCAB_RESET
constexpr yarp::conf::vocab32_t VOCAB_AXES
constexpr yarp::conf::vocab32_t VOCAB_SET
constexpr yarp::conf::vocab32_t VOCAB_OFFSET
constexpr yarp::conf::vocab32_t VOCAB_LIMS
constexpr yarp::conf::vocab32_t VOCAB_AMP_DISABLE
constexpr yarp::conf::vocab32_t VOCAB_AMP_PEAK_CURRENT
constexpr yarp::conf::vocab32_t VOCAB_AMP_ENABLE
constexpr yarp::conf::vocab32_t VOCAB_AMP_VOLTAGE_SUPPLY
constexpr yarp::conf::vocab32_t VOCAB_AMP_CURRENT
constexpr yarp::conf::vocab32_t VOCAB_AMP_MAXCURRENT
constexpr yarp::conf::vocab32_t VOCAB_AMP_STATUS_SINGLE
constexpr yarp::conf::vocab32_t VOCAB_AMP_STATUS
constexpr yarp::conf::vocab32_t VOCAB_AMP_NOMINAL_CURRENT
constexpr yarp::conf::vocab32_t VOCAB_AMP_PWM
constexpr yarp::conf::vocab32_t VOCAB_AMP_CURRENTS
constexpr yarp::conf::vocab32_t VOCAB_AMP_PWM_LIMIT
constexpr yarp::conf::vocab32_t VOCAB_INFO_TYPE
constexpr yarp::conf::vocab32_t VOCAB_INFO_NAME
constexpr yarp::conf::vocab32_t VOCAB_CALIBRATE_JOINT_PARAMS
constexpr yarp::conf::vocab32_t VOCAB_CALIBRATE_DONE
constexpr yarp::conf::vocab32_t VOCAB_CALIBRATE_JOINT
constexpr yarp::conf::vocab32_t VOCAB_CALIBRATE
constexpr yarp::conf::vocab32_t VOCAB_PARK
constexpr yarp::conf::vocab32_t VOCAB_LIMITS
constexpr yarp::conf::vocab32_t VOCAB_VEL_LIMITS
constexpr yarp::conf::vocab32_t VOCAB_CM_CONTROL_MODE_GROUP
constexpr yarp::conf::vocab32_t VOCAB_CM_MIXED
constexpr yarp::conf::vocab32_t VOCAB_CM_TORQUE
constexpr yarp::conf::vocab32_t VOCAB_CM_PWM
constexpr yarp::conf::vocab32_t VOCAB_CM_IMPEDANCE_VEL
constexpr yarp::conf::vocab32_t VOCAB_CM_POSITION
constexpr yarp::conf::vocab32_t VOCAB_CM_CONTROL_MODES
constexpr yarp::conf::vocab32_t VOCAB_CM_CURRENT
constexpr yarp::conf::vocab32_t VOCAB_CM_IMPEDANCE_POS
constexpr yarp::conf::vocab32_t VOCAB_CM_CONTROL_MODE
constexpr yarp::conf::vocab32_t VOCAB_CM_POSITION_DIRECT
constexpr yarp::conf::vocab32_t VOCAB_ICONTROLMODE
constexpr yarp::conf::vocab32_t VOCAB_CM_VELOCITY
constexpr yarp::conf::vocab32_t VOCAB_CM_FORCE_IDLE
constexpr yarp::conf::vocab32_t VOCAB_CURRENT_REF_GROUP
constexpr yarp::conf::vocab32_t VOCAB_CURRENT_REFS
constexpr yarp::conf::vocab32_t VOCAB_CURRENT_RANGE
constexpr yarp::conf::vocab32_t VOCAB_CURRENTCONTROL_INTERFACE
constexpr yarp::conf::vocab32_t VOCAB_CURRENT_REF
constexpr yarp::conf::vocab32_t VOCAB_CURRENT_RANGES
constexpr yarp::conf::vocab32_t VOCAB_E_RESET
constexpr yarp::conf::vocab32_t VOCAB_ENCODER_ACCELERATIONS
constexpr yarp::conf::vocab32_t VOCAB_ENCODER
constexpr yarp::conf::vocab32_t VOCAB_ENCODER_SPEEDS
constexpr yarp::conf::vocab32_t VOCAB_E_RESETS
constexpr yarp::conf::vocab32_t VOCAB_ENCODER_SPEED
constexpr yarp::conf::vocab32_t VOCAB_ENCODER_ACCELERATION
constexpr yarp::conf::vocab32_t VOCAB_ENCODERS
constexpr yarp::conf::vocab32_t VOCAB_IMPEDANCE
constexpr yarp::conf::vocab32_t VOCAB_INTERACTION_MODES
constexpr yarp::conf::vocab32_t VOCAB_INTERACTION_MODE_GROUP
constexpr yarp::conf::vocab32_t VOCAB_INTERACTION_MODE
constexpr yarp::conf::vocab32_t VOCAB_INTERFACE_INTERACTION_MODE
constexpr yarp::conf::vocab32_t VOCAB_JF_GET_JOINTFAULT
constexpr yarp::conf::vocab32_t VOCAB_IJOINTFAULT
constexpr yarp::conf::vocab32_t VOCAB_MOTOR_ENCODER_SPEED
constexpr yarp::conf::vocab32_t VOCAB_MOTOR_ENCODER_ACCELERATIONS
constexpr yarp::conf::vocab32_t VOCAB_MOTOR_ENCODER_ACCELERATION
constexpr yarp::conf::vocab32_t VOCAB_MOTOR_ENCODER
constexpr yarp::conf::vocab32_t VOCAB_MOTOR_ENCODER_SPEEDS
constexpr yarp::conf::vocab32_t VOCAB_MOTOR_ENCODER_NUMBER
constexpr yarp::conf::vocab32_t VOCAB_MOTOR_E_RESETS
constexpr yarp::conf::vocab32_t VOCAB_MOTOR_E_RESET
constexpr yarp::conf::vocab32_t VOCAB_MOTOR_ENCODERS
constexpr yarp::conf::vocab32_t VOCAB_MOTOR_CPR
constexpr yarp::conf::vocab32_t VOCAB_TEMPERATURES
constexpr yarp::conf::vocab32_t VOCAB_TEMPERATURE_LIMIT
constexpr yarp::conf::vocab32_t VOCAB_TEMPERATURE
constexpr yarp::conf::vocab32_t VOCAB_GEARBOX_RATIO
constexpr yarp::conf::vocab32_t VOCAB_MOTORS_NUMBER
constexpr yarp::conf::vocab32_t VOCAB_PWMCONTROL_INTERFACE
constexpr yarp::conf::vocab32_t VOCAB_PWMCONTROL_PWM_OUTPUTS
constexpr yarp::conf::vocab32_t VOCAB_PWMCONTROL_REF_PWMS
constexpr yarp::conf::vocab32_t VOCAB_PWMCONTROL_REF_PWM
constexpr yarp::conf::vocab32_t VOCAB_PWMCONTROL_PWM_OUTPUT
constexpr yarp::conf::vocab32_t VOCAB_PIDS
constexpr yarp::conf::vocab32_t VOCAB_PID
constexpr yarp::conf::vocab32_t VOCAB_REF_ACCELERATION_GROUP
constexpr yarp::conf::vocab32_t VOCAB_STOP_GROUP
constexpr yarp::conf::vocab32_t VOCAB_RELATIVE_MOVE_GROUP
constexpr yarp::conf::vocab32_t VOCAB_POSITION_MOVE_GROUP
constexpr yarp::conf::vocab32_t VOCAB_MOTION_DONE_GROUP
constexpr yarp::conf::vocab32_t VOCAB_REF_SPEED_GROUP
constexpr yarp::conf::vocab32_t VOCAB_POSITION_DIRECTS
constexpr yarp::conf::vocab32_t VOCAB_POSITION_DIRECT
constexpr yarp::conf::vocab32_t VOCAB_POSITION_DIRECT_GROUP
constexpr yarp::conf::vocab32_t VOCAB_LIST_VARIABLES
constexpr yarp::conf::vocab32_t VOCAB_VARIABLE
constexpr yarp::conf::vocab32_t VOCAB_REMOTE_VARIABILE_INTERFACE
constexpr yarp::conf::vocab32_t VOCAB_TORQUE
constexpr yarp::conf::vocab32_t VOCAB_TRQ
constexpr yarp::conf::vocab32_t VOCAB_TRQS
constexpr yarp::conf::vocab32_t VOCAB_RANGE
constexpr yarp::conf::vocab32_t VOCAB_IMP_OFFSET
constexpr yarp::conf::vocab32_t VOCAB_MOTOR_PARAMS
constexpr yarp::conf::vocab32_t VOCAB_IMP_PARAM
constexpr yarp::conf::vocab32_t VOCAB_RANGES
constexpr yarp::conf::vocab32_t VOCAB_TORQUE_MODE
constexpr yarp::conf::vocab32_t VOCAB_VELOCITY_MOVE_GROUP
void appendTimeStamp(Bottle &bot, Stamp &st)
constexpr int PROTOCOL_VERSION_TWEAK
constexpr int PROTOCOL_VERSION_MINOR
constexpr int PROTOCOL_VERSION_MAJOR
void handleRemoteCalibratorMsg(const yarp::os::Bottle &cmd, yarp::os::Bottle &response, bool *rec, bool *ok)
yarp::dev::IControlCalibration * rpc_Icalib
yarp::dev::IEncodersTimed * rpc_IEncTimed
yarp::dev::IControlMode * rpc_iCtrlMode
yarp::dev::IRemoteCalibrator * rpc_IRemoteCalibrator
yarp::dev::IAxisInfo * rpc_AxisInfo
yarp::dev::ITorqueControl * rpc_ITorque
yarp::dev::IPidControl * rpc_IPid
void handleProtocolVersionRequest(const yarp::os::Bottle &cmd, yarp::os::Bottle &response, bool *rec, bool *ok)
void handlePWMMsg(const yarp::os::Bottle &cmd, yarp::os::Bottle &response, bool *rec, bool *ok)
yarp::dev::IRemoteVariables * rpc_IVar
yarp::dev::IImpedanceControl * rpc_IImpedance
void handleCurrentMsg(const yarp::os::Bottle &cmd, yarp::os::Bottle &response, bool *rec, bool *ok)
void handleInteractionModeMsg(const yarp::os::Bottle &cmd, yarp::os::Bottle &response, bool *rec, bool *ok)
void handleControlModeMsg(const yarp::os::Bottle &cmd, yarp::os::Bottle &response, bool *rec, bool *ok)
void init(yarp::dev::DeviceDriver *x)
Initialization.
yarp::dev::IPositionDirect * rpc_IPosDirect
yarp::dev::ICurrentControl * rpc_ICurrent
void handleTorqueMsg(const yarp::os::Bottle &cmd, yarp::os::Bottle &response, bool *rec, bool *ok)
yarp::dev::IMotorEncoders * rpc_IMotEnc
yarp::dev::IInteractionMode * rpc_IInteract
void handleJointFaultMsg(const yarp::os::Bottle &cmd, yarp::os::Bottle &response, bool *rec, bool *ok)
void handlePidMsg(const yarp::os::Bottle &cmd, yarp::os::Bottle &response, bool *rec, bool *ok)
yarp::dev::IJointFault * rpc_IJointFault
virtual bool initialize()
Initialize the internal data.
yarp::dev::IPositionControl * rpc_IPosCtrl
bool respond(const yarp::os::Bottle &cmd, yarp::os::Bottle &response) override
Respond to a message.
yarp::sig::Vector tmpVect
yarp::dev::IVelocityControl * rpc_IVelCtrl
yarp::dev::IPWMControl * rpc_IPWM
yarp::dev::IAmplifierControl * rcp_IAmp
yarp::dev::IMotor * rpc_IMotor
yarp::dev::IControlLimits * rcp_Ilim
yarp::os::Stamp lastRpcStamp
void handleImpedanceMsg(const yarp::os::Bottle &cmd, yarp::os::Bottle &response, bool *rec, bool *ok)
void handleRemoteVariablesMsg(const yarp::os::Bottle &cmd, yarp::os::Bottle &response, bool *rec, bool *ok)
Interface implemented by all device drivers.
bool view(T *&x)
Get an interface to the device driver.
virtual bool respond(const yarp::os::Bottle &command, yarp::os::Bottle &reply)
Respond to a message.
void addUsage(const char *txt, const char *explain=nullptr)
Add information about a message that the respond() method understands.
void makeUsage()
Regenerate usage information.
virtual bool getPWMLimit(int j, double *val)
virtual bool enableAmp(int j)=0
Enable the amplifier on a specific joint.
virtual bool setNominalCurrent(int m, const double val)
virtual bool getCurrents(double *vals)=0
virtual bool disableAmp(int j)=0
Disable the amplifier on a specific joint.
virtual bool getPWM(int j, double *val)
virtual bool getAmpStatus(int *st)=0
virtual bool setPWMLimit(int j, const double val)
virtual bool getMaxCurrent(int j, double *v)=0
Returns the maximum electric current allowed for a given motor.
virtual bool getNominalCurrent(int m, double *val)
virtual bool getCurrent(int j, double *val)=0
virtual bool getPowerSupplyVoltage(int j, double *val)
virtual bool setMaxCurrent(int j, double v)=0
virtual bool setPeakCurrent(int m, const double val)
virtual bool getPeakCurrent(int m, double *val)
virtual bool getAxisName(int axis, std::string &name)=0
virtual bool getAxes(int *ax)=0
Get the number of controlled axes.
virtual bool getJointType(int axis, yarp::dev::JointTypeEnum &type)
virtual bool setCalibrationParameters(int axis, const CalibrationParameters ¶ms)
Start calibration, this method is very often platform specific.
virtual bool park(bool wait=true)
virtual bool calibrateRobot()
Calibrate robot by using an external calibrator.
virtual bool calibrationDone(int j)=0
Check if the calibration is terminated, on a particular joint.
virtual bool calibrateAxisWithParams(int axis, unsigned int type, double p1, double p2, double p3)=0
Start calibration, this method is very often platform specific.
virtual bool getVelLimits(int axis, double *min, double *max)=0
Get the software speed limits for a particular axis.
virtual bool getLimits(int axis, double *min, double *max)=0
Get the software limits for a particular axis.
virtual bool setLimits(int axis, double min, double max)=0
Set the software limits for a particular axis, the behavior of the control card when these limits are...
virtual bool setVelLimits(int axis, double min, double max)=0
Set the software speed limits for a particular axis, the behavior of the control card when these limi...
virtual bool setControlMode(const int j, const int mode)=0
Set the current control mode.
virtual bool setControlModes(const int n_joint, const int *joints, int *modes)=0
Set the current control mode for a subset of axes.
virtual bool getControlModes(int *modes)=0
Get the current control mode (multiple joints).
virtual bool getControlMode(int j, int *mode)=0
Get the current control mode.
virtual bool getRefCurrents(double *currs)=0
Get the reference value of the currents for all motors.
virtual bool getCurrentRange(int m, double *min, double *max)=0
Get the full scale of the current measurement for a given motor (e.g.
virtual bool getRefCurrent(int m, double *curr)=0
Get the reference value of the current for a single motor.
virtual bool getCurrentRanges(double *min, double *max)=0
Get the full scale of the current measurements for all motors motor (e.g.
virtual bool getEncoderSpeed(int j, double *sp)=0
Read the istantaneous speed of an axis.
virtual bool getEncoderAccelerations(double *accs)=0
Read the instantaneous acceleration of all axes.
virtual bool setEncoder(int j, double val)=0
Set the value of the encoder for a given joint.
virtual bool getEncoder(int j, double *v)=0
Read the value of an encoder.
virtual bool resetEncoder(int j)=0
Reset encoder, single joint.
virtual bool setEncoders(const double *vals)=0
Set the value of all encoders.
virtual bool getEncoders(double *encs)=0
Read the position of all axes.
virtual bool getEncoderSpeeds(double *spds)=0
Read the instantaneous speed of all axes.
virtual bool getEncoderAcceleration(int j, double *spds)=0
Read the instantaneous acceleration of an axis.
virtual bool resetEncoders()=0
Reset encoders.
virtual bool setImpedance(int j, double stiffness, double damping)=0
Set current impedance gains (stiffness,damping) for a specific joint.
virtual bool getImpedanceOffset(int j, double *offset)=0
Get current force Offset for a specific joint.
virtual bool setImpedanceOffset(int j, double offset)=0
Set current force Offset for a specific joint.
virtual bool getImpedance(int j, double *stiffness, double *damping)=0
Get current impedance gains (stiffness,damping,offset) for a specific joint.
virtual bool getCurrentImpedanceLimit(int j, double *min_stiff, double *max_stiff, double *min_damp, double *max_damp)=0
Get the current impedandance limits for a specific joint.
virtual bool getInteractionMode(int axis, yarp::dev::InteractionModeEnum *mode)=0
Get the current interaction mode of the robot, values can be stiff or compliant.
virtual bool getInteractionModes(int n_joints, int *joints, yarp::dev::InteractionModeEnum *modes)=0
Get the current interaction mode of the robot for a set of joints, values can be stiff or compliant.
virtual bool setInteractionModes(int n_joints, int *joints, yarp::dev::InteractionModeEnum *modes)=0
Set the interaction mode of the robot for a set of joints, values can be stiff or compliant.
virtual bool setInteractionMode(int axis, yarp::dev::InteractionModeEnum mode)=0
Set the interaction mode of the robot, values can be stiff or compliant.
virtual bool getLastJointFault(int j, int &fault, std::string &message)=0
virtual bool getMotorEncoderCountsPerRevolution(int m, double *cpr)=0
Gets number of counts per revolution for motor encoder m.
virtual bool setMotorEncoderCountsPerRevolution(int m, const double cpr)=0
Sets number of counts per revolution for motor encoder m.
virtual bool resetMotorEncoder(int m)=0
Reset motor encoder, single motor.
virtual bool getMotorEncoderSpeed(int m, double *sp)=0
Read the istantaneous speed of a motor encoder.
virtual bool getMotorEncoderSpeeds(double *spds)=0
Read the instantaneous speed of all motor encoders.
virtual bool getMotorEncoderAcceleration(int m, double *acc)=0
Read the instantaneous acceleration of a motor encoder.
virtual bool getMotorEncoderAccelerations(double *accs)=0
Read the instantaneous acceleration of all motor encoders.
virtual bool getNumberOfMotorEncoders(int *num)=0
Get the number of available motor encoders.
virtual bool setMotorEncoders(const double *vals)=0
Set the value of all motor encoders.
virtual bool getMotorEncoders(double *encs)=0
Read the position of all motor encoders.
virtual bool resetMotorEncoders()=0
Reset motor encoders.
virtual bool setMotorEncoder(int m, const double val)=0
Set the value of the motor encoder for a given motor.
virtual bool getMotorEncoder(int m, double *v)=0
Read the value of a motor encoder.
virtual bool getTemperature(int m, double *val)=0
Get temperature of a motor.
virtual bool getTemperatures(double *vals)=0
Get temperature of all the motors.
virtual bool getNumberOfMotors(int *num)=0
Get the number of available motors.
virtual bool getTemperatureLimit(int m, double *temp)=0
Retreives the current temperature limit for a specific motor.
virtual bool getGearboxRatio(int m, double *val)
Get the gearbox ratio for a specific motor.
virtual bool setTemperatureLimit(int m, const double temp)=0
Set the temperature limit for a specific motor.
virtual bool setGearboxRatio(int m, const double val)
Set the gearbox ratio for a specific motor.
virtual bool getDutyCycle(int m, double *val)=0
Gets the current dutycycle of the output of the amplifier (i.e.
virtual bool getRefDutyCycles(double *refs)=0
Gets the last reference sent using the setRefDutyCycles function.
virtual bool getRefDutyCycle(int m, double *ref)=0
Gets the last reference sent using the setRefDutyCycle function.
virtual bool setPid(const PidControlTypeEnum &pidtype, int j, const Pid &pid)=0
Set new pid value for a joint axis.
virtual bool getPidReference(const PidControlTypeEnum &pidtype, int j, double *ref)=0
Get the current reference of the pid controller for a specific joint.
virtual bool getPidOutput(const PidControlTypeEnum &pidtype, int j, double *out)=0
Get the output of the controller (e.g.
virtual bool getPidReferences(const PidControlTypeEnum &pidtype, double *refs)=0
Get the current reference of all pid controllers.
virtual bool resetPid(const PidControlTypeEnum &pidtype, int j)=0
Reset the controller of a given joint, usually sets the current status of the joint as the reference ...
virtual bool setPidOffset(const PidControlTypeEnum &pidtype, int j, double v)=0
Set offset value for a given controller.
virtual bool getPidErrorLimits(const PidControlTypeEnum &pidtype, double *limits)=0
Get the error limit for all controllers.
virtual bool getPidError(const PidControlTypeEnum &pidtype, int j, double *err)=0
Get the current error for a joint.
virtual bool getPidErrorLimit(const PidControlTypeEnum &pidtype, int j, double *limit)=0
Get the error limit for the controller on a specific joint.
virtual bool setPidErrorLimit(const PidControlTypeEnum &pidtype, int j, double limit)=0
Set the error limit for the controller on a specifi joint.
virtual bool disablePid(const PidControlTypeEnum &pidtype, int j)=0
Disable the pid computation for a joint.
virtual bool setPidErrorLimits(const PidControlTypeEnum &pidtype, const double *limits)=0
Get the error limit for the controller on all joints.
virtual bool getPidOutputs(const PidControlTypeEnum &pidtype, double *outs)=0
Get the output of the controllers (e.g.
virtual bool setPidReference(const PidControlTypeEnum &pidtype, int j, double ref)=0
Set the controller reference for a given axis.
virtual bool setPidReferences(const PidControlTypeEnum &pidtype, const double *refs)=0
Set the controller reference, multiple axes.
virtual bool getPidErrors(const PidControlTypeEnum &pidtype, double *errs)=0
Get the error of all joints.
virtual bool setPids(const PidControlTypeEnum &pidtype, const Pid *pids)=0
Set new pid value on multiple axes.
virtual bool enablePid(const PidControlTypeEnum &pidtype, int j)=0
Enable the pid computation for a joint.
virtual bool isPidEnabled(const PidControlTypeEnum &pidtype, int j, bool *enabled)=0
Get the current status (enabled/disabled) of the pid.
virtual bool getPids(const PidControlTypeEnum &pidtype, Pid *pids)=0
Get current pid value for a specific joint.
virtual bool getPid(const PidControlTypeEnum &pidtype, int j, Pid *pid)=0
Get current pid value for a specific joint.
virtual bool getRefAcceleration(int j, double *acc)=0
Get reference acceleration for a joint.
virtual bool getAxes(int *ax)=0
Get the number of controlled axes.
virtual bool setRefSpeed(int j, double sp)=0
Set reference speed for a joint, this is the speed used during the interpolation of the trajectory.
virtual bool setRefAcceleration(int j, double acc)=0
Set reference acceleration for a joint.
virtual bool relativeMove(int j, double delta)=0
Set relative position.
virtual bool getTargetPosition(const int joint, double *ref)
Get the last position reference for the specified axis.
virtual bool setRefSpeeds(const double *spds)=0
Set reference speed on all joints.
virtual bool checkMotionDone(int j, bool *flag)=0
Check if the current trajectory is terminated.
virtual bool getRefSpeeds(double *spds)=0
Get reference speed of all joints.
virtual bool stop(int j)=0
Stop motion, single joint.
virtual bool setRefAccelerations(const double *accs)=0
Set reference acceleration on all joints.
virtual bool getRefAccelerations(double *accs)=0
Get reference acceleration of all joints.
virtual bool getRefSpeed(int j, double *ref)=0
Get reference speed for a joint.
virtual bool positionMove(int j, double ref)=0
Set new reference point for a single axis.
virtual bool getTargetPositions(double *refs)
Get the last position reference for all axes.
virtual bool getRefPositions(double *refs)
Get the last position reference for all axes.
virtual bool getRefPosition(const int joint, double *ref)
Get the last position reference for the specified axis.
virtual bool parkWholePart()=0
parkWholePart: start the parking procedure for the whole part
virtual bool homingSingleJoint(int j)=0
homingSingleJoint: call the homing procedure for a single joint
virtual bool isCalibratorDevicePresent(bool *isCalib)
isCalibratorDevicePresent: check if a calibrator device has been set
virtual bool homingWholePart()=0
homingWholePart: call the homing procedure for a the whole part/device
virtual bool quitPark()=0
quitPark: interrupt the park procedure
virtual bool parkSingleJoint(int j, bool _wait=true)=0
parkSingleJoint(): start the parking procedure for the single joint
virtual bool calibrateSingleJoint(int j)=0
calibrateSingleJoint: call the calibration procedure for the single joint
virtual bool calibrateWholePart()=0
calibrateWholePart: call the procedure for calibrating the whole device
virtual bool quitCalibrate()=0
quitCalibrate: interrupt the calibration procedure
virtual bool setRemoteVariable(std::string key, const yarp::os::Bottle &val)=0
virtual bool getRemoteVariable(std::string key, yarp::os::Bottle &val)=0
virtual bool getRemoteVariablesList(yarp::os::Bottle *listOfKeys)=0
virtual bool setRefTorque(int j, double t)=0
Set the reference value of the torque for a given joint.
virtual bool setRefTorques(const double *t)=0
Set the reference value of the torque for all joints.
virtual bool getRefTorques(double *t)=0
Get the reference value of the torque for all joints.
virtual bool setMotorTorqueParams(int j, const yarp::dev::MotorTorqueParameters params)
Set a subset of motor parameters (bemf, ktau etc) useful for torque control.
virtual bool getMotorTorqueParams(int j, yarp::dev::MotorTorqueParameters *params)
Get a subset of motor parameters (bemf, ktau etc) useful for torque control.
virtual bool getTorques(double *t)=0
Get the value of the torque for all joints (this is the feedback if you have torque sensors).
virtual bool getAxes(int *ax)=0
Get the number of controlled axes.
virtual bool getTorqueRange(int j, double *min, double *max)=0
Get the full scale of the torque sensor of a given joint.
virtual bool getTorqueRanges(double *min, double *max)=0
Get the full scale of the torque sensors of all joints.
virtual bool getRefTorque(int j, double *t)=0
Get the reference value of the torque for a given joint.
virtual bool getTorque(int j, double *t)=0
Get the value of the torque on a given joint (this is the feedback if you have a torque sensor).
virtual bool getRefVelocity(const int joint, double *vel)
Get the last reference speed set by velocityMove for single joint.
virtual bool getAxes(int *axes)=0
Get the number of controlled axes.
virtual bool velocityMove(int j, double sp)=0
Start motion at a given speed, single joint.
virtual bool getRefVelocities(double *vels)
Get the last reference speed set by velocityMove for all joints.
Contains the parameters for a PID.
A simple collection of objects that can be described and transmitted in a portable way.
void add(const Value &value)
Add a Value to the bottle, at the end of the list.
void addVocab32(yarp::conf::vocab32_t x)
Places a vocabulary item in the bottle, at the end of the list.
Bottle & addList()
Places an empty nested list in the bottle, at the end of the list.
size_type size() const
Gets the number of elements in the bottle.
void addFloat64(yarp::conf::float64_t x)
Places a 64-bit floating point number in the bottle, at the end of the list.
Value & get(size_type index) const
Reads a Value v from a certain part of the list.
Bottle tail() const
Get all but the first element of a bottle.
void clear()
Empties the bottle of any objects it contains.
void addInt32(std::int32_t x)
Places a 32-bit integer in the bottle, at the end of the list.
void addString(const char *str)
Places a string in the bottle, at the end of the list.
std::string toString() const override
Gives a human-readable textual representation of the bottle.
A mini-server for performing network communication in the background.
An abstraction for a time stamp and/or sequence number.
void update()
Set the timestamp to the current time, and increment the sequence number (wrapping to 0 if the sequen...
virtual yarp::conf::float64_t asFloat64() const
Get 64-bit floating point value.
virtual yarp::conf::vocab32_t asVocab32() const
Get vocabulary identifier as an integer.
virtual std::int32_t asInt32() const
Get 32-bit integer value.
virtual Bottle * asList() const
Get list value.
virtual std::string asString() const
Get string value.
void resize(size_t size) override
Resize the vector.
#define yCError(component,...)
#define yCTrace(component,...)
#define yCWarning(component,...)
#define yCDebug(component,...)
For streams capable of holding different kinds of content, check what they actually have.
std::string decode(NetInt32 code)
Convert a vocabulary identifier into a string.
An interface to the operating system, including Port based communication.