YARP
Yet Another Robot Platform
 
Loading...
Searching...
No Matches
ControlBoardRemapper.h
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2006-2021 Istituto Italiano di Tecnologia (IIT)
3 * SPDX-License-Identifier: BSD-3-Clause
4 */
5
6#ifndef YARP_DEV_CONTROLBOARDREMAPPER_CONTROLBOARDREMAPPER_H
7#define YARP_DEV_CONTROLBOARDREMAPPER_CONTROLBOARDREMAPPER_H
8
9#include <yarp/os/Network.h>
10
12#include <yarp/dev/PolyDriver.h>
15#include <yarp/os/Semaphore.h>
17
18#include <string>
19#include <vector>
20
22
23#ifdef MSVC
24 #pragma warning(disable:4355)
25#endif
26
79 public yarp::dev::IMotor,
95{
96private:
97 std::vector<std::string> axesNames;
98 mutable RemappedControlBoards remappedControlBoards;
99
101 int controlledJoints{0};
102
104 bool _verb{false};
105
106 // to open ports and print more detailed debug messages
107 std::string partName;
108
109 // Buffer data used to simplify implementation of multi joint methods
111
112 // Buffer data used for full controlboard methods
114
115 // Buffer data for multiple arbitrary joint methods
116 ControlBoardArbitraryAxesDecomposition selectedJointsBuffers;
117
122 void setNrOfControlledAxes(const size_t nrOfControlledAxes);
123
129 bool updateAxesName();
130
134 void configureBuffers();
135
136 // Parse device options
137 bool parseOptions(yarp::os::Property &prop);
138
139 bool usingAxesNamesForAttachAll{false};
140 bool usingNetworksForAttachAll{false};
141
142 /***
143 * Parse device options if networks option is passed
144 *
145 * This will fill the axesNames and controlledJoints attributes, while it
146 * leaves empty the remappedDevices attribute that will be then
147 * filled only at the attachAll method.
148 */
149 bool parseAxesNames(const yarp::os::Property &prop);
150
151 /***
152 * Parse device options if networks option is passed
153 *
154 * This will fill the remappedDevices and controlledJoints attributes, while it
155 * leaves empty the axesNames attribute that will be then
156 * filled only at the attachAll method.
157 */
158 bool parseNetworks(const yarp::os::Property &prop);
159
163 bool attachAllUsingNetworks(const yarp::dev::PolyDriverList &l);
164
168 bool attachAllUsingAxesNames(const yarp::dev::PolyDriverList &l);
169
174 bool setControlModeAllAxes(const int cm);
175
176
177public:
183 ~ControlBoardRemapper() override = default;
184
189 bool verbose() const { return _verb; }
190
195 bool close() override;
196
197
203 bool open(yarp::os::Searchable &prop) override;
204
205 bool detachAll() override;
206
207 bool attachAll(const yarp::dev::PolyDriverList &l) override;
208
209 /* IPidControl */
210 bool setPid(const yarp::dev::PidControlTypeEnum& pidtype,int j, const yarp::dev::Pid &p) override;
211
212 bool setPids(const yarp::dev::PidControlTypeEnum& pidtype,const yarp::dev::Pid *ps) override;
213
214 bool setPidReference(const yarp::dev::PidControlTypeEnum& pidtype,int j, double ref) override;
215
216 bool setPidReferences(const yarp::dev::PidControlTypeEnum& pidtype,const double *refs) override;
217
218 bool setPidErrorLimit(const yarp::dev::PidControlTypeEnum& pidtype,int j, double limit) override;
219
220 bool setPidErrorLimits(const yarp::dev::PidControlTypeEnum& pidtype,const double *limits) override;
221
222 bool getPidError(const yarp::dev::PidControlTypeEnum& pidtype,int j, double *err) override;
223
224 bool getPidErrors(const yarp::dev::PidControlTypeEnum& pidtype,double *errs) override;
225
226 bool getPidOutput(const yarp::dev::PidControlTypeEnum& pidtype,int j, double *out) override;
227
228 bool getPidOutputs(const yarp::dev::PidControlTypeEnum& pidtype,double *outs) override;
229
230 bool setPidOffset(const yarp::dev::PidControlTypeEnum& pidtype,int j, double v) override;
231
232 bool getPid(const yarp::dev::PidControlTypeEnum& pidtype,int j, yarp::dev::Pid *p) override;
233
234 bool getPids(const yarp::dev::PidControlTypeEnum& pidtype,yarp::dev::Pid *pids) override;
235
236 bool getPidReference(const yarp::dev::PidControlTypeEnum& pidtype,int j, double *ref) override;
237
238 bool getPidReferences(const yarp::dev::PidControlTypeEnum& pidtype,double *refs) override;
239
240 bool getPidErrorLimit(const yarp::dev::PidControlTypeEnum& pidtype,int j, double *limit) override;
241
242 bool getPidErrorLimits(const yarp::dev::PidControlTypeEnum& pidtype,double *limits) override;
243
244 bool resetPid(const yarp::dev::PidControlTypeEnum& pidtype,int j) override;
245
246 bool disablePid(const yarp::dev::PidControlTypeEnum& pidtype,int j) override;
247
248 bool enablePid(const yarp::dev::PidControlTypeEnum& pidtype,int j) override;
249
250 bool isPidEnabled(const yarp::dev::PidControlTypeEnum& pidtype, int j, bool* enabled) override;
251
252 /* IPositionControl */
253 bool getAxes(int *ax) override;
254
255 bool positionMove(int j, double ref) override;
256
257 bool positionMove(const double *refs) override;
258
259 bool positionMove(const int n_joints, const int *joints, const double *refs) override;
260
261 bool getTargetPosition(const int joint, double *ref) override;
262
263 bool getTargetPositions(double *refs) override;
264
265 bool getTargetPositions(const int n_joint, const int *joints, double *refs) override;
266
267 bool relativeMove(int j, double delta) override;
268
269 bool relativeMove(const double *deltas) override;
270
271 bool relativeMove(const int n_joints, const int *joints, const double *deltas) override;
272
273 bool checkMotionDone(int j, bool *flag) override;
274
275 bool checkMotionDone(bool *flag) override;
276
277 bool checkMotionDone(const int n_joints, const int *joints, bool *flags) override;
278
279 bool setRefSpeed(int j, double sp) override;
280
281 bool setRefSpeeds(const double *spds) override;
282
283 bool setRefSpeeds(const int n_joints, const int *joints, const double *spds) override;
284
285 bool setRefAcceleration(int j, double acc) override;
286
287 bool setRefAccelerations(const double *accs) override;
288
289 bool setRefAccelerations(const int n_joints, const int *joints, const double *accs) override;
290
291 bool getRefSpeed(int j, double *ref) override;
292
293 bool getRefSpeeds(double *spds) override;
294
295 bool getRefSpeeds(const int n_joints, const int *joints, double *spds) override;
296
297 bool getRefAcceleration(int j, double *acc) override;
298
299 bool getRefAccelerations(double *accs) override;
300
301 bool getRefAccelerations(const int n_joints, const int *joints, double *accs) override;
302
303 bool stop(int j) override;
304
305 bool stop() override;
306
307 bool stop(const int n_joints, const int *joints) override;
308
309 /* IJointFault */
310
311 bool getLastJointFault(int j, int& fault, std::string& message) override;
312
313 /* IVelocityControl */
314 bool velocityMove(int j, double v) override;
315
316 bool velocityMove(const double *v) override;
317
318 /* IEncoders */
319 bool resetEncoder(int j) override;
320
321 bool resetEncoders() override;
322
323 bool setEncoder(int j, double val) override;
324
325 bool setEncoders(const double *vals) override;
326
327 bool getEncoder(int j, double *v) override;
328
329 bool getEncoders(double *encs) override;
330
331 bool getEncodersTimed(double *encs, double *t) override;
332
333 bool getEncoderTimed(int j, double *v, double *t) override;
334
335 bool getEncoderSpeed(int j, double *sp) override;
336
337 bool getEncoderSpeeds(double *spds) override;
338
339 bool getEncoderAcceleration(int j, double *acc) override;
340
341 bool getEncoderAccelerations(double *accs) override;
342
343 /* IMotorEncoders */
344 bool getNumberOfMotorEncoders(int *num) override;
345
346 bool resetMotorEncoder(int m) override;
347
348 bool resetMotorEncoders() override;
349
350 bool setMotorEncoderCountsPerRevolution(int m, const double cpr) override;
351
352 bool getMotorEncoderCountsPerRevolution(int m, double *cpr) override;
353
354 bool setMotorEncoder(int m, const double val) override;
355
356 bool setMotorEncoders(const double *vals) override;
357
358 bool getMotorEncoder(int m, double *v) override;
359
360 bool getMotorEncoders(double *encs) override;
361
362 bool getMotorEncodersTimed(double *encs, double *t) override;
363
364 bool getMotorEncoderTimed(int m, double *v, double *t) override;
365
366 bool getMotorEncoderSpeed(int m, double *sp) override;
367
368 bool getMotorEncoderSpeeds(double *spds) override;
369
370 bool getMotorEncoderAcceleration(int m, double *acc) override;
371
372 bool getMotorEncoderAccelerations(double *accs) override;
373
374 /* IAmplifierControl */
375 bool enableAmp(int j) override;
376
377 bool disableAmp(int j) override;
378
379 bool getAmpStatus(int *st) override;
380
381 bool getAmpStatus(int j, int *v) override;
382
383 bool setMaxCurrent(int j, double v) override;
384
385 bool getMaxCurrent(int j, double *v) override;
386
387 bool getNominalCurrent(int m, double *val) override;
388
389 bool setNominalCurrent(int m, const double val) override;
390
391 bool getPeakCurrent(int m, double *val) override;
392
393 bool setPeakCurrent(int m, const double val) override;
394
395 bool getPWM(int m, double *val) override;
396
397 bool getPWMLimit(int m, double *val) override;
398
399 bool setPWMLimit(int m, const double val) override;
400
401 bool getPowerSupplyVoltage(int m, double *val) override;
402
403 /* IControlLimits */
404 bool setLimits(int j, double min, double max) override;
405
406 bool getLimits(int j, double *min, double *max) override;
407
408 bool setVelLimits(int j, double min, double max) override;
409
410 bool getVelLimits(int j, double *min, double *max) override;
411
412 /* IRemoteVariables */
413
414 bool getRemoteVariable(std::string key, yarp::os::Bottle &val) override;
415
416 bool setRemoteVariable(std::string key, const yarp::os::Bottle &val) override;
417
418 bool getRemoteVariablesList(yarp::os::Bottle *listOfKeys) override;
419
420 /* IRemoteCalibrator */
421
422 bool isCalibratorDevicePresent(bool *isCalib) override;
423
425
426 bool calibrateSingleJoint(int j) override;
427
428 bool calibrateWholePart() override;
429
430 bool homingSingleJoint(int j) override;
431
432 bool homingWholePart() override;
433
434 bool parkSingleJoint(int j, bool _wait = true) override;
435
436 bool parkWholePart() override;
437
438 bool quitCalibrate() override;
439
440 bool quitPark() override;
441
442 /* IControlCalibration */
443
444 bool calibrateAxisWithParams(int j, unsigned int ui, double v1, double v2, double v3) override;
445
446 bool setCalibrationParameters(int j, const yarp::dev::CalibrationParameters &params) override;
447
448 bool calibrationDone(int j) override;
449
450 bool abortPark() override;
451
452 bool abortCalibration() override;
453
454 /* IMotor */
455 bool getNumberOfMotors(int *num) override;
456
457 bool getTemperature(int m, double *val) override;
458
459 bool getTemperatures(double *vals) override;
460
461 bool getTemperatureLimit(int m, double *val) override;
462
463 bool setTemperatureLimit(int m, const double val) override;
464
465 bool getGearboxRatio(int m, double *val) override;
466
467 bool setGearboxRatio(int m, const double val) override;
468
469 /* IAxisInfo */
470 bool getAxisName(int j, std::string &name) override;
471
472 bool getJointType(int j, yarp::dev::JointTypeEnum &type) override;
473
474 bool getRefTorques(double *refs) override;
475
476 bool getRefTorque(int j, double *t) override;
477
478 bool setRefTorques(const double *t) override;
479
480 bool setRefTorque(int j, double t) override;
481
482 bool setRefTorques(const int n_joint, const int *joints, const double *t) override;
483
484 bool getMotorTorqueParams(int j, yarp::dev::MotorTorqueParameters *params) override;
485
486 bool setMotorTorqueParams(int j, const yarp::dev::MotorTorqueParameters params) override;
487
488 bool setImpedance(int j, double stiff, double damp) override;
489
490 bool setImpedanceOffset(int j, double offset) override;
491
492 bool getTorque(int j, double *t) override;
493
494 bool getTorques(double *t) override;
495
496 bool getTorqueRange(int j, double *min, double *max) override;
497
498 bool getTorqueRanges(double *min, double *max) override;
499
500 bool getImpedance(int j, double *stiff, double *damp) override;
501
502 bool getImpedanceOffset(int j, double *offset) override;
503
504 bool getCurrentImpedanceLimit(int j, double *min_stiff, double *max_stiff, double *min_damp, double *max_damp) override;
505
506 bool getControlMode(int j, int *mode) override;
507
508 bool getControlModes(int *modes) override;
509
510 // IControlMode interface
511 bool getControlModes(const int n_joint, const int *joints, int *modes) override;
512
513 bool setControlMode(const int j, const int mode) override;
514
515 bool setControlModes(const int n_joints, const int *joints, int *modes) override;
516
517 bool setControlModes(int *modes) override;
518
519 bool setPosition(int j, double ref) override;
520
521 bool setPositions(const int n_joints, const int *joints, const double *dpos) override;
522
523 bool setPositions(const double *refs) override;
524
525 bool getRefPosition(const int joint, double *ref) override;
526
527 bool getRefPositions(double *refs) override;
528
529 bool getRefPositions(const int n_joint, const int *joints, double *refs) override;
530
532
533 // IVelocityControl interface
534 bool velocityMove(const int n_joints, const int *joints, const double *spds) override;
535
536 bool getRefVelocity(const int joint, double *vel) override;
537
538 bool getRefVelocities(double *vels) override;
539
540 bool getRefVelocities(const int n_joint, const int *joints, double *vels) override;
541
543
544 bool getInteractionModes(int n_joints, int *joints, yarp::dev::InteractionModeEnum *modes) override;
545
547
549
550 bool setInteractionModes(int n_joints, int *joints, yarp::dev::InteractionModeEnum *modes) override;
551
553
554 // IPWMControl
555 bool setRefDutyCycle(int m, double ref) override;
556
557 bool setRefDutyCycles(const double *refs) override;
558
559 bool getRefDutyCycle(int m, double *ref) override;
560
561 bool getRefDutyCycles(double *refs) override;
562
563 bool getDutyCycle(int m, double *val) override;
564
565 bool getDutyCycles(double *vals) override;
566
567 // ICurrentControl
568 bool getCurrent(int m, double *curr) override;
569
570 bool getCurrents(double *currs) override;
571
572 bool getCurrentRange(int m, double *min, double *max) override;
573
574 bool getCurrentRanges(double *min, double *max) override;
575
576 bool setRefCurrents(const double *currs) override;
577
578 bool setRefCurrent(int m, double curr) override;
579
580 bool setRefCurrents(const int n_motor, const int *motors, const double *currs) override;
581
582 bool getRefCurrents(double *currs) override;
583
584 bool getRefCurrent(int m, double *curr) override;
585
586 // IJointBrake
587 yarp::dev::ReturnValue isJointBraked(int j, bool& braked) const override;
588 yarp::dev::ReturnValue setManualBrakeActive(int j, bool active) override;
589 yarp::dev::ReturnValue setAutoBrakeEnabled(int j, bool enabled) override;
590 yarp::dev::ReturnValue getAutoBrakeEnabled(int j, bool& enabled) const override;
591
592 // IVelocityDirect
593 yarp::dev::ReturnValue getAxes(size_t& axes) override;
594 yarp::dev::ReturnValue setDesiredVelocity(int jnt, double vel) override;
595 yarp::dev::ReturnValue setDesiredVelocity(const std::vector<double>& vels) override;
596 yarp::dev::ReturnValue setDesiredVelocity(const std::vector<int>& jnts, const std::vector<double>& vels) override;
597 yarp::dev::ReturnValue getDesiredVelocity(const int jnt, double& vel) override;
598 yarp::dev::ReturnValue getDesiredVelocity(std::vector<double>& vels) override;
599 yarp::dev::ReturnValue getDesiredVelocity(const std::vector<int>& jnts, std::vector<double>& vels) override;
600};
601
602#endif // YARP_DEV_CONTROLBOARDREMAPPER_CONTROLBOARDREMAPPER_H
define control board standard interfaces
FeatureMode mode
Class storing the decomposition of a subset of the total remapped axes of the remapped controlboard i...
controlboardremapper : device that takes a list of axes from multiple controlboards and expose them a...
bool parkWholePart() override
parkWholePart: start the parking procedure for the whole part
bool setImpedance(int j, double stiff, double damp) override
Set current impedance gains (stiffness,damping) for a specific joint.
bool getPidErrorLimit(const yarp::dev::PidControlTypeEnum &pidtype, int j, double *limit) override
Get the error limit for the controller on a specific joint.
bool setRefAccelerations(const double *accs) override
Set reference acceleration on all joints.
bool resetMotorEncoder(int m) override
Reset motor encoder, single motor.
ControlBoardRemapper & operator=(ControlBoardRemapper &&)=delete
bool getTorqueRange(int j, double *min, double *max) override
Get the full scale of the torque sensor of a given joint.
bool getTargetPosition(const int joint, double *ref) override
Get the last position reference for the specified axis.
bool getMotorEncoderCountsPerRevolution(int m, double *cpr) override
Gets number of counts per revolution for motor encoder m.
bool getAmpStatus(int *st) override
bool setTemperatureLimit(int m, const double val) override
Set the temperature limit for a specific motor.
bool setPid(const yarp::dev::PidControlTypeEnum &pidtype, int j, const yarp::dev::Pid &p) override
ControlBoard methods.
bool setRefCurrent(int m, double curr) override
Set the reference value of the current for a single motor.
bool getEncoderSpeeds(double *spds) override
Read the instantaneous speed of all axes.
bool getControlMode(int j, int *mode) override
Get the current control mode.
bool getRefPositions(double *refs) override
Get the last position reference for all axes.
bool setRefSpeed(int j, double sp) override
Set reference speed for a joint, this is the speed used during the interpolation of the trajectory.
bool setNominalCurrent(int m, const double val) override
bool getMotorEncoderTimed(int m, double *v, double *t) override
Read the instantaneous position of a motor encoder.
bool getRefCurrents(double *currs) override
Get the reference value of the currents for all motors.
bool close() override
Close the device driver by deallocating all resources and closing ports.
bool getTorques(double *t) override
Get the value of the torque for all joints (this is the feedback if you have torque sensors).
bool getRemoteVariable(std::string key, yarp::os::Bottle &val) override
ControlBoardRemapper()=default
bool checkMotionDone(int j, bool *flag) override
Check if the current trajectory is terminated.
bool calibrationDone(int j) override
Check if the calibration is terminated, on a particular joint.
bool getCurrentImpedanceLimit(int j, double *min_stiff, double *max_stiff, double *min_damp, double *max_damp) override
Get the current impedandance limits for a specific joint.
bool setPWMLimit(int m, const double val) override
bool getTemperatureLimit(int m, double *val) override
Retreives the current temperature limit for a specific motor.
ControlBoardRemapper & operator=(const ControlBoardRemapper &)=delete
bool getAxes(int *ax) override
Get the number of controlled axes.
bool setPidOffset(const yarp::dev::PidControlTypeEnum &pidtype, int j, double v) override
Set offset value for a given controller.
bool setEncoder(int j, double val) override
Set the value of the encoder for a given joint.
bool setRefAcceleration(int j, double acc) override
Set reference acceleration for a joint.
bool getPid(const yarp::dev::PidControlTypeEnum &pidtype, int j, yarp::dev::Pid *p) override
Get current pid value for a specific joint.
bool getImpedanceOffset(int j, double *offset) override
Get current force Offset for a specific joint.
bool getEncoderSpeed(int j, double *sp) override
Read the istantaneous speed of an axis.
bool getRefSpeed(int j, double *ref) override
Get reference speed for a joint.
bool resetEncoder(int j) override
Reset encoder, single joint.
bool getDutyCycles(double *vals) override
Gets the current dutycycle of the output of the amplifier (i.e.
bool getEncoderAcceleration(int j, double *acc) override
Read the instantaneous acceleration of an axis.
bool setControlModes(const int n_joints, const int *joints, int *modes) override
Set the current control mode for a subset of axes.
bool getEncoderTimed(int j, double *v, double *t) override
Read the instantaneous acceleration of all axes.
bool getImpedance(int j, double *stiff, double *damp) override
Get current impedance gains (stiffness,damping,offset) for a specific joint.
bool getEncoders(double *encs) override
Read the position of all axes.
bool getRefPosition(const int joint, double *ref) override
Get the last position reference for the specified axis.
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 getEncoder(int j, double *v) override
Read the value of an encoder.
bool getMotorEncoder(int m, double *v) override
Read the value of a motor encoder.
bool getTorqueRanges(double *min, double *max) override
Get the full scale of the torque sensors of all joints.
bool getMotorEncodersTimed(double *encs, double *t) override
Read the instantaneous position of all motor encoders.
bool setRefTorque(int j, double t) override
Set the reference value of the torque for a given joint.
bool getNumberOfMotors(int *num) override
Retrieves the number of controlled motors from the current physical interface.
bool disableAmp(int j) override
Disable the amplifier on a specific joint.
bool setInteractionModes(int n_joints, int *joints, yarp::dev::InteractionModeEnum *modes) override
Set the interaction mode of the robot for a set of joints, values can be stiff or compliant.
bool getPeakCurrent(int m, double *val) override
bool setGearboxRatio(int m, const double val) override
Set the gearbox ratio for a specific motor.
bool quitCalibrate() override
quitCalibrate: interrupt the calibration procedure
bool calibrateAxisWithParams(int j, unsigned int ui, double v1, double v2, double v3) override
Start calibration, this method is very often platform specific.
bool getAxisName(int j, std::string &name) override
bool getControlModes(int *modes) override
Get the current control mode (multiple joints).
bool getRefTorques(double *refs) override
Get the reference value of the torque for all joints.
bool getPidReferences(const yarp::dev::PidControlTypeEnum &pidtype, double *refs) override
Get the current reference of all pid controllers.
bool isPidEnabled(const yarp::dev::PidControlTypeEnum &pidtype, int j, bool *enabled) override
Get the current status (enabled/disabled) of the pid.
bool getRefVelocity(const int joint, double *vel) override
Get the last reference speed set by velocityMove for single joint.
bool setPidErrorLimits(const yarp::dev::PidControlTypeEnum &pidtype, const double *limits) override
Get the error limit for the controller on all joints.
bool setRefCurrents(const double *currs) override
Set the reference value of the currents for all motors.
bool setMotorTorqueParams(int j, const yarp::dev::MotorTorqueParameters params) override
Set a subset of motor parameters (bemf, ktau etc) useful for torque control.
bool open(yarp::os::Searchable &prop) override
Open the device driver.
bool setPidErrorLimit(const yarp::dev::PidControlTypeEnum &pidtype, int j, double limit) override
Set the error limit for the controller on a specifi joint.
bool setMaxCurrent(int j, double v) override
yarp::dev::IRemoteCalibrator * getCalibratorDevice() override
getCalibratorDevice: return the pointer stored with the setCalibratorDevice
bool enablePid(const yarp::dev::PidControlTypeEnum &pidtype, int j) override
Enable the pid computation for a joint.
bool calibrateWholePart() override
calibrateWholePart: call the procedure for calibrating the whole device
bool getLimits(int j, double *min, double *max) override
Get the software limits for a particular axis.
bool getRefDutyCycles(double *refs) override
Gets the last reference sent using the setRefDutyCycles function.
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 setRefSpeeds(const double *spds) override
Set reference speed on all joints.
bool getNominalCurrent(int m, double *val) override
bool getRefVelocities(double *vels) override
Get the last reference speed set by velocityMove for all joints.
bool setEncoders(const double *vals) override
Set the value of all encoders.
yarp::dev::ReturnValue isJointBraked(int j, bool &braked) const override
Check is the joint brake is currently active.
bool getInteractionMode(int j, yarp::dev::InteractionModeEnum *mode) override
Get the current interaction mode of the robot, values can be stiff or compliant.
bool setMotorEncoder(int m, const double val) override
Set the value of the motor encoder for a given motor.
~ControlBoardRemapper() override=default
bool getPidErrors(const yarp::dev::PidControlTypeEnum &pidtype, double *errs) override
Get the error of all joints.
bool getPidError(const yarp::dev::PidControlTypeEnum &pidtype, int j, double *err) override
Get the current error for a joint.
bool getPidErrorLimits(const yarp::dev::PidControlTypeEnum &pidtype, double *limits) override
Get the error limit for all controllers.
bool getCurrent(int m, double *curr) override
Get the instantaneous current measurement for a single motor.
bool detachAll() override
Detach the object (you must have first called attach).
bool setPids(const yarp::dev::PidControlTypeEnum &pidtype, const yarp::dev::Pid *ps) override
Set new pid value on multiple axes.
bool parkSingleJoint(int j, bool _wait=true) override
parkSingleJoint(): start the parking procedure for the single joint
bool calibrateSingleJoint(int j) override
calibrateSingleJoint: call the calibration procedure for the single joint
bool getRefTorque(int j, double *t) override
Get the reference value of the torque for a given joint.
bool quitPark() override
quitPark: interrupt the park procedure
bool velocityMove(int j, double v) override
Start motion at a given speed, single joint.
bool getRefDutyCycle(int m, double *ref) override
Gets the last reference sent using the setRefDutyCycle function.
bool getNumberOfMotorEncoders(int *num) override
Get the number of available motor encoders.
bool getPidOutput(const yarp::dev::PidControlTypeEnum &pidtype, int j, double *out) override
Get the output of the controller (e.g.
bool getMotorEncoderAcceleration(int m, double *acc) override
Read the instantaneous acceleration of a motor encoder.
bool setLimits(int j, double min, double max) override
Set the software limits for a particular axis, the behavior of the control card when these limits are...
bool setMotorEncoders(const double *vals) override
Set the value of all motor encoders.
bool getMotorEncoderAccelerations(double *accs) override
Read the instantaneous acceleration of all motor encoders.
bool setPidReferences(const yarp::dev::PidControlTypeEnum &pidtype, const double *refs) override
Set the controller reference, multiple axes.
ControlBoardRemapper(const ControlBoardRemapper &)=delete
bool getTargetPositions(double *refs) override
Get the last position reference for all axes.
bool getPWM(int m, double *val) override
bool setRemoteVariable(std::string key, const yarp::os::Bottle &val) override
bool setImpedanceOffset(int j, double offset) override
Set current force Offset for a specific joint.
bool getPidOutputs(const yarp::dev::PidControlTypeEnum &pidtype, double *outs) override
Get the output of the controllers (e.g.
bool getJointType(int j, yarp::dev::JointTypeEnum &type) override
bool resetEncoders() override
Reset encoders.
bool setRefDutyCycles(const double *refs) override
Sets the reference dutycycle for all the motors.
yarp::os::Stamp getLastInputStamp() override
Return the time stamp relative to the last acquisition.
bool getDutyCycle(int m, double *val) override
Gets the current dutycycle of the output of the amplifier (i.e.
bool getCurrentRanges(double *min, double *max) override
Get the full scale of the current measurements for all motors motor (e.g.
bool attachAll(const yarp::dev::PolyDriverList &l) override
Attach to a list of objects.
bool getMotorTorqueParams(int j, yarp::dev::MotorTorqueParameters *params) override
Get a subset of motor parameters (bemf, ktau etc) useful for torque control.
bool setRefTorques(const double *t) override
Set the reference value of the torque for all joints.
bool getLastJointFault(int j, int &fault, std::string &message) override
bool resetMotorEncoders() override
Reset motor encoders.
yarp::dev::ReturnValue getAutoBrakeEnabled(int j, bool &enabled) const override
checks if the automatic joint brake mode is enabled or disabled.
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 getRefCurrent(int m, double *curr) override
Get the reference value of the current for a single motor.
yarp::dev::ReturnValue setAutoBrakeEnabled(int j, bool enabled) override
Enables/Disables the automatic joint brake.
bool setInteractionMode(int j, yarp::dev::InteractionModeEnum mode) override
Set the interaction mode of the robot, values can be stiff or compliant.
bool getGearboxRatio(int m, double *val) override
Get the gearbox ratio for a specific motor.
bool getVelLimits(int j, double *min, double *max) override
Get the software speed limits for a particular axis.
bool getRefAccelerations(double *accs) override
Get reference acceleration of all joints.
bool enableAmp(int j) override
Enable the amplifier on a specific joint.
ControlBoardRemapper(ControlBoardRemapper &&)=delete
bool positionMove(int j, double ref) override
Set new reference point for a single axis.
bool disablePid(const yarp::dev::PidControlTypeEnum &pidtype, int j) override
Disable the pid computation for a joint.
bool getTemperatures(double *vals) override
Get temperature of all the motors.
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 getCurrentRange(int m, double *min, double *max) override
Get the full scale of the current measurement for a given motor (e.g.
yarp::dev::ReturnValue setDesiredVelocity(int jnt, double vel) override
Set the velocity of single joint.
bool getTemperature(int m, double *val) override
Get temperature of a motor.
bool setControlMode(const int j, const int mode) override
Set the current control mode.
bool getInteractionModes(int n_joints, int *joints, yarp::dev::InteractionModeEnum *modes) override
Get the current interaction mode of the robot for a set of joints, values can be stiff or compliant.
bool verbose() const
Return the value of the verbose flag.
bool isCalibratorDevicePresent(bool *isCalib) override
isCalibratorDevicePresent: check if a calibrator device has been set
bool setMotorEncoderCountsPerRevolution(int m, const double cpr) override
Sets number of counts per revolution for motor encoder m.
bool getPowerSupplyVoltage(int m, double *val) override
bool getMotorEncoders(double *encs) override
Read the position of all motor encoders.
bool setPositions(const int n_joints, const int *joints, const double *dpos) override
Set new reference point for all axes.
bool setCalibrationParameters(int j, const yarp::dev::CalibrationParameters &params) override
Start calibration, this method is very often platform specific.
bool stop() override
Stop motion, multiple joints.
yarp::dev::ReturnValue getDesiredVelocity(const int jnt, double &vel) override
Get the last reference velocity set by setDesiredVelocity() for a single joint.
bool getCurrents(double *currs) override
Get the instantaneous current measurement for all motors.
bool getRemoteVariablesList(yarp::os::Bottle *listOfKeys) override
bool getPWMLimit(int m, double *val) override
bool getEncoderAccelerations(double *accs) override
Read the instantaneous acceleration of all axes.
bool setPeakCurrent(int m, const double val) override
bool homingWholePart() override
homingWholePart: call the homing procedure for a the whole part/device
bool getMotorEncoderSpeed(int m, double *sp) override
Read the istantaneous speed of a motor encoder.
bool homingSingleJoint(int j) override
homingSingleJoint: call the homing procedure for a single joint
bool getRefAcceleration(int j, double *acc) override
Get reference acceleration for a joint.
bool getEncodersTimed(double *encs, double *t) override
Read the instantaneous acceleration of all axes.
bool getRefSpeeds(double *spds) override
Get reference speed of all joints.
bool setRefDutyCycle(int m, double ref) override
Sets the reference dutycycle to a single motor.
bool getMaxCurrent(int j, double *v) override
Returns the maximum electric current allowed for a given motor.
bool setPidReference(const yarp::dev::PidControlTypeEnum &pidtype, int j, double ref) override
Set the controller reference for a given axis.
yarp::dev::ReturnValue setManualBrakeActive(int j, bool active) override
Enables/Disables manually the joint brake.
bool getMotorEncoderSpeeds(double *spds) override
Read the instantaneous speed of all motor encoders.
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 relativeMove(int j, double delta) override
Set relative position.
Class storing the decomposition of all the axes in the Remapped ControlBoard in the SubControlBoard,...
Interface implemented by all device drivers.
Interface for control devices, amplifier commands.
Interface for getting information about specific axes, if available.
Definition IAxisInfo.h:36
Interface for control devices, calibration commands.
Interface for control devices, commands to get/set position and veloity 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 controlling a joint equipped with brakes (hardware or simulated).
Definition IJointBrake.h:23
Interface for getting info about the fault which may occur on a robot.
Definition IJointFault.h:23
Control board, encoder interface.
Control board, encoder interface.
Definition IMotor.h:94
Interface for an object that can wrap/attach to to another.
Interface for controlling an axis, by sending directly a PWM reference signal to a motor.
Definition IPWMControl.h:23
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.
Interface for control boards implementing direct velocity control.
Contains the parameters for a PID.
A simple collection of objects that can be described and transmitted in a portable way.
Definition Bottle.h:65
A class for storing options and configuration information.
Definition Property.h:33
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
PidControlTypeEnum
Definition PidEnums.h:15