iCub-main
iCubSimulationControl.h
Go to the documentation of this file.
1 // -*- mode:C++; tab-width:4; c-basic-offset:4; indent-tabs-mode:nil -*-
2 
3 /*
4 * Copyright (C) 2010 RobotCub Consortium, European Commission FP6 Project IST-004370
5 * Author: Vadim Tikhanoff, Paul Fitzpatrick, Giorgio Metta
6 * email: vadim.tikhanoff@iit.it, paulfitz@alum.mit.edu, giorgio.metta@iit.it
7 * website: www.robotcub.org
8 * Permission is granted to copy, distribute, and/or modify this program
9 * under the terms of the GNU General Public License, version 2 or any
10 * later version published by the Free Software Foundation.
11 *
12 * A copy of the license can be found at
13 * http://www.robotcub.org/icub/license/gpl.txt
14 *
15 * This program is distributed in the hope that it will be useful, but
16 * WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
18 * Public License for more details
19 */
20 
28 #ifndef __iCubSimulationControlh__
29 #define __iCubSimulationControlh__
30 
31 #include <mutex>
32 #include <string>
33 
34 #include <yarp/os/Bottle.h>
35 //#include <yarp/os/PeriodicThread.h>
36 #include <yarp/sig/Image.h>
37 #include <yarp/sig/Matrix.h>
38 #include <yarp/dev/DeviceDriver.h>
39 #include <yarp/dev/PolyDriver.h>
40 #include <yarp/dev/ControlBoardInterfaces.h>
41 #include <yarp/dev/ControlBoardInterfacesImpl.h>
43 
44 #include "LogicalJoints.h"
45 
46 //control mode definitions
47 #define MODE_IDLE 0x00
48 #define MODE_POSITION 0x01
49 #define MODE_VELOCITY 0x02
50 #define MODE_TORQUE 0x03
51 #define MODE_IMPEDANCE_POS 0x04
52 #define MODE_IMPEDANCE_VEL 0x05
53 #define MODE_PWM 0x50
54 #define MODE_CURRENT 0x60
55 #define MODE_MIXED VOCAB_CM_MIXED
56 #define MODE_FORCE_IDLE VOCAB_CM_FORCE_IDLE
57 #define MODE_HW_FAULT VOCAB_CM_HW_FAULT
58 #define MODE_CALIBRATING VOCAB_CM_CALIBRATING
59 #define MODE_CALIB_DONE VOCAB_CM_CALIB_DONE
60 #define MODE_NOT_CONFIGURED VOCAB_CM_NOT_CONFIGURED
61 #define MODE_CONFIGURED VOCAB_CM_CONFIGURED
62 #define MODE_UNKNOWN VOCAB_CM_UNKNOWN
63 
64 // not used
65 //#define MODE_CALIB_ABS_POS_SENS 0x10
66 //#define MODE_CALIB_HARD_STOPS 0x20
67 //#define MODE_HANDLE_HARD_STOPS 0x30
68 //#define MODE_MARGIN_REACHED 0x40
69 //#define MODE_CALIB_ABS_AND_INCREMENTAL 0x41
70 
71 
72 namespace yarp{
73  namespace dev{
74  class iCubSimulationControl;
75  }
76 }
78  public DeviceDriver,
79  //public yarp::os::PeriodicThread,
80  public IPositionControlRaw,
81  public ImplementPositionControl,
82  public IVelocityControlRaw,
83  public ImplementVelocityControl,
84  public ITorqueControlRaw,
85  public ImplementTorqueControl,
86  public IAmplifierControlRaw,
87  public ImplementAmplifierControl,
88  public IControlCalibrationRaw,
89  public ImplementControlCalibration,
90  public IControlLimitsRaw,
91  public ImplementControlLimits,
92  public IControlModeRaw,
93  public ImplementControlMode,
94  public IInteractionModeRaw,
95  public ImplementInteractionMode,
96  public IPidControlRaw,
97  public ImplementPidControl,
98  public IEncodersTimedRaw,
99  public ImplementEncodersTimed,
100  public IMotorEncodersRaw,
101  public ImplementMotorEncoders,
102  public IMotorRaw,
103  public ImplementMotor,
104  public IPositionDirectRaw,
105  public ImplementPositionDirect,
106  public IRemoteVariablesRaw,
107  public ImplementRemoteVariables,
108  public IAxisInfoRaw,
109  public ImplementAxisInfo,
110  public IPWMControlRaw,
111  public ImplementPWMControl,
112  public ICurrentControlRaw,
113  public ImplementCurrentControl
114 {
115  private:
117  void operator=(const iCubSimulationControl&);
118  int ControlModes_yarp2iCubSIM(int yarpMode);
119  int ControlModes_iCubSIM2yarp(int iCubMode);
120 
121  public:
127 
131  virtual ~iCubSimulationControl();
132 
138  virtual bool open(yarp::os::Searchable& config);
139 
140  virtual bool close(void);
141 
142  // IEncoderTimedRaw
143 
144  virtual bool getEncodersTimedRaw(double *encs, double *stamps);
145  virtual bool getEncoderTimedRaw(int j, double *encs, double *stamp);
146 
147 
149  //
150  virtual bool setPidRaw(const PidControlTypeEnum& pidtype, int j, const Pid &pid) override;
151  virtual bool setPidsRaw(const PidControlTypeEnum& pidtype, const Pid *pids) override;
152  virtual bool setPidReferenceRaw(const PidControlTypeEnum& pidtype, int j, double ref) override;
153  virtual bool setPidReferencesRaw(const PidControlTypeEnum& pidtype, const double *refs) override;
154  virtual bool setPidErrorLimitRaw(const PidControlTypeEnum& pidtype, int j, double limit) override;
155  virtual bool setPidErrorLimitsRaw(const PidControlTypeEnum& pidtype, const double *limits) override;
156  virtual bool getPidErrorRaw(const PidControlTypeEnum& pidtype, int j, double *err) override;
157  virtual bool getPidErrorsRaw(const PidControlTypeEnum& pidtype, double *errs) override;
158  virtual bool getPidOutputRaw(const PidControlTypeEnum& pidtype, int j, double *out) override;
159  virtual bool getPidOutputsRaw(const PidControlTypeEnum& pidtype, double *outs) override;
160  virtual bool getPidRaw(const PidControlTypeEnum& pidtype, int j, Pid *pid) override;
161  virtual bool getPidsRaw(const PidControlTypeEnum& pidtype, Pid *pids) override;
162  virtual bool getPidReferenceRaw(const PidControlTypeEnum& pidtype, int j, double *ref) override;
163  virtual bool getPidReferencesRaw(const PidControlTypeEnum& pidtype, double *refs) override;
164  virtual bool getPidErrorLimitRaw(const PidControlTypeEnum& pidtype, int j, double *limit) override;
165  virtual bool getPidErrorLimitsRaw(const PidControlTypeEnum& pidtype, double *limits) override;
166  virtual bool resetPidRaw(const PidControlTypeEnum& pidtype, int j) override;
167  virtual bool disablePidRaw(const PidControlTypeEnum& pidtype, int j) override;
168  virtual bool enablePidRaw(const PidControlTypeEnum& pidtype, int j) override;
169  virtual bool setPidOffsetRaw(const PidControlTypeEnum& pidtype, int j, double v) override;
170  virtual bool isPidEnabledRaw(const PidControlTypeEnum& pidtype, int j, bool* enabled) override;
171  //
173 
175  virtual bool getAxes(int *ax) override;
176  virtual bool positionMoveRaw(int j, double ref) override;
177  virtual bool positionMoveRaw(const double *refs) override;
178  virtual bool relativeMoveRaw(int j, double delta) override;
179  virtual bool relativeMoveRaw(const double *deltas) override;
180  virtual bool checkMotionDoneRaw(bool *flag) override;
181  virtual bool checkMotionDoneRaw(int j, bool *flag) override;
182  virtual bool setRefSpeedRaw(int j, double sp) override;
183  virtual bool setRefSpeedsRaw(const double *spds) override;
184  virtual bool setRefAccelerationRaw(int j, double acc) override;
185  virtual bool setRefAccelerationsRaw(const double *accs) override;
186  virtual bool getRefSpeedRaw(int j, double *ref) override;
187  virtual bool getRefSpeedsRaw(double *spds) override;
188  virtual bool getRefAccelerationRaw(int j, double *acc) override;
189  virtual bool getRefAccelerationsRaw(double *accs) override;
190  virtual bool stopRaw(int j) override;
191  virtual bool stopRaw() override;
192 
193  // Position Control2 Interface
194  virtual bool positionMoveRaw(const int n_joint, const int *joints, const double *refs) override;
195  virtual bool relativeMoveRaw(const int n_joint, const int *joints, const double *deltas) override;
196  virtual bool checkMotionDoneRaw(const int n_joint, const int *joints, bool *flags) override;
197  virtual bool setRefSpeedsRaw(const int n_joint, const int *joints, const double *spds) override;
198  virtual bool setRefAccelerationsRaw(const int n_joint, const int *joints, const double *accs) override;
199  virtual bool getRefSpeedsRaw(const int n_joint, const int *joints, double *spds) override;
200  virtual bool getRefAccelerationsRaw(const int n_joint, const int *joints, double *accs) override;
201  virtual bool stopRaw(const int n_joint, const int *joints) override;
202  virtual bool getTargetPositionRaw(const int joint, double *ref) override;
203  virtual bool getTargetPositionsRaw(double *refs) override;
204  virtual bool getTargetPositionsRaw(const int n_joint, const int *joints, double *refs) override;
205 
206  // Velocity Control
207  virtual bool velocityMoveRaw(int j, double sp) override;
208  virtual bool velocityMoveRaw(const double *sp) override;
209 
210  // Velocity Control2 Interface
211  virtual bool velocityMoveRaw(const int n_joint, const int *joints, const double *spds) override;
212  virtual bool getRefVelocityRaw(const int joint, double *ref) override;
213  virtual bool getRefVelocitiesRaw(double *refs) override;
214  virtual bool getRefVelocitiesRaw(const int n_joint, const int *joints, double *refs) override;
215 
216 
218  //
219  virtual bool resetEncoderRaw(int j) override;
220  virtual bool resetEncodersRaw() override;
221  virtual bool setEncoderRaw(int j, double val) override;
222  virtual bool setEncodersRaw(const double *vals) override;
223  virtual bool getEncoderRaw(int j, double *v) override;
224  virtual bool getEncodersRaw(double *encs) override;
225  virtual bool getEncoderSpeedRaw(int j, double *sp) override;
226  virtual bool getEncoderSpeedsRaw(double *spds) override;
227  virtual bool getEncoderAccelerationRaw(int j, double *spds) override;
228  virtual bool getEncoderAccelerationsRaw(double *accs) override;
229 
231 
233  //
234  virtual bool getRemoteVariableRaw(std::string key, yarp::os::Bottle& val) override;
235  virtual bool setRemoteVariableRaw(std::string key, const yarp::os::Bottle& val) override;
236  virtual bool getRemoteVariablesListRaw(yarp::os::Bottle* listOfKeys) override;
237 
239 
241  //
242  virtual bool getNumberOfMotorEncodersRaw(int* num) override;
243  virtual bool resetMotorEncoderRaw(int m) override;
244  virtual bool resetMotorEncodersRaw() override;
245  virtual bool setMotorEncoderRaw(int m, const double val) override;
246  virtual bool setMotorEncodersRaw(const double *vals) override;
247  virtual bool getMotorEncoderRaw(int m, double *v) override;
248  virtual bool setMotorEncoderCountsPerRevolutionRaw(int m, const double cpr) override;
249  virtual bool getMotorEncoderCountsPerRevolutionRaw(int m, double *cpr) override;
250  virtual bool getMotorEncodersRaw(double *encs) override;
251  virtual bool getMotorEncoderSpeedRaw(int m, double *sp) override;
252  virtual bool getMotorEncoderSpeedsRaw(double *spds) override;
253  virtual bool getMotorEncoderAccelerationRaw(int m, double *spds) override;
254  virtual bool getMotorEncoderAccelerationsRaw(double *accs) override;
255  virtual bool getMotorEncodersTimedRaw(double *encs, double *stamps) override;
256  virtual bool getMotorEncoderTimedRaw(int m, double *encs, double *stamp) override;
257 
260  //
261  virtual bool enableAmpRaw(int j) override;
262  virtual bool disableAmpRaw(int j) override;
263  virtual bool getCurrentsRaw(double *vals) override;
264  virtual bool getCurrentRaw(int j, double *val) override;
265  virtual bool setMaxCurrentRaw(int j, double val) override;
266  virtual bool getMaxCurrentRaw(int j, double* val) override;
267  virtual bool getAmpStatusRaw(int *st) override;
268  virtual bool getAmpStatusRaw(int k, int *st) override;
269  virtual bool getPWMRaw(int j, double* val) override;
270  virtual bool getPWMLimitRaw(int j, double* val) override;
271  virtual bool setPWMLimitRaw(int j, const double val) override;
272  virtual bool getPowerSupplyVoltageRaw(int j, double* val) override;
273  //
275 
277  virtual bool calibrateAxisWithParamsRaw(int axis, unsigned int type, double p1, double p2, double p3) override;
278  virtual bool calibrationDoneRaw(int j) override;
279 
281  virtual bool setLimitsRaw(int axis, double min, double max) override;
282  virtual bool getLimitsRaw(int axis, double *min, double *max) override;
283  virtual bool setVelLimitsRaw(int axis, double min, double max) override;
284  virtual bool getVelLimitsRaw(int axis, double *min, double *max) override;
285 
287  virtual bool getAxisNameRaw(int axis, std::string& name) override;
288  virtual bool getJointTypeRaw(int axis, yarp::dev::JointTypeEnum& type) override;
289 
291  virtual bool getNumberOfMotorsRaw(int* m) override;
292  virtual bool getTemperatureRaw(int m, double* val) override;
293  virtual bool getTemperaturesRaw(double *vals) override;
294  virtual bool getTemperatureLimitRaw(int m, double *temp) override;
295  virtual bool setTemperatureLimitRaw(int m, const double temp) override;
296  virtual bool getPeakCurrentRaw(int m, double *val) override;
297  virtual bool setPeakCurrentRaw(int m, const double val) override;
298  virtual bool getNominalCurrentRaw(int m, double *val) override;
299  virtual bool setNominalCurrentRaw(int m, const double val) override;
300 
302  virtual bool getTorqueRaw(int, double *) override;
303  virtual bool getTorquesRaw(double *) override;
304  virtual bool getTorqueRangeRaw(int,double *,double *) override;
305  virtual bool getTorqueRangesRaw(double *,double *) override;
306  virtual bool setRefTorquesRaw(const double *) override;
307  virtual bool setRefTorqueRaw(int,double) override;
308  virtual bool setRefTorquesRaw(const int n_joint, const int *joints, const double *t) override;
309  virtual bool getRefTorquesRaw(double *) override;
310  virtual bool getRefTorqueRaw(int,double *) override;
311  virtual bool getMotorTorqueParamsRaw(int j, MotorTorqueParameters *params) override;
312  virtual bool setMotorTorqueParamsRaw(int j, const MotorTorqueParameters params) override;
313 
315  virtual bool getControlModeRaw(int j, int *mode) override;
316  virtual bool getControlModesRaw(int* modes) override;
317 
319  virtual bool getControlModesRaw(const int n_joint, const int *joints, int *modes) override;
320  virtual bool setControlModeRaw(const int j, const int mode) override;
321  virtual bool setControlModesRaw(const int n_joint, const int *joints, int *modes) override;
322  virtual bool setControlModesRaw(int *modes) override;
323 
324 
326  virtual bool getInteractionModeRaw(int axis, yarp::dev::InteractionModeEnum* mode) override;
327  virtual bool getInteractionModesRaw(int n_joints, int *joints, yarp::dev::InteractionModeEnum* modes) override;
328  virtual bool getInteractionModesRaw(yarp::dev::InteractionModeEnum* modes) override;
329  virtual bool setInteractionModeRaw(int axis, yarp::dev::InteractionModeEnum mode) override;
330  virtual bool setInteractionModesRaw(int n_joints, int *joints, yarp::dev::InteractionModeEnum* modes) override;
331  virtual bool setInteractionModesRaw(yarp::dev::InteractionModeEnum* modes) override;
332 
334  virtual bool setPositionRaw(int j, double ref) override;
335  virtual bool setPositionsRaw(const int n_joint, const int *joints, const double *refs) override;
336  virtual bool setPositionsRaw(const double *refs) override;
337  virtual bool getRefPositionRaw(const int joint, double *ref) override;
338  virtual bool getRefPositionsRaw(double *refs) override;
339  virtual bool getRefPositionsRaw(const int n_joint, const int *joints, double *refs) override;
340 
342  virtual bool setRefDutyCycleRaw(int j, double v) override;
343  virtual bool setRefDutyCyclesRaw(const double *v) override;
344  virtual bool getRefDutyCycleRaw(int j, double *v) override;
345  virtual bool getRefDutyCyclesRaw(double *v) override;
346  virtual bool getDutyCycleRaw(int j, double *v) override;
347  virtual bool getDutyCyclesRaw(double *v) override;
348 
350  // virtual bool getAxes(int *ax) override;
351  //virtual bool getCurrentRaw(int j, double *t) override;
352  //virtual bool getCurrentsRaw(double *t) override;
353  virtual bool getCurrentRangeRaw(int j, double *min, double *max) override;
354  virtual bool getCurrentRangesRaw(double *min, double *max) override;
355  virtual bool setRefCurrentsRaw(const double *t) override;
356  virtual bool setRefCurrentRaw(int j, double t) override;
357  virtual bool setRefCurrentsRaw(const int n_joint, const int *joints, const double *t) override;
358  virtual bool getRefCurrentsRaw(double *t) override;
359  virtual bool getRefCurrentRaw(int j, double *t) override;
360 
361 //void run(void);
362 
364  void jointStep();
365 
367 
368 private:
369  void compute_mot_pos_from_jnt_pos(double *mot_pos, const double *jnt_pos, int size_joints);
370  void compute_mot_vel_and_acc (double *mot_vel, double *mot_acc, const double *mot_pos, int size_joints);
371  void compute_jnt_vel_and_acc (double *jnt_vel, double *jnt_acc, const double *jnt_pos, int size_joints);
372 
373 protected:
374  yarp::dev::PolyDriver joints;
376 
377  std::mutex _mutex;
378 
380  bool _noreply;
381  bool _opened;
382 
383  //current position of the joints
386 
387  //torque of the joints
388  double *current_jnt_torques; // at the moment this is fake
389  double *current_mot_torques; // at the moment this is fake
390 
391  //pwm value
392  double *pwm; // at the moment this is fake
393  double *pwm_ref; // at the moment this is fake
394 
395  //motor current
396  double *current_ampere; // at the moment this is fake
397  double *current_ampere_ref; // at the moment this is fake
398 
399  //current velocity of the joints
404 
405  //current acceleration of the joints
414 
415  //next position of the joints
416  double *next_pos;
418  double *ref_positions;
419 
420  //next velocity of the joints during velocity control
421  double *next_vel;
423  double *ref_speeds;
424 
425  //next torques of the joints during torque control
426  double *next_torques;
427  double *ref_torques;
428 
429  //semaphore access for synch with run function of webots
431 
433  // number of joints/axes/controlled motors
434  int njoints;
435 
436  // velocity
437  double vel;
438 
439  //rate at which the position are updated im ms
440  //int positionUpdateRate;
441  static const int positionUpdateRate = 100;
442 
443  //axis remapping lookup-table
444  int *axisMap;
445  // angle to encoder conversion factors
446  double *angleToEncoder;
447 
448  double *zeros;
450  double *ampsToSensor;
451  double *dutycycleToPwm;
452 
453  double *error_tol;
454 
455  bool *motor_on;
456  int *motor;
457  double ErrorPos[100];
458  int input;
459  int *inputs; /* in fact we need an "input" flag for every joint */
460  double *vels; /* in fact we need a velocity for every joint */
461 
462  double *limitsMin; // joint limits, min
463  double *limitsMax; // joint limits, max
464  double *velLimitsMin; // joint vel limits, min
465  double *velLimitsMax; // joint vel limits, max
466  double *torqueLimits; // torque limits
467  double *maxCurrent; // max motor current (simulated)
468  double *rotToEncoder; // angle to rotor conversion factors
469  double *gearbox; // the gearbox ratio
470  double *refSpeed;
471  double *refAccel;
472  double *controlP;
478 
481 
486  MotorTorqueParameters *motor_torque_params;
487  yarp::sig::Matrix kinematic_mj;
488 
489  //bool velocityMode;
490 };
491 
492 #endif
493 
494 
virtual bool getTorqueRangesRaw(double *, double *) override
virtual bool getEncodersRaw(double *encs) override
virtual bool getLimitsRaw(int axis, double *min, double *max) override
virtual bool getPeakCurrentRaw(int m, double *val) override
virtual bool resetMotorEncodersRaw() override
virtual bool getCurrentRangesRaw(double *min, double *max) override
virtual bool setInteractionModesRaw(int n_joints, int *joints, yarp::dev::InteractionModeEnum *modes) override
virtual bool setPidReferencesRaw(const PidControlTypeEnum &pidtype, const double *refs) override
virtual bool getMotorEncoderSpeedRaw(int m, double *sp) override
virtual bool velocityMoveRaw(int j, double sp) override
for each axis
virtual bool getTorqueRaw(int, double *) override
virtual bool getMotorTorqueParamsRaw(int j, MotorTorqueParameters *params) override
virtual bool setRefCurrentsRaw(const double *t) override
virtual bool setRefDutyCycleRaw(int j, double v) override
virtual bool getMotorEncoderAccelerationRaw(int m, double *spds) override
virtual bool getEncoderAccelerationRaw(int j, double *spds) override
iCub::ctrl::AWQuadEstimator * quadEstJnt
virtual bool getPidRaw(const PidControlTypeEnum &pidtype, int j, Pid *pid) override
virtual bool getPidReferencesRaw(const PidControlTypeEnum &pidtype, double *refs) override
virtual bool setEncoderRaw(int j, double val) override
virtual bool relativeMoveRaw(int j, double delta) override
virtual bool getPidsRaw(const PidControlTypeEnum &pidtype, Pid *pids) override
virtual bool getPidOutputRaw(const PidControlTypeEnum &pidtype, int j, double *out) override
virtual bool getPWMLimitRaw(int j, double *val) override
virtual bool getRefPositionsRaw(double *refs) override
out
Definition: sine.m:8
virtual bool setMotorTorqueParamsRaw(int j, const MotorTorqueParameters params) override
virtual bool getPidErrorRaw(const PidControlTypeEnum &pidtype, int j, double *err) override
virtual bool setMotorEncoderCountsPerRevolutionRaw(int m, const double cpr) override
virtual bool getDutyCycleRaw(int j, double *v) override
virtual bool setMotorEncoderRaw(int m, const double val) override
virtual bool setRefAccelerationsRaw(const double *accs) override
virtual bool getRefTorquesRaw(double *) override
MotorTorqueParameters * motor_torque_params
virtual bool setPidRaw(const PidControlTypeEnum &pidtype, int j, const Pid &pid) override
virtual bool setControlModesRaw(const int n_joint, const int *joints, int *modes) override
virtual bool getCurrentsRaw(double *vals) override
virtual bool getCurrentRangeRaw(int j, double *min, double *max) override
virtual bool setInteractionModeRaw(int axis, yarp::dev::InteractionModeEnum mode) override
virtual bool getRefTorqueRaw(int, double *) override
virtual bool getAxes(int *ax) override
POSITION CONTROL INTERFACE RAW.
virtual bool getMotorEncoderCountsPerRevolutionRaw(int m, double *cpr) override
virtual bool isPidEnabledRaw(const PidControlTypeEnum &pidtype, int j, bool *enabled) override
virtual bool getPWMRaw(int j, double *val) override
virtual bool setPidErrorLimitsRaw(const PidControlTypeEnum &pidtype, const double *limits) override
virtual bool getRefSpeedsRaw(double *spds) override
virtual bool checkMotionDoneRaw(bool *flag) override
virtual bool resetMotorEncoderRaw(int m) override
virtual bool getRefDutyCyclesRaw(double *v) override
virtual bool getTemperatureLimitRaw(int m, double *temp) override
virtual bool getControlModeRaw(int j, int *mode) override
virtual bool getRefVelocitiesRaw(double *refs) override
virtual bool setPidsRaw(const PidControlTypeEnum &pidtype, const Pid *pids) override
virtual bool getMotorEncodersRaw(double *encs) override
virtual bool getRefSpeedRaw(int j, double *ref) override
Copyright (C) 2008 RobotCub Consortium.
virtual bool getTorqueRangeRaw(int, double *, double *) override
virtual bool getEncodersTimedRaw(double *encs, double *stamps)
virtual bool getVelLimitsRaw(int axis, double *min, double *max) override
virtual bool setRefTorquesRaw(const double *) override
virtual bool getMotorEncoderTimedRaw(int m, double *encs, double *stamp) override
virtual bool setEncodersRaw(const double *vals) override
iCub::ctrl::AWQuadEstimator * quadEstMot
virtual bool getMotorEncoderRaw(int m, double *v) override
virtual bool resetEncoderRaw(int j) override
const FSC max
Definition: strain.h:48
virtual bool getEncoderSpeedsRaw(double *spds) override
virtual bool getRefPositionRaw(const int joint, double *ref) override
virtual bool setPositionRaw(int j, double ref) override
virtual bool getAxisNameRaw(int axis, std::string &name) override
static int v
Definition: iCub_Sim.cpp:42
_3f_vect_t acc
Definition: dataTypes.h:123
virtual bool setRefAccelerationRaw(int j, double acc) override
virtual bool getJointTypeRaw(int axis, yarp::dev::JointTypeEnum &type) override
virtual bool setRefDutyCyclesRaw(const double *v) override
virtual bool setRefSpeedsRaw(const double *spds) override
iCub::ctrl::AWLinEstimator * linEstMot
virtual bool setMaxCurrentRaw(int j, double val) override
virtual bool getTorquesRaw(double *) override
const FSC min
Definition: strain.h:49
virtual bool getMaxCurrentRaw(int j, double *val) override
Route control for the robots controlled joints to their implementation.
Definition: LogicalJoints.h:31
iCubSimulationControl()
Default constructor.
virtual bool enableAmpRaw(int j) override
virtual bool getPidOutputsRaw(const PidControlTypeEnum &pidtype, double *outs) override
virtual bool getRemoteVariableRaw(std::string key, yarp::os::Bottle &val) override
virtual bool getRemoteVariablesListRaw(yarp::os::Bottle *listOfKeys) override
virtual bool getPidErrorLimitRaw(const PidControlTypeEnum &pidtype, int j, double *limit) override
virtual bool calibrationDoneRaw(int j) override
virtual bool getTargetPositionsRaw(double *refs) override
virtual bool getTemperatureRaw(int m, double *val) override
virtual bool setLimitsRaw(int axis, double min, double max) override
virtual bool getRefCurrentsRaw(double *t) override
virtual bool getInteractionModesRaw(int n_joints, int *joints, yarp::dev::InteractionModeEnum *modes) override
virtual bool setNominalCurrentRaw(int m, const double val) override
virtual bool getInteractionModeRaw(int axis, yarp::dev::InteractionModeEnum *mode) override
virtual bool getRefAccelerationRaw(int j, double *acc) override
virtual bool getNumberOfMotorEncodersRaw(int *num) override
virtual bool getNominalCurrentRaw(int m, double *val) override
virtual bool getNumberOfMotorsRaw(int *m) override
IMotor.
virtual bool resetPidRaw(const PidControlTypeEnum &pidtype, int j) override
virtual bool setRemoteVariableRaw(std::string key, const yarp::os::Bottle &val) override
virtual bool getPowerSupplyVoltageRaw(int j, double *val) override
virtual bool setPidErrorLimitRaw(const PidControlTypeEnum &pidtype, int j, double limit) override
iCub::ctrl::AWLinEstimator * linEstJnt
virtual bool getEncoderSpeedRaw(int j, double *sp) override
virtual bool getTargetPositionRaw(const int joint, double *ref) override
virtual bool setPWMLimitRaw(int j, const double val) override
Adaptive window linear fitting to estimate the first derivative.
virtual bool setRefSpeedRaw(int j, double sp) override
virtual bool getAmpStatusRaw(int *st) override
virtual bool getDutyCyclesRaw(double *v) override
virtual bool getPidErrorLimitsRaw(const PidControlTypeEnum &pidtype, double *limits) override
virtual bool getRefVelocityRaw(const int joint, double *ref) override
virtual bool setVelLimitsRaw(int axis, double min, double max) override
virtual bool setPidOffsetRaw(const PidControlTypeEnum &pidtype, int j, double v) override
virtual bool setRefCurrentRaw(int j, double t) override
virtual bool getRefCurrentRaw(int j, double *t) override
virtual bool getControlModesRaw(int *modes) override
virtual bool getPidErrorsRaw(const PidControlTypeEnum &pidtype, double *errs) override
Adaptive window quadratic fitting to estimate the second derivative.
virtual bool enablePidRaw(const PidControlTypeEnum &pidtype, int j) override
virtual bool setRefTorqueRaw(int, double) override
virtual bool getRefDutyCycleRaw(int j, double *v) override
virtual ~iCubSimulationControl()
Destructor.
virtual bool setMotorEncodersRaw(const double *vals) override
virtual bool setPositionsRaw(const int n_joint, const int *joints, const double *refs) override
virtual bool setTemperatureLimitRaw(int m, const double temp) override
virtual bool setPeakCurrentRaw(int m, const double val) override
virtual bool setControlModeRaw(const int j, const int mode) override
virtual bool getRefAccelerationsRaw(double *accs) override
virtual bool getMotorEncodersTimedRaw(double *encs, double *stamps) override
virtual bool getTemperaturesRaw(double *vals) override
virtual bool positionMoveRaw(int j, double ref) override
GLenum mode
Definition: rendering.cpp:48
virtual bool open(yarp::os::Searchable &config)
Open the device driver and start communication with the hardware.
virtual bool getCurrentRaw(int j, double *val) override
virtual bool getPidReferenceRaw(const PidControlTypeEnum &pidtype, int j, double *ref) override
virtual bool getEncoderRaw(int j, double *v) override
virtual bool disablePidRaw(const PidControlTypeEnum &pidtype, int j) override
virtual bool getMotorEncoderAccelerationsRaw(double *accs) override
virtual bool getEncoderTimedRaw(int j, double *encs, double *stamp)
virtual bool disableAmpRaw(int j) override
virtual bool calibrateAxisWithParamsRaw(int axis, unsigned int type, double p1, double p2, double p3) override
virtual bool getEncoderAccelerationsRaw(double *accs) override
virtual bool setPidReferenceRaw(const PidControlTypeEnum &pidtype, int j, double ref) override
cmd is a SingleAxis pointer with 1 double arg
virtual bool getMotorEncoderSpeedsRaw(double *spds) override