YARP
Yet Another Robot Platform
 
Loading...
Searching...
No Matches
xHandControlBoard.h
Go to the documentation of this file.
1// SPDX-FileCopyrightText: Fondazione Istituto Italiano di Tecnologia (IIT)
2// SPDX-License-Identifier: BSD-2-Clause
3
4#ifndef ISAACSIM_MAS_SENSORS_NWC_ROS2_H
5#define ISAACSIM_MAS_SENSORS_NWC_ROS2_H
6
11
12#include <xhand_control.hpp>
13
14#include <memory>
15#include <mutex>
16#include <atomic>
17#include <string>
18#include <thread>
19#include <vector>
20#include <unordered_map>
21
23
24namespace yarp::dev
25{
26 class xHandControlBoard;
27}
28
29
40 public yarp::dev::IMotor,
55{
56
57public:
59 ~xHandControlBoard() override;
60
61 /* DeviceDriver methods */
62 bool open(yarp::os::Searchable& config) override;
63 bool close() override;
64
65 /* IPidControl */
66 bool setPid(const yarp::dev::PidControlTypeEnum& pidtype, int j, const yarp::dev::Pid& p) override;
67
68 bool setPids(const yarp::dev::PidControlTypeEnum& pidtype, const yarp::dev::Pid* ps) override;
69
70 bool setPidReference(const yarp::dev::PidControlTypeEnum& pidtype, int j, double ref) override;
71
72 bool setPidReferences(const yarp::dev::PidControlTypeEnum& pidtype, const double* refs) override;
73
74 bool setPidErrorLimit(const yarp::dev::PidControlTypeEnum& pidtype, int j, double limit) override;
75
76 bool setPidErrorLimits(const yarp::dev::PidControlTypeEnum& pidtype, const double* limits) override;
77
78 bool getPidError(const yarp::dev::PidControlTypeEnum& pidtype, int j, double* err) override;
79
80 bool getPidErrors(const yarp::dev::PidControlTypeEnum& pidtype, double* errs) override;
81
82 bool getPidOutput(const yarp::dev::PidControlTypeEnum& pidtype, int j, double* out) override;
83
84 bool getPidOutputs(const yarp::dev::PidControlTypeEnum& pidtype, double* outs) override;
85
86 bool setPidOffset(const yarp::dev::PidControlTypeEnum& pidtype, int j, double v) override;
87
88 bool getPid(const yarp::dev::PidControlTypeEnum& pidtype, int j, yarp::dev::Pid* p) override;
89
90 bool getPids(const yarp::dev::PidControlTypeEnum& pidtype, yarp::dev::Pid* pids) override;
91
92 bool getPidReference(const yarp::dev::PidControlTypeEnum& pidtype, int j, double* ref) override;
93
94 bool getPidReferences(const yarp::dev::PidControlTypeEnum& pidtype, double* refs) override;
95
96 bool getPidErrorLimit(const yarp::dev::PidControlTypeEnum& pidtype, int j, double* limit) override;
97
98 bool getPidErrorLimits(const yarp::dev::PidControlTypeEnum& pidtype, double* limits) override;
99
100 bool resetPid(const yarp::dev::PidControlTypeEnum& pidtype, int j) override;
101
102 bool disablePid(const yarp::dev::PidControlTypeEnum& pidtype, int j) override;
103
104 bool enablePid(const yarp::dev::PidControlTypeEnum& pidtype, int j) override;
105
106 bool isPidEnabled(const yarp::dev::PidControlTypeEnum& pidtype, int j, bool* enabled) override;
107
108 /* IPositionControl */
109 bool getAxes(int* ax) override;
110
111 bool positionMove(int j, double ref) override;
112
113 bool positionMove(const double* refs) override;
114
115 bool positionMove(const int n_joints, const int* joints, const double* refs) override;
116
117 bool getTargetPosition(const int joint, double* ref) override;
118
119 bool getTargetPositions(double* refs) override;
120
121 bool getTargetPositions(const int n_joint, const int* joints, double* refs) override;
122
123 bool relativeMove(int j, double delta) override;
124
125 bool relativeMove(const double* deltas) override;
126
127 bool relativeMove(const int n_joints, const int* joints, const double* deltas) override;
128
129 bool checkMotionDone(int j, bool* flag) override;
130
131 bool checkMotionDone(bool* flag) override;
132
133 bool checkMotionDone(const int n_joints, const int* joints, bool* flags) override;
134
135 bool setRefSpeed(int j, double sp) override;
136
137 bool setRefSpeeds(const double* spds) override;
138
139 bool setRefSpeeds(const int n_joints, const int* joints, const double* spds) override;
140
141 bool setRefAcceleration(int j, double acc) override;
142
143 bool setRefAccelerations(const double* accs) override;
144
145 bool setRefAccelerations(const int n_joints, const int* joints, const double* accs) override;
146
147 bool getRefSpeed(int j, double* ref) override;
148
149 bool getRefSpeeds(double* spds) override;
150
151 bool getRefSpeeds(const int n_joints, const int* joints, double* spds) override;
152
153 bool getRefAcceleration(int j, double* acc) override;
154
155 bool getRefAccelerations(double* accs) override;
156
157 bool getRefAccelerations(const int n_joints, const int* joints, double* accs) override;
158
159 bool stop(int j) override;
160
161 bool stop() override;
162
163 bool stop(const int n_joints, const int* joints) override;
164
165 /* IJointFault */
166
167 bool getLastJointFault(int j, int& fault, std::string& message) override;
168
169 /* IVelocityControl */
170 bool velocityMove(int j, double v) override;
171
172 bool velocityMove(const double* v) override;
173
174 /* IEncoders */
175 bool resetEncoder(int j) override;
176
177 bool resetEncoders() override;
178
179 bool setEncoder(int j, double val) override;
180
181 bool setEncoders(const double* vals) override;
182
183 bool getEncoder(int j, double* v) override;
184
185 bool getEncoders(double* encs) override;
186
187 bool getEncodersTimed(double* encs, double* t) override;
188
189 bool getEncoderTimed(int j, double* v, double* t) override;
190
191 bool getEncoderSpeed(int j, double* sp) override;
192
193 bool getEncoderSpeeds(double* spds) override;
194
195 bool getEncoderAcceleration(int j, double* acc) override;
196
197 bool getEncoderAccelerations(double* accs) override;
198
199 /* IMotorEncoders */
200 bool getNumberOfMotorEncoders(int* num) override;
201
202 bool resetMotorEncoder(int m) override;
203
204 bool resetMotorEncoders() override;
205
206 bool setMotorEncoderCountsPerRevolution(int m, const double cpr) override;
207
208 bool getMotorEncoderCountsPerRevolution(int m, double* cpr) override;
209
210 bool setMotorEncoder(int m, const double val) override;
211
212 bool setMotorEncoders(const double* vals) override;
213
214 bool getMotorEncoder(int m, double* v) override;
215
216 bool getMotorEncoders(double* encs) override;
217
218 bool getMotorEncodersTimed(double* encs, double* t) override;
219
220 bool getMotorEncoderTimed(int m, double* v, double* t) override;
221
222 bool getMotorEncoderSpeed(int m, double* sp) override;
223
224 bool getMotorEncoderSpeeds(double* spds) override;
225
226 bool getMotorEncoderAcceleration(int m, double* acc) override;
227
228 bool getMotorEncoderAccelerations(double* accs) override;
229
230 /* IAmplifierControl */
231 bool enableAmp(int j) override;
232
233 bool disableAmp(int j) override;
234
235 bool getAmpStatus(int* st) override;
236
237 bool getAmpStatus(int j, int* v) override;
238
239 bool setMaxCurrent(int j, double v) override;
240
241 bool getMaxCurrent(int j, double* v) override;
242
243 bool getNominalCurrent(int m, double* val) override;
244
245 bool setNominalCurrent(int m, const double val) override;
246
247 bool getPeakCurrent(int m, double* val) override;
248
249 bool setPeakCurrent(int m, const double val) override;
250
251 bool getPWM(int m, double* val) override;
252
253 bool getPWMLimit(int m, double* val) override;
254
255 bool setPWMLimit(int m, const double val) override;
256
257 bool getPowerSupplyVoltage(int m, double* val) override;
258
259 /* IControlLimits */
260 bool setLimits(int j, double min, double max) override;
261
262 bool getLimits(int j, double* min, double* max) override;
263
264 bool setVelLimits(int j, double min, double max) override;
265
266 bool getVelLimits(int j, double* min, double* max) override;
267
268 /* IRemoteVariables */
269
270 bool getRemoteVariable(std::string key, yarp::os::Bottle& val) override;
271
272 bool setRemoteVariable(std::string key, const yarp::os::Bottle& val) override;
273
274 bool getRemoteVariablesList(yarp::os::Bottle* listOfKeys) override;
275
276 /* IRemoteCalibrator */
277
278 bool isCalibratorDevicePresent(bool* isCalib) override;
279
281
282 bool calibrateSingleJoint(int j) override;
283
284 bool calibrateWholePart() override;
285
286 bool homingSingleJoint(int j) override;
287
288 bool homingWholePart() override;
289
290 bool parkSingleJoint(int j, bool _wait = true) override;
291
292 bool parkWholePart() override;
293
294 bool quitCalibrate() override;
295
296 bool quitPark() override;
297
298 /* IControlCalibration */
299
300 bool calibrateAxisWithParams(int j, unsigned int ui, double v1, double v2, double v3) override;
301
302 bool setCalibrationParameters(int j, const yarp::dev::CalibrationParameters& params) override;
303
304 bool calibrationDone(int j) override;
305
306 bool abortPark() override;
307
308 bool abortCalibration() override;
309
310 /* IMotor */
311 bool getNumberOfMotors(int* num) override;
312
313 bool getTemperature(int m, double* val) override;
314
315 bool getTemperatures(double* vals) override;
316
317 bool getTemperatureLimit(int m, double* val) override;
318
319 bool setTemperatureLimit(int m, const double val) override;
320
321 bool getGearboxRatio(int m, double* val) override;
322
323 bool setGearboxRatio(int m, const double val) override;
324
325 /* IAxisInfo */
326 bool getAxisName(int j, std::string& name) override;
327
328 bool getJointType(int j, yarp::dev::JointTypeEnum& type) override;
329
330 bool getRefTorques(double* refs) override;
331
332 bool getRefTorque(int j, double* t) override;
333
334 bool setRefTorques(const double* t) override;
335
336 bool setRefTorque(int j, double t) override;
337
338 bool setRefTorques(const int n_joint, const int* joints, const double* t) override;
339
340 bool getMotorTorqueParams(int j, yarp::dev::MotorTorqueParameters* params) override;
341
342 bool setMotorTorqueParams(int j, const yarp::dev::MotorTorqueParameters params) override;
343
344 bool setImpedance(int j, double stiff, double damp) override;
345
346 bool setImpedanceOffset(int j, double offset) override;
347
348 bool getTorque(int j, double* t) override;
349
350 bool getTorques(double* t) override;
351
352 bool getTorqueRange(int j, double* min, double* max) override;
353
354 bool getTorqueRanges(double* min, double* max) override;
355
356 bool getImpedance(int j, double* stiff, double* damp) override;
357
358 bool getImpedanceOffset(int j, double* offset) override;
359
360 bool getCurrentImpedanceLimit(int j, double* min_stiff, double* max_stiff, double* min_damp, double* max_damp) override;
361
362 bool getControlMode(int j, int* mode) override;
363
364 bool getControlModes(int* modes) override;
365
366 // IControlMode interface
367 bool getControlModes(const int n_joint, const int* joints, int* modes) override;
368
369 bool setControlMode(const int j, const int mode) override;
370
371 bool setControlModes(const int n_joints, const int* joints, int* modes) override;
372
373 bool setControlModes(int* modes) override;
374
375 bool setPosition(int j, double ref) override;
376
377 bool setPositions(const int n_joints, const int* joints, const double* dpos) override;
378
379 bool setPositions(const double* refs) override;
380
381 bool getRefPosition(const int joint, double* ref) override;
382
383 bool getRefPositions(double* refs) override;
384
385 bool getRefPositions(const int n_joint, const int* joints, double* refs) override;
386
388
389 // IVelocityControl interface
390 bool velocityMove(const int n_joints, const int* joints, const double* spds) override;
391
392 bool getRefVelocity(const int joint, double* vel) override;
393
394 bool getRefVelocities(double* vels) override;
395
396 bool getRefVelocities(const int n_joint, const int* joints, double* vels) override;
397
398 bool getInteractionMode(int j, yarp::dev::InteractionModeEnum* mode) override;
399
400 bool getInteractionModes(int n_joints, int* joints, yarp::dev::InteractionModeEnum* modes) override;
401
403
404 bool setInteractionMode(int j, yarp::dev::InteractionModeEnum mode) override;
405
406 bool setInteractionModes(int n_joints, int* joints, yarp::dev::InteractionModeEnum* modes) override;
407
409
410 // IPWMControl
411 bool setRefDutyCycle(int m, double ref) override;
412
413 bool setRefDutyCycles(const double* refs) override;
414
415 bool getRefDutyCycle(int m, double* ref) override;
416
417 bool getRefDutyCycles(double* refs) override;
418
419 bool getDutyCycle(int m, double* val) override;
420
421 bool getDutyCycles(double* vals) override;
422
423 // ICurrentControl
424 bool getCurrent(int m, double* curr) override;
425
426 bool getCurrents(double* currs) override;
427
428 bool getCurrentRange(int m, double* min, double* max) override;
429
430 bool getCurrentRanges(double* min, double* max) override;
431
432 bool setRefCurrents(const double* currs) override;
433
434 bool setRefCurrent(int m, double curr) override;
435
436 bool setRefCurrents(const int n_motor, const int* motors, const double* currs) override;
437
438 bool getRefCurrents(double* currs) override;
439
440 bool getRefCurrent(int m, double* curr) override;
441
442 //PeriodicThread
443 void run() override;
444 bool threadInit() override;
445 void threadRelease() override;
446
447private:
448
449 xhand_control::XHandControl m_XHCtrl{};
450 uint8_t m_id{0};
451 yarp::dev::Pid* m_ppids{}, *m_vpids{}, *m_cpids{}, *m_tpids{};
452 int* m_controlModes{};
453 struct HANDSTATE{
454 double timestamp{0.0};
455 HandState_t state;
456 }m_handState;
457 std::mutex m_mutex;
458 HandCommand_t m_handCommand;
459
460 std::unordered_map<int, int> yarpToXhandControlModes = {
461 {VOCAB_CM_IDLE, 0},
465 };
466
467 void printErrorStruct(const xhand_control::ErrorStruct& err);
468 bool sendCommandToHand(const uint8_t hand_id, const HandCommand_t& command);
469
470};
471#endif
define control board standard interfaces
This class is the parameters parser for class xHandControlBoard.
Interface implemented by all device drivers.
Interface for control devices, amplifier commands.
Interface for getting information about specific axes, if available.
Definition IAxisInfo.h:37
Interface for control devices, calibration commands.
Interface for control devices, commands to get/set position and velocity limits.
Interface for setting control mode in control board.
Interface for control boards implementing current control.
Control board, extend encoder interface with timestamps.
Interface for control boards implementing impedance control.
Interface settings the way the robot interacts with the environment: basic interaction types are Stif...
Interface for getting info about the fault which may occur on a robot.
Definition IJointFault.h:24
Control board, encoder interface.
Control board, encoder interface.
Definition IMotor.h:95
Interface for controlling an axis, by sending directly a PWM reference signal to a motor.
Definition IPWMControl.h:24
Interface for a generic control board device implementing a PID controller, with scaled arguments.
Interface for a generic control board device implementing position control.
Interface for a generic control board device implementing position control.
IRemoteCalibrator interface is meant to remotize the access of the calibration device in order to all...
IRemoteVariables interface.
Interface for control boards implementing torque control.
Interface for control boards implementing velocity control.
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 &params) 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 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.
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 getCurrents(double *currs) override
Get the instantaneous current measurement for all motors.
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.
Definition Bottle.h:65
An abstraction for a periodic thread.
A base class for nested structures that can be searched.
Definition Searchable.h:31
An abstraction for a time stamp and/or sequence number.
Definition Stamp.h:21
For streams capable of holding different kinds of content, check what they actually have.
PidControlTypeEnum
Definition PidEnums.h:15