|
YARP
Yet Another Robot Platform
|
|
Go to the documentation of this file.
31 #define NEW_JSTATUS_STRUCT 1
32 #define VELOCITY_WATCHDOG 0.1
33 #define OPENLOOP_WATCHDOG 0.1
34 #define PWM_CONSTANT 0.1
42 for (
int i=0;i <_njoints ;i++)
47 if (this->_command_speeds[i]!=0)
50 double increment = _command_speeds[i]*elapsed;
57 this->_command_speeds[i]=0.0;
63 if (this->refpwm[i]!=0)
78 pos[i] = _posDir_references[i];
82 pos[i] = _posCtrl_references[i];
104 yCError(FAKEMOTIONCONTROL) << txt <<
"is not yet implemented for FakeMotionControl";
110 yCError(FAKEMOTIONCONTROL) << txt <<
"has been deprecated for FakeMotionControl";
123 std::ostringstream oss;
130 bool FakeMotionControl::extractGroup(
Bottle &input,
Bottle &out,
const std::string &key1,
const std::string &txt,
int size)
137 yCError(FAKEMOTIONCONTROL) << key1.c_str() <<
"parameter not found";
141 if(tmp.
size()!=(
size_t) size)
143 yCError(FAKEMOTIONCONTROL) << key1.c_str() <<
"incorrect number of entries";
153 pos.resize(_njoints);
154 dpos.resize(_njoints);
155 vel.resize(_njoints);
156 speed.resize(_njoints);
157 acc.resize(_njoints);
158 loc.resize(_njoints);
159 amp.resize(_njoints);
161 current.resize(_njoints);
162 nominalCurrent.resize(_njoints);
163 maxCurrent.resize(_njoints);
164 peakCurrent.resize(_njoints);
165 pwm.resize(_njoints);
166 refpwm.resize(_njoints);
167 pwmLimit.resize(_njoints);
168 supplyVoltage.resize(_njoints);
169 last_velocity_command.resize(_njoints);
170 last_pwm_command.resize(_njoints);
181 nominalCurrent.zero();
188 supplyVoltage.zero();
193 _axisMap = allocAndCheck<int>(nj);
194 _controlModes = allocAndCheck<int>(nj);
195 _interactMode = allocAndCheck<int>(nj);
196 _angleToEncoder = allocAndCheck<double>(nj);
197 _dutycycleToPWM = allocAndCheck<double>(nj);
198 _ampsToSensor = allocAndCheck<double>(nj);
199 _encodersStamp = allocAndCheck<double>(nj);
200 _DEPRECATED_encoderconversionoffset = allocAndCheck<float>(nj);
201 _DEPRECATED_encoderconversionfactor = allocAndCheck<float>(nj);
204 _jointEncoderRes = allocAndCheck<int>(nj);
205 _rotorEncoderRes = allocAndCheck<int>(nj);
206 _gearbox = allocAndCheck<double>(nj);
207 _torqueSensorId= allocAndCheck<int>(nj);
208 _torqueSensorChan= allocAndCheck<int>(nj);
209 _maxTorque=allocAndCheck<double>(nj);
210 _torques = allocAndCheck<double>(nj);
211 _maxJntCmdVelocity = allocAndCheck<double>(nj);
212 _maxMotorVelocity = allocAndCheck<double>(nj);
213 _newtonsToSensor=allocAndCheck<double>(nj);
214 _hasHallSensor = allocAndCheck<bool>(nj);
215 _hasTempSensor = allocAndCheck<bool>(nj);
216 _hasRotorEncoder = allocAndCheck<bool>(nj);
217 _hasRotorEncoderIndex = allocAndCheck<bool>(nj);
218 _rotorIndexOffset = allocAndCheck<int>(nj);
219 _motorPoles = allocAndCheck<int>(nj);
220 _rotorlimits_max = allocAndCheck<double>(nj);
221 _rotorlimits_min = allocAndCheck<double>(nj);
223 _ppids=allocAndCheck<Pid>(nj);
224 _tpids=allocAndCheck<Pid>(nj);
225 _cpids = allocAndCheck<Pid>(nj);
226 _vpids = allocAndCheck<Pid>(nj);
227 _ppids_ena=allocAndCheck<bool>(nj);
228 _tpids_ena=allocAndCheck<bool>(nj);
229 _cpids_ena = allocAndCheck<bool>(nj);
230 _vpids_ena = allocAndCheck<bool>(nj);
231 _ppids_lim=allocAndCheck<double>(nj);
232 _tpids_lim=allocAndCheck<double>(nj);
233 _cpids_lim = allocAndCheck<double>(nj);
234 _vpids_lim = allocAndCheck<double>(nj);
235 _ppids_ref=allocAndCheck<double>(nj);
236 _tpids_ref=allocAndCheck<double>(nj);
237 _cpids_ref = allocAndCheck<double>(nj);
238 _vpids_ref = allocAndCheck<double>(nj);
242 _axisName =
new string[nj];
245 _limitsMax=allocAndCheck<double>(nj);
246 _limitsMin=allocAndCheck<double>(nj);
247 _kinematic_mj=allocAndCheck<double>(16);
249 _motorPwmLimits=allocAndCheck<double>(nj);
250 checking_motiondone=allocAndCheck<bool>(nj);
252 _velocityShifts=allocAndCheck<int>(nj);
253 _velocityTimeout=allocAndCheck<int>(nj);
254 _kbemf=allocAndCheck<double>(nj);
255 _ktau=allocAndCheck<double>(nj);
256 _kbemf_scale = allocAndCheck<int>(nj);
257 _ktau_scale = allocAndCheck<int>(nj);
258 _filterType=allocAndCheck<int>(nj);
259 _last_position_move_time=allocAndCheck<double>(nj);
262 _posCtrl_references = allocAndCheck<double>(nj);
263 _posDir_references = allocAndCheck<double>(nj);
264 _command_speeds = allocAndCheck<double>(nj);
265 _ref_speeds = allocAndCheck<double>(nj);
266 _ref_accs = allocAndCheck<double>(nj);
267 _ref_torques = allocAndCheck<double>(nj);
268 _ref_currents = allocAndCheck<double>(nj);
269 _enabledAmp = allocAndCheck<bool>(nj);
270 _enabledPid = allocAndCheck<bool>(nj);
271 _calibrated = allocAndCheck<bool>(nj);
279 bool FakeMotionControl::dealloc()
381 _angleToEncoder(nullptr),
382 _encodersStamp (nullptr),
383 _ampsToSensor (nullptr),
384 _dutycycleToPWM(nullptr),
385 _DEPRECATED_encoderconversionfactor (nullptr),
386 _DEPRECATED_encoderconversionoffset (nullptr),
387 _jointEncoderRes (nullptr),
388 _rotorEncoderRes (nullptr),
390 _hasHallSensor (nullptr),
391 _hasTempSensor (nullptr),
392 _hasRotorEncoder (nullptr),
393 _hasRotorEncoderIndex (nullptr),
394 _rotorIndexOffset (nullptr),
395 _motorPoles (nullptr),
396 _rotorlimits_max (nullptr),
397 _rotorlimits_min (nullptr),
402 _ppids_ena (nullptr),
403 _tpids_ena (nullptr),
404 _cpids_ena (nullptr),
405 _vpids_ena (nullptr),
406 _ppids_lim (nullptr),
407 _tpids_lim (nullptr),
408 _cpids_lim (nullptr),
409 _vpids_lim (nullptr),
410 _ppids_ref (nullptr),
411 _tpids_ref (nullptr),
412 _cpids_ref (nullptr),
413 _vpids_ref (nullptr),
415 _jointType (nullptr),
416 _limitsMin (nullptr),
417 _limitsMax (nullptr),
418 _kinematic_mj (nullptr),
419 _maxJntCmdVelocity (nullptr),
420 _maxMotorVelocity (nullptr),
421 _velocityShifts (nullptr),
422 _velocityTimeout (nullptr),
425 _kbemf_scale (nullptr),
426 _ktau_scale (nullptr),
427 _filterType (nullptr),
428 _torqueSensorId (nullptr),
429 _torqueSensorChan (nullptr),
430 _maxTorque (nullptr),
431 _newtonsToSensor (nullptr),
432 checking_motiondone (nullptr),
433 _last_position_move_time(nullptr),
434 _motorPwmLimits (nullptr),
436 useRawEncoderData (false),
437 _pwmIsLimited (false),
438 _torqueControlEnabled (false),
439 _torqueControlUnits (T_MACHINE_UNITS),
440 _positionControlUnits (P_MACHINE_UNITS),
441 _controlModes (nullptr),
442 _interactMode (nullptr),
443 _enabledAmp (nullptr),
444 _enabledPid (nullptr),
445 _calibrated (nullptr),
446 _posCtrl_references (nullptr),
447 _posDir_references (nullptr),
448 _ref_speeds (nullptr),
449 _command_speeds (nullptr),
451 _ref_torques (nullptr),
452 _ref_currents (nullptr),
455 verbose (VERY_VERBOSE)
459 verbosewhenok = (tmp !=
"") ? (
bool)NetType::toInt(tmp) :
477 for(
int i=0; i<_njoints; i++)
480 pwmLimit[i] = (33+i)*10;
481 current[i] = (33+i)*100;
482 maxCurrent[i] = (33+i)*1000;
483 peakCurrent[i] = (33+i)*2;
484 nominalCurrent[i] = (33+i)*20;
485 supplyVoltage[i] = (33+i)*200;
486 last_velocity_command[i] = -1;
487 last_pwm_command[i] = -1;
489 _maxJntCmdVelocity[i]=50.0;
531 yCTrace(FAKEMOTIONCONTROL) << str;
536 _njoints = config.
findGroup(
"GENERAL").
check(
"Joints",
Value(1),
"Number of degrees of freedom").asInt32();
540 yCError(FAKEMOTIONCONTROL) <<
"Malloc failed";
545 for(
int i=0; i<_njoints; i++)
546 _newtonsToSensor[i] = 1;
550 yCError(FAKEMOTIONCONTROL) <<
"Missing parameters in config file";
562 ControlBoardHelper cb(_njoints, _axisMap, _angleToEncoder,
nullptr, _newtonsToSensor, _ampsToSensor, _dutycycleToPWM);
564 ImplementControlCalibration::initialize(_njoints, _axisMap, _angleToEncoder,
nullptr);
565 ImplementAmplifierControl::initialize(_njoints, _axisMap, _angleToEncoder,
nullptr);
566 ImplementEncodersTimed::initialize(_njoints, _axisMap, _angleToEncoder,
nullptr);
567 ImplementMotorEncoders::initialize(_njoints, _axisMap, _angleToEncoder,
nullptr);
568 ImplementPositionControl::initialize(_njoints, _axisMap, _angleToEncoder,
nullptr);
569 ImplementPidControl::initialize(_njoints, _axisMap, _angleToEncoder,
nullptr, _newtonsToSensor, _ampsToSensor, _dutycycleToPWM);
572 ImplementControlMode::initialize(_njoints, _axisMap);
573 ImplementVelocityControl::initialize(_njoints, _axisMap, _angleToEncoder,
nullptr);
574 ImplementControlLimits::initialize(_njoints, _axisMap, _angleToEncoder,
nullptr);
575 ImplementImpedanceControl::initialize(_njoints, _axisMap, _angleToEncoder,
nullptr, _newtonsToSensor);
576 ImplementTorqueControl::initialize(_njoints, _axisMap, _angleToEncoder,
nullptr, _newtonsToSensor, _ampsToSensor, _dutycycleToPWM, bemfToRaw.
data(), ktauToRaw.
data());
577 ImplementPositionDirect::initialize(_njoints, _axisMap, _angleToEncoder,
nullptr);
578 ImplementInteractionMode::initialize(_njoints, _axisMap, _angleToEncoder,
nullptr);
579 ImplementMotor::initialize(_njoints, _axisMap);
580 ImplementAxisInfo::initialize(_njoints, _axisMap);
581 ImplementPWMControl::initialize(_njoints, _axisMap, _dutycycleToPWM);
582 ImplementCurrentControl::initialize(_njoints, _axisMap, _ampsToSensor);
583 ImplementVirtualAnalogSensor::initialize(_njoints, _axisMap, _newtonsToSensor);
586 bool init = this->
start();
589 yCError(FAKEMOTIONCONTROL) <<
"open() has an error in call of FakeMotionControl::init() for board" ;
596 yCDebug(FAKEMOTIONCONTROL) <<
"init() has successfully initted board ";
609 if (!extractGroup(pidsGroup, xtmp,
"stiffness",
"stiffness parameter", _njoints)) {
612 for (j=0; j<_njoints; j++) {
616 if (!extractGroup(pidsGroup, xtmp,
"damping",
"damping parameter", _njoints)) {
619 for (j=0; j<_njoints; j++) {
626 bool FakeMotionControl::parsePositionPidsGroup(
Bottle& pidsGroup,
Pid myPid[])
631 if (!extractGroup(pidsGroup, xtmp,
"kp",
"Pid kp parameter", _njoints)) {
634 for (j=0; j<_njoints; j++) {
638 if (!extractGroup(pidsGroup, xtmp,
"kd",
"Pid kd parameter", _njoints)) {
641 for (j=0; j<_njoints; j++) {
645 if (!extractGroup(pidsGroup, xtmp,
"ki",
"Pid kp parameter", _njoints)) {
648 for (j=0; j<_njoints; j++) {
652 if (!extractGroup(pidsGroup, xtmp,
"maxInt",
"Pid maxInt parameter", _njoints)) {
655 for (j=0; j<_njoints; j++) {
659 if (!extractGroup(pidsGroup, xtmp,
"maxPwm",
"Pid maxPwm parameter", _njoints)) {
662 for (j=0; j<_njoints; j++) {
666 if (!extractGroup(pidsGroup, xtmp,
"shift",
"Pid shift parameter", _njoints)) {
669 for (j=0; j<_njoints; j++) {
673 if (!extractGroup(pidsGroup, xtmp,
"ko",
"Pid ko parameter", _njoints)) {
676 for (j=0; j<_njoints; j++) {
680 if (!extractGroup(pidsGroup, xtmp,
"stictionUp",
"Pid stictionUp", _njoints)) {
683 for (j=0; j<_njoints; j++) {
687 if (!extractGroup(pidsGroup, xtmp,
"stictionDwn",
"Pid stictionDwn", _njoints)) {
690 for (j=0; j<_njoints; j++) {
694 if (!extractGroup(pidsGroup, xtmp,
"kff",
"Pid kff parameter", _njoints)) {
697 for (j=0; j<_njoints; j++) {
702 if (_positionControlUnits==P_METRIC_UNITS)
704 for (j=0; j<_njoints; j++)
706 myPid[j].
kp = myPid[j].
kp / _angleToEncoder[j];
707 myPid[j].
ki = myPid[j].
ki / _angleToEncoder[j];
708 myPid[j].
kd = myPid[j].
kd / _angleToEncoder[j];
719 if (!extractGroup(pidsGroup, xtmp,
"limPwm",
"Limited PWD", _njoints))
721 yCError(FAKEMOTIONCONTROL) <<
"The PID parameter limPwm was requested but was not correctly set in the configuration file, please fill it.";
725 yCInfo(FAKEMOTIONCONTROL) <<
"Using LIMITED PWM!!";
726 for (j=0; j<_njoints; j++)
733 bool FakeMotionControl::parseTorquePidsGroup(
Bottle& pidsGroup,
Pid myPid[],
double kbemf[],
double ktau[],
int filterType[])
737 if (!extractGroup(pidsGroup, xtmp,
"kp",
"Pid kp parameter", _njoints)) {
740 for (j=0; j<_njoints; j++) {
744 if (!extractGroup(pidsGroup, xtmp,
"kd",
"Pid kd parameter", _njoints)) {
747 for (j=0; j<_njoints; j++) {
751 if (!extractGroup(pidsGroup, xtmp,
"ki",
"Pid kp parameter", _njoints)) {
754 for (j=0; j<_njoints; j++) {
758 if (!extractGroup(pidsGroup, xtmp,
"maxInt",
"Pid maxInt parameter", _njoints)) {
761 for (j=0; j<_njoints; j++) {
765 if (!extractGroup(pidsGroup, xtmp,
"maxPwm",
"Pid maxPwm parameter", _njoints)) {
768 for (j=0; j<_njoints; j++) {
772 if (!extractGroup(pidsGroup, xtmp,
"shift",
"Pid shift parameter", _njoints)) {
775 for (j=0; j<_njoints; j++) {
779 if (!extractGroup(pidsGroup, xtmp,
"ko",
"Pid ko parameter", _njoints)) {
782 for (j=0; j<_njoints; j++) {
786 if (!extractGroup(pidsGroup, xtmp,
"stictionUp",
"Pid stictionUp", _njoints)) {
789 for (j=0; j<_njoints; j++) {
793 if (!extractGroup(pidsGroup, xtmp,
"stictionDwn",
"Pid stictionDwn", _njoints)) {
796 for (j=0; j<_njoints; j++) {
800 if (!extractGroup(pidsGroup, xtmp,
"kff",
"Pid kff parameter", _njoints)) {
803 for (j=0; j<_njoints; j++) {
807 if (!extractGroup(pidsGroup, xtmp,
"kbemf",
"kbemf parameter", _njoints)) {
810 for (j=0; j<_njoints; j++) {
814 if (!extractGroup(pidsGroup, xtmp,
"ktau",
"ktau parameter", _njoints)) {
817 for (j=0; j<_njoints; j++) {
821 if (!extractGroup(pidsGroup, xtmp,
"filterType",
"filterType param", _njoints)) {
824 for (j=0; j<_njoints; j++) {
841 if (!extractGroup(pidsGroup, xtmp,
"limPwm",
"Limited PWM", _njoints))
843 yCError(FAKEMOTIONCONTROL) <<
"The PID parameter limPwm was requested but was not correctly set in the configuration file, please fill it.";
847 yCInfo(FAKEMOTIONCONTROL) <<
"Using LIMITED PWM!!";
848 for (j=0; j<_njoints; j++) myPid[j].max_output = xtmp.
get(j+1).
asFloat64();
861 if(general.
check(
"AxisMap"))
863 if(extractGroup(general, xtmp,
"AxisMap",
"a list of reordered indices for the axes", _njoints))
865 for (i = 1; (size_t) i < xtmp.
size(); i++)
873 yCInfo(FAKEMOTIONCONTROL) <<
"Using default AxisMap";
874 for (i = 0; i < _njoints; i++)
878 if(general.
check(
"AxisName"))
880 if (extractGroup(general, xtmp,
"AxisName",
"a list of strings representing the axes names", _njoints))
883 for (i = 1; (size_t) i < xtmp.
size(); i++)
885 _axisName[_axisMap[i - 1]] = xtmp.
get(i).
asString();
893 yCInfo(FAKEMOTIONCONTROL) <<
"Using default AxisName";
894 for (i = 0; i < _njoints; i++)
896 _axisName[_axisMap[i]] =
"joint" +
toString(i);
899 if(general.
check(
"AxisType"))
901 if (extractGroup(general, xtmp,
"AxisType",
"a list of strings representing the axes type (revolute/prismatic)", _njoints))
904 for (i = 1; (size_t) i < xtmp.
size(); i++)
911 yCError(FAKEMOTIONCONTROL,
"Unknown AxisType value %s!", typeString.c_str());
922 yCInfo(FAKEMOTIONCONTROL) <<
"Using default AxisType (revolute)";
923 for (i = 0; i < _njoints; i++)
930 if (general.
check(
"ampsToSensor"))
932 if (extractGroup(general, xtmp,
"ampsToSensor",
"a list of scales for the ampsToSensor conversion factors", _njoints))
934 for (i = 1; (size_t) i < xtmp.
size(); i++)
947 yCInfo(FAKEMOTIONCONTROL) <<
"Using default ampsToSensor";
948 for (i = 0; i < _njoints; i++)
950 _ampsToSensor[i] = 1.0;
955 if (general.
check(
"fullscalePWM"))
957 if (extractGroup(general, xtmp,
"fullscalePWM",
"a list of scales for the fullscalePWM conversion factors", _njoints))
959 for (i = 1; (size_t) i < xtmp.
size(); i++)
963 _dutycycleToPWM[i - 1] = xtmp.
get(i).
asFloat64() / 100.0;
972 yCInfo(FAKEMOTIONCONTROL) <<
"Using default dutycycleToPWM=1.0";
973 for (i = 0; i < _njoints; i++)
974 _dutycycleToPWM[i] = 1.0;
979 if(general.
check(
"Encoder"))
981 if (extractGroup(general, xtmp,
"Encoder",
"a list of scales for the encoders", _njoints))
983 for (i = 1; (size_t) i < xtmp.
size(); i++)
993 yCInfo(FAKEMOTIONCONTROL) <<
"Using default Encoder";
994 for (i = 0; i < _njoints; i++)
995 _angleToEncoder[i] = 1;
1432 yCTrace(FAKEMOTIONCONTROL) <<
" close()";
1434 ImplementControlMode::uninitialize();
1435 ImplementEncodersTimed::uninitialize();
1436 ImplementMotorEncoders::uninitialize();
1437 ImplementPositionControl::uninitialize();
1438 ImplementVelocityControl::uninitialize();
1439 ImplementPidControl::uninitialize();
1440 ImplementControlCalibration::uninitialize();
1441 ImplementAmplifierControl::uninitialize();
1442 ImplementImpedanceControl::uninitialize();
1443 ImplementControlLimits::uninitialize();
1444 ImplementTorqueControl::uninitialize();
1445 ImplementPositionDirect::uninitialize();
1446 ImplementInteractionMode::uninitialize();
1447 ImplementAxisInfo::uninitialize();
1448 ImplementVirtualAnalogSensor::uninitialize();
1455 void FakeMotionControl::cleanup()
1466 yCDebug(FAKEMOTIONCONTROL) <<
"setPidRaw" << pidtype << j << pid.
kp;
1490 for(
int j=0; j< _njoints; j++)
1522 for(
int j=0, index=0; j< _njoints; j++, index++)
1534 _ppids_lim[j]=limit;
1537 _vpids_lim[j]=limit;
1540 _cpids_lim[j]=limit;
1543 _tpids_lim[j]=limit;
1554 for(
int j=0, index=0; j< _njoints; j++, index++)
1586 for(
int j=0; j< _njoints; j++)
1612 yCDebug(FAKEMOTIONCONTROL) <<
"getPidRaw" << pidtype << j << pid->
kp;
1622 for(
int j=0, index=0; j<_njoints; j++, index++)
1657 for(
int j=0; j< _njoints; j++)
1669 *limit=_ppids_lim[j];
1672 *limit=_vpids_lim[j];
1675 *limit=_cpids_lim[j];
1678 *limit=_tpids_lim[j];
1689 for(
int j=0, index=0; j<_njoints; j++, index++)
1706 _ppids_ena[j]=
false;
1709 _vpids_ena[j]=
false;
1712 _cpids_ena[j]=
false;
1715 _tpids_ena[j]=
false;
1747 yCDebug(FAKEMOTIONCONTROL) <<
"setPidOffsetRaw" << pidtype << j << v;
1773 *enabled=_ppids_ena[j];
1776 *enabled=_vpids_ena[j];
1779 *enabled=_cpids_ena[j];
1782 *enabled=_tpids_ena[j];
1809 yCDebug(FAKEMOTIONCONTROL) <<
"getPidOutputRaw" << pidtype << j << *out;
1816 for(
int j=0; j< _njoints; j++)
1836 yCError(FAKEMOTIONCONTROL) <<
"velocityMoveRaw: skipping command because board " <<
" joint " << j <<
" is not in VOCAB_CM_VELOCITY mode";
1838 _command_speeds[j] = sp;
1847 for(
int i=0; i<_njoints; i++)
1859 yCTrace(FAKEMOTIONCONTROL) <<
"setCalibrationParametersRaw for joint" << j;
1865 yCTrace(FAKEMOTIONCONTROL) <<
"calibrateRaw for joint" << j;
1871 bool result =
false;
1889 if(verbose >= VERY_VERBOSE)
1890 yCTrace(FAKEMOTIONCONTROL) <<
"j " << j <<
" ref " << ref;
1905 yCError(FAKEMOTIONCONTROL) <<
"positionMoveRaw: skipping command because joint " << j <<
" is not in VOCAB_CM_POSITION mode";
1907 _posCtrl_references[j] = ref;
1913 if(verbose >= VERY_VERBOSE)
1917 for(
int j=0, index=0; j< _njoints; j++, index++)
1926 if(verbose >= VERY_VERBOSE)
1927 yCTrace(FAKEMOTIONCONTROL) <<
"j " << j <<
" ref " << delta;
1941 yCError(FAKEMOTIONCONTROL) <<
"relativeMoveRaw: skipping command because joint " << j <<
" is not in VOCAB_CM_POSITION mode";
1943 _posCtrl_references[j] += delta;
1949 if(verbose >= VERY_VERBOSE)
1953 for(
int j=0, index=0; j< _njoints; j++, index++)
1963 if(verbose >= VERY_VERBOSE)
1964 yCTrace(FAKEMOTIONCONTROL) <<
"j ";
1972 if(verbose >= VERY_VERBOSE)
1976 bool val, tot_res =
true;
1978 for(
int j=0, index=0; j< _njoints; j++, index++)
1992 _ref_speeds[index] = sp;
2000 for(
int j=0, index=0; j< _njoints; j++, index++)
2002 _ref_speeds[index] = spds[index];
2014 _ref_accs[j ] = 1e6;
2016 else if (acc < -1e6)
2018 _ref_accs[j ] = -1e6;
2022 _ref_accs[j ] = acc;
2032 for(
int j=0, index=0; j< _njoints; j++, index++)
2036 _ref_accs[index] = 1e6;
2038 else if (accs[j] < -1e6)
2040 _ref_accs[index] = -1e6;
2044 _ref_accs[index] = accs[j];
2052 *spd = _ref_speeds[j];
2058 memcpy(spds, _ref_speeds,
sizeof(
double) * _njoints);
2064 *acc = _ref_accs[j];
2070 memcpy(accs, _ref_accs,
sizeof(
double) * _njoints);
2082 for(
int j=0; j< _njoints; j++)
2096 if(verbose >= VERY_VERBOSE)
2097 yCTrace(FAKEMOTIONCONTROL) <<
" -> n_joint " << n_joint;
2099 for(
int j=0; j<n_joint; j++)
2101 yCDebug(FAKEMOTIONCONTROL,
"j: %d; ref %f;\n", joints[j], refs[j]); fflush(stdout);
2105 for(
int j=0; j<n_joint; j++)
2114 if(verbose >= VERY_VERBOSE)
2115 yCTrace(FAKEMOTIONCONTROL) <<
"n_joint " << _njoints;
2118 for(
int j=0; j<n_joint; j++)
2127 if(verbose >= VERY_VERBOSE)
2128 yCTrace(FAKEMOTIONCONTROL) <<
"n_joint " << _njoints;
2132 bool tot_val =
true;
2134 for(
int j=0; j<n_joint; j++)
2145 if(verbose >= VERY_VERBOSE)
2146 yCTrace(FAKEMOTIONCONTROL) <<
"n_joint " << _njoints;
2149 for(
int j=0; j<n_joint; j++)
2158 if(verbose >= VERY_VERBOSE)
2159 yCTrace(FAKEMOTIONCONTROL) <<
"n_joint " << _njoints;
2162 for(
int j=0; j<n_joint; j++)
2171 if(verbose >= VERY_VERBOSE)
2172 yCTrace(FAKEMOTIONCONTROL) <<
"n_joint " << _njoints;
2175 for(
int j=0; j<n_joint; j++)
2184 if(verbose >= VERY_VERBOSE)
2185 yCTrace(FAKEMOTIONCONTROL) <<
"n_joint " << _njoints;
2188 for(
int j=0; j<n_joint; j++)
2197 if(verbose >= VERY_VERBOSE)
2198 yCTrace(FAKEMOTIONCONTROL) <<
"n_joint " << _njoints;
2201 for(
int j=0; j<n_joint; j++)
2215 if(verbose > VERY_VERY_VERBOSE)
2216 yCTrace(FAKEMOTIONCONTROL) <<
"j: " << j;
2218 *v = _controlModes[j];
2226 for(
int j=0; j< _njoints; j++)
2236 for(
int j=0; j< n_joint; j++)
2250 if(verbose >= VERY_VERBOSE)
2259 _controlModes[j] = _mode;
2261 _posCtrl_references[j] = pos[j];
2268 if(verbose >= VERY_VERBOSE)
2269 yCTrace(FAKEMOTIONCONTROL) <<
"n_joints: " << n_joint;
2272 for(
int i=0; i<n_joint; i++)
2281 if(verbose >= VERY_VERBOSE)
2285 for(
int i=0; i<_njoints; i++)
2329 for(
int j=0; j< _njoints; j++)
2348 for(
int j=0; j< _njoints; j++)
2366 for(
int j=0; j< _njoints; j++)
2379 for(
int i=0; i<_njoints; i++)
2380 stamps[i] = _encodersStamp[i];
2389 *stamp = _encodersStamp[j];
2442 for(
int j=0; j< _njoints; j++)
2459 for(
int j=0; j< _njoints; j++)
2475 for(
int j=0; j< _njoints; j++)
2486 for(
int i=0; i<_njoints; i++)
2487 stamps[i] = _encodersStamp[i];
2497 *stamp = _encodersStamp[m];
2519 *value = current[j];
2527 for(
int j=0; j< _njoints; j++)
2536 maxCurrent[m] = val;
2542 *val = maxCurrent[m];
2548 (_enabledAmp[j ]) ? *st = 1 : *st = 0;
2555 for(
int j=0; j<_njoints; j++)
2557 sts[j] = _enabledAmp[j];
2564 *val = peakCurrent[m];
2570 peakCurrent[m] = val;
2576 *val = nominalCurrent[m];
2582 nominalCurrent[m] = val;
2606 *val = supplyVoltage[m];
2655 yCError(FAKEMOTIONCONTROL,
"getKinematicMJRaw not yet implemented");
2691 if (axis >= 0 && axis < _njoints)
2693 name = _axisName[axis];
2705 if (axis >= 0 && axis < _njoints)
2707 type = _jointType[axis];
2725 *max = _maxJntCmdVelocity[axis];
2739 for (
int i = 0; i < _njoints; i++)
2759 for(
int j=0; j<_njoints &&
ret; j++)
2811 params->
bemf = _kbemf[j];
2813 params->
ktau = _ktau[j];
2821 _kbemf[j] = params.
bemf;
2822 _ktau[j] = params.
ktau;
2833 for(
int i=0; i<n_joint; i++)
2843 _posDir_references[j] = ref;
2849 for(
int i=0; i< n_joint; i++)
2851 _posDir_references[joints[i]] = refs[i];
2858 for(
int i=0; i< _njoints; i++)
2860 _posDir_references[i] = refs[i];
2868 if(verbose >= VERY_VERBOSE)
2869 yCTrace(FAKEMOTIONCONTROL) <<
"j " << axis <<
" ref " << _posCtrl_references[axis];
2877 yCWarning(FAKEMOTIONCONTROL) <<
"getTargetPosition: Joint " << axis <<
" is not in POSITION mode, therefore the value returned by " <<
2878 "this call is for reference only and may not reflect the actual behaviour of the motor/firmware.";
2880 *ref = _posCtrl_references[axis];
2887 for(
int i=0; i<_njoints; i++)
2895 for (
int i = 0; i<nj; i++)
2904 *ref = _command_speeds[axis];
2911 for (
int i = 0; i<_njoints; i++)
2921 for (
int i = 0; i<nj; i++)
2937 yCWarning(FAKEMOTIONCONTROL) <<
"getRefPosition: Joint " << axis <<
" is not in POSITION_DIRECT mode, therefore the value returned by \
2938 this call is for reference only and may not reflect the actual behaviour of the motor/firmware.";
2941 *ref = _posDir_references[axis];
2949 for (
int i = 0; i<_njoints; i++)
2959 for (
int i = 0; i<nj; i++)
2970 if(verbose > VERY_VERY_VERBOSE)
2971 yCTrace(FAKEMOTIONCONTROL) <<
"j: " << j;
2979 for(
int j=0; j< n_joints; j++)
2990 for(
int j=0; j<_njoints; j++)
3000 if(verbose >= VERY_VERBOSE)
3003 _interactMode[j] = _mode;
3012 for(
int i=0; i<n_joints; i++)
3022 for(
int i=0; i<_njoints; i++)
3044 for(
int j=0; j< _njoints; j++)
3072 for (
int i = 0; i < _njoints; i++)
3087 for (
int i = 0; i < _njoints; i++)
3102 for (
int i = 0; i < _njoints; i++)
3124 *min = _ref_currents[j] / 100;
3125 *max = _ref_currents[j] * 100;
3132 for (
int i = 0; i < _njoints; i++)
3134 min[i] = _ref_currents[i] / 100;
3135 max[i] = _ref_currents[i] * 100;
3142 for (
int i = 0; i < _njoints; i++)
3144 _ref_currents[i] =
t[i];
3145 current[i] =
t[i] / 2;
3152 _ref_currents[j] =
t;
3160 for (
int j = 0; j<n_joint; j++)
3169 for (
int i = 0; i < _njoints; i++)
3171 t[i] = _ref_currents[i];
3178 *
t = _ref_currents[j];
3189 return yarp::dev::VAS_status::VAS_OK;
3199 for (
int i = 0; i < _njoints; i++)
3201 measure[i] = _torques[i];
3208 _torques[ch] = measure;
virtual bool getHasHallSensorRaw(int j, int &ret)
bool getTorqueRangesRaw(double *min, double *max) override
Get the full scale of the torque sensors of all joints.
bool getPidRaw(const yarp::dev::PidControlTypeEnum &pidtype, int j, yarp::dev::Pid *pid) override
Get current pid value for a specific joint.
A simple collection of objects that can be described and transmitted in a portable way.
bool setPositionRaw(int j, double ref) override
Set new position for a single axis.
bool setPidErrorLimitRaw(const yarp::dev::PidControlTypeEnum &pidtype, int j, double limit) override
Set the error limit for the controller on a specific joint.
bool checkMotionDoneRaw(bool *flag) override
Check if the current trajectory is terminated.
bool getNominalCurrentRaw(int m, double *val) override
bool getMotorEncoderTimedRaw(int m, double *encs, double *stamp) override
Read the instantaneous position of a motor encoder.
void resize(size_t size) override
Resize the vector.
bool getEncoderAccelerationRaw(int j, double *spds) override
Read the instantaneous acceleration of an axis.
bool setEncodersRaw(const double *vals) override
Set the value of all encoders.
bool getPidErrorLimitsRaw(const yarp::dev::PidControlTypeEnum &pidtype, double *limits) override
Get the error limit for all controllers.
A base class for nested structures that can be searched.
bool getRefAccelerationRaw(int j, double *acc) override
Get reference acceleration for a joint.
bool getPidErrorRaw(const yarp::dev::PidControlTypeEnum &pidtype, int j, double *err) override
Get the current error for a joint.
Default implementation of the IPositionControl interface.
double stiction_up_val
up stiction offset added to the pid output
size_type size() const
Gets the number of elements in the bottle.
bool getRefDutyCycleRaw(int j, double *v) override
Gets the last reference sent using the setRefDutyCycleRaw function.
bool setMotorEncodersRaw(const double *vals) override
Set the value of all motor encoders.
bool setPidReferenceRaw(const yarp::dev::PidControlTypeEnum &pidtype, int j, double ref) override
Set the controller reference for a given axis.
#define VELOCITY_WATCHDOG
bool resetMotorEncodersRaw() override
Reset motor encoders.
bool setRefCurrentRaw(int j, double t) override
Set the reference value of the current for a single motor.
bool getAxes(int *ax) override
Get the number of controlled axes.
void run() override
Loop function.
bool getInteractionModeRaw(int j, yarp::dev::InteractionModeEnum *_mode) override
Get the current interaction mode of the robot, values can be stiff or compliant.
double max_output
max output
static bool NOT_YET_IMPLEMENTED(const char *txt)
constexpr yarp::conf::vocab32_t VOCAB_CM_IMPEDANCE_VEL
Interface settings the way the robot interacts with the environment: basic interaction types are Stif...
virtual Bottle & findGroup(const std::string &key) const =0
Gets a list corresponding to a given keyword.
@ VOCAB_JOINTTYPE_REVOLUTE
bool setPidRaw(const yarp::dev::PidControlTypeEnum &pidtype, int j, const yarp::dev::Pid &pid) override
Set new pid value for a joint axis.
#define yCWarning(component,...)
bool getAmpStatusRaw(int *st) override
virtual bool getHasRotorEncoderRaw(int j, int &ret)
bool setPWMLimitRaw(int j, const double val) override
bool velocityMoveRaw(int j, double sp) override
Start motion at a given speed, single joint.
bool setEncoderRaw(int j, double val) override
Set the value of the encoder for a given joint.
std::string getEnvironment(const char *key, bool *found=nullptr)
Read a variable from the environment.
virtual std::string toString() const =0
Return a standard text representation of the content of the object.
bool getPidErrorLimitRaw(const yarp::dev::PidControlTypeEnum &pidtype, int j, double *limit) override
Get the error limit for the controller on a specific joint.
bool stopRaw() override
Stop motion, multiple joints.
bool enablePidRaw(const yarp::dev::PidControlTypeEnum &pidtype, int j) override
Enable the pid computation for a joint.
bool resetPidRaw(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 getCurrentRangeRaw(int j, double *min, double *max) override
Get the full scale of the current measurement for a given motor (e.g.
bool getEncoderAccelerationsRaw(double *accs) override
Read the instantaneous acceleration of all axes.
bool relativeMoveRaw(int j, double delta) override
Set relative position.
bool threadInit() override
Initialization method.
#define YARP_LOG_COMPONENT(name,...)
bool getCurrentRaw(int j, double *val) override
bool getPeakCurrentRaw(int m, double *val) override
bool getPidsRaw(const yarp::dev::PidControlTypeEnum &pidtype, yarp::dev::Pid *pids) override
Get current pid value for a specific joint.
bool getControlModesRaw(int *v) override
bool setPidErrorLimitsRaw(const yarp::dev::PidControlTypeEnum &pidtype, const double *limits) override
Get the error limit for the controller on all joints.
bool resetEncodersRaw() override
Reset encoders.
bool setRefDutyCycleRaw(int j, double v) override
Sets the reference dutycycle of a single motor.
double scale
scale for the pid output
double ki
integrative gain
bool setControlModesRaw(const int n_joint, const int *joints, int *modes) override
bool getMotorEncodersRaw(double *encs) override
Read the position of all motor encoders.
int getVirtualAnalogSensorChannelsRaw() override
Get the number of channels of the virtual sensor.
virtual bool getMotorPolesRaw(int j, int &poles)
bool calibrateAxisWithParamsRaw(int axis, unsigned int type, double p1, double p2, double p3) override
Start calibration, this method is very often platform specific.
bool getTemperaturesRaw(double *vals) override
Get temperature of all the motors.
virtual bool getRotorEncoderTypeRaw(int j, int &type)
bool disableAmpRaw(int j) override
Disable the amplifier on a specific joint.
bool setImpedanceRaw(int j, double stiffness, double damping) override
Set current impedance parameters (stiffness,damping) for a specific joint.
bool getNumberOfMotorEncodersRaw(int *num) override
Get the number of available motor encoders.
double now()
Return the current time in seconds, relative to an arbitrary starting point.
An interface for the device drivers.
bool getEncoderRaw(int j, double *v) override
Read the value of an encoder.
bool setLimitsRaw(int axis, double min, double max) override
Set the software limits for a particular axis, the behavior of the control card when these limits are...
virtual bool initialised()
constexpr yarp::conf::vocab32_t VOCAB_CM_POSITION_DIRECT
virtual bool getRotorEncoderResolutionRaw(int m, double &rotres)
constexpr yarp::conf::vocab32_t VOCAB_CM_POSITION
bool setMotorEncoderCountsPerRevolutionRaw(int m, const double cpr) override
Sets number of counts per revolution for motor encoder m.
bool getTemperatureLimitRaw(int m, double *temp) override
Retreives the current temperature limit for a specific motor.
bool getNumberOfMotorsRaw(int *num) override
Retrieves the number of controlled motors from the current physical interface.
bool setInteractionModesRaw(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.
virtual bool getHasTempSensorsRaw(int j, int &ret)
constexpr yarp::conf::vocab32_t VOCAB_CM_FORCE_IDLE
std::string decode(NetInt32 code)
Convert a vocabulary identifier into a string.
bool check(const std::string &key) const override
Check if there exists a property of the given name.
bool getPidErrorsRaw(const yarp::dev::PidControlTypeEnum &pidtype, double *errs) override
Get the error of all joints.
Bottle & findGroup(const std::string &key) const override
Gets a list corresponding to a given keyword.
virtual bool getHasRotorEncoderIndexRaw(int j, int &ret)
bool getRefTorqueRaw(int j, double *t) override
Set the reference value of the torque for a given joint.
bool getImpedanceRaw(int j, double *stiffness, double *damping) override
Get current impedance parameters (stiffness,damping,offset) for a specific joint.
@ VOCAB_JOINTTYPE_PRISMATIC
bool getJointTypeRaw(int axis, yarp::dev::JointTypeEnum &type) override
double offset
pwm offset added to the pid output
bool getDutyCycleRaw(int j, double *v) override
Gets the current dutycycle of the output of the amplifier (i.e.
double max_int
saturation threshold for the integrator
bool getRefAccelerationsRaw(double *accs) override
Get reference acceleration of all joints.
bool setInteractionModeRaw(int j, yarp::dev::InteractionModeEnum _mode) override
Set the interaction mode of the robot, values can be stiff or compliant.
bool setPeakCurrentRaw(int m, const double val) override
bool setRefSpeedRaw(int j, double sp) override
Set reference speed for a joint, this is the speed used during the interpolation of the trajectory.
bool updateVirtualAnalogSensorMeasureRaw(yarp::sig::Vector &measure) override
Set a vector of torque values for virtual sensor.
bool resetMotorEncoderRaw(int m) override
Reset motor encoder, single motor.
Value & get(size_type index) const
Reads a Value v from a certain part of the list.
bool getTemperatureRaw(int m, double *val) override
Get temperature of a motor.
bool getPidOutputRaw(const yarp::dev::PidControlTypeEnum &pidtype, int j, double *out) override
Get the output of the controller (e.g.
virtual bool isFloat64() const
Checks if value is a 64-bit floating point number.
bool setControlModeRaw(const int j, const int mode) override
bool getEncoderTimedRaw(int j, double *encs, double *stamp) override
Read the instantaneous acceleration of all axes.
bool fromConfig(yarp::os::Searchable &config)
bool close() override
Close the DeviceDriver.
constexpr yarp::conf::vocab32_t VOCAB_CM_PWM
virtual std::string asString() const
Get string value.
bool start()
Call this to start the thread.
bool setRefAccelerationRaw(int j, double acc) override
Set reference acceleration for a joint.
bool getMotorEncoderAccelerationRaw(int m, double *spds) override
Read the instantaneous acceleration of a motor encoder.
double kp
proportional gain
bool getTargetPositionsRaw(double *refs) override
Get the last position reference for all axes.
bool isPidEnabledRaw(const yarp::dev::PidControlTypeEnum &pidtype, int j, bool *enabled) override
Get the current status (enabled/disabled) of the pid controller.
double kff
feedforward gain
#define OPENLOOP_WATCHDOG
bool positionMoveRaw(int j, double ref) override
Set new reference point for a single axis.
bool setPidOffsetRaw(const yarp::dev::PidControlTypeEnum &pidtype, int j, double v) override
Set an offset value on the ourput of pid controller.
constexpr yarp::conf::vocab32_t VOCAB_CM_IDLE
bool setPidReferencesRaw(const yarp::dev::PidControlTypeEnum &pidtype, const double *refs) override
Set the controller reference, multiple axes.
bool getGearboxRatioRaw(int m, double *gearbox) override
Get the gearbox ratio for a specific motor.
bool setCalibrationParametersRaw(int axis, const yarp::dev::CalibrationParameters ¶ms) override
Start calibration, this method is very often platform specific.
bool setPidsRaw(const yarp::dev::PidControlTypeEnum &pidtype, const yarp::dev::Pid *pids) override
Set new pid value on multiple axes.
bool getPidReferencesRaw(const yarp::dev::PidControlTypeEnum &pidtype, double *refs) override
Get the current reference of all pid controllers.
bool getRefCurrentsRaw(double *t) override
Get the reference value of the currents for all motors.
bool getAxisNameRaw(int axis, std::string &name) override
bool getRefDutyCyclesRaw(double *v) override
Gets the last reference sent using the setRefDutyCyclesRaw function.
bool getEncodersTimedRaw(double *encs, double *stamps) override
Read the instantaneous acceleration of all axes.
bool setMotorTorqueParamsRaw(int j, const yarp::dev::MotorTorqueParameters params) override
Set the motor parameters.
bool getImpedanceOffsetRaw(int j, double *offset) override
Get current force Offset for a specific joint.
virtual bool getJointEncoderResolutionRaw(int m, double &jntres)
bool getMotorEncoderSpeedsRaw(double *spds) override
Read the instantaneous speed of all motor encoders.
bool getRefVelocitiesRaw(double *refs) override
Get the last reference speed set by velocityMove for all joints.
double stiction_down_val
down stiction offset added to the pid output
An abstraction for a periodic thread.
bool alloc(int njoints)
Allocated buffers.
bool isNull() const override
Checks if the object is invalid.
void checkAndDestroy(T *&p)
bool getMotorEncoderRaw(int m, double *v) override
Read the value of a motor encoder.
bool setRefDutyCyclesRaw(const double *v) override
Sets the reference dutycycle for all motors.
bool setRefTorqueRaw(int j, double t) override
Set the reference value of the torque for a given joint.
bool getMotorEncoderSpeedRaw(int m, double *sp) override
Read the istantaneous speed of a motor encoder.
bool setVelLimitsRaw(int axis, double min, double max) override
Set the software speed limits for a particular axis, the behavior of the control card when these limi...
bool getRefPositionsRaw(double *refs) override
Get the last position reference for all axes.
bool getTargetPositionRaw(const int joint, double *ref) override
Get the last position reference for the specified axis.
T * data()
Return a pointer to the first element of the vector.
bool getMaxCurrentRaw(int j, double *val) override
Returns the maximum electric current allowed for a given motor.
bool getLimitsRaw(int axis, double *min, double *max) override
Get the software limits for a particular axis.
bool resetEncoderRaw(int j) override
Reset encoder, single joint.
#define yCError(component,...)
virtual bool getRotorIndexOffsetRaw(int j, double &rotorOffset)
virtual std::int32_t asInt32() const
Get 32-bit integer value.
bool getTorqueRaw(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 getEncoderSpeedsRaw(double *spds) override
Read the instantaneous acceleration of an axis.
bool getPWMRaw(int j, double *val) override
bool getVelLimitsRaw(int axis, double *min, double *max) override
Get the software speed limits for a particular axis.
#define yCInfo(component,...)
bool setRefCurrentsRaw(const double *t) override
Set the reference value of the currents for all motors.
VectorOf< double > Vector
An interface to the operating system, including Port based communication.
#define yCDebug(component,...)
bool enableAmpRaw(int j) override
Enable the amplifier on a specific joint.
virtual bool getKinematicMJRaw(int j, double &rotres)
bool setMaxCurrentRaw(int j, double val) override
virtual bool getJointEncoderTypeRaw(int j, int &type)
constexpr yarp::conf::vocab32_t VOCAB_CM_MIXED
std::string toString(const T &value)
convert an arbitrary type to string.
bool getRefVelocityRaw(const int joint, double *ref) override
Get the last reference speed set by velocityMove for single joint.
class ImplementControlLimits; class StubImplControlLimitsRaw;
bool getEncodersRaw(double *encs) override
Read the position of all axes.
bool calibrationDoneRaw(int j) override
Check if the calibration is terminated, on a particular joint.
bool getPidReferenceRaw(const yarp::dev::PidControlTypeEnum &pidtype, int j, double *ref) override
Get the current reference of the pid controller for a specific joint.
bool getRefSpeedsRaw(double *spds) override
Get reference speed of all joints.
bool setRefSpeedsRaw(const double *spds) override
Set reference speed on all joints.
bool setTemperatureLimitRaw(int m, const double temp) override
Set the temperature limit for a specific motor.
bool setRefTorquesRaw(const double *t) override
Set the reference value of the torque for all joints.
Contains the parameters for a PID.
bool getInteractionModesRaw(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.
static bool DEPRECATED(const char *txt)
bool getRefTorquesRaw(double *t) override
Get the reference value of the torque for all joints.
bool getDutyCyclesRaw(double *v) override
Gets the current dutycycle of the output of the amplifier (i.e.
virtual bool getTorqueControlFilterType(int j, int &type)
bool getControlModeRaw(int j, int *v) override
bool getMotorEncoderCountsPerRevolutionRaw(int m, double *v) override
Gets number of counts per revolution for motor encoder m.
bool getCurrentRangesRaw(double *min, double *max) override
Get the full scale of the current measurements for all motors motor (e.g.
bool getMotorEncoderAccelerationsRaw(double *accs) override
Read the instantaneous acceleration of all motor encoders.
yarp::dev::VAS_status getVirtualAnalogSensorStatusRaw(int ch) override
Check the status of a given channel.
#define yCTrace(component,...)
bool getEncoderSpeedRaw(int j, double *sp) override
Read the instantaneous speed of an axis.
bool getTorqueRangeRaw(int j, double *min, double *max) override
Get the full scale of the torque sensor of a given joint.
bool open(yarp::os::Searchable &par) override
Open the DeviceDriver.
bool getCurrentImpedanceLimitRaw(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 getTorquesRaw(double *t) override
Get the value of the torque for all joints (this is the feedback if you have torque sensors).
A single value (typically within a Bottle).
bool getRefCurrentRaw(int j, double *t) override
Get the reference value of the current for a single motor.
bool getRefPositionRaw(const int joint, double *ref) override
Get the last position reference for the specified axis.
bool getPowerSupplyVoltageRaw(int j, double *val) override
bool setPositionsRaw(const int n_joint, const int *joints, const double *refs) override
Set new reference point for all axes.
bool setRefAccelerationsRaw(const double *accs) override
Set reference acceleration on all joints.
bool setImpedanceOffsetRaw(int j, double offset) override
Set current force Offset for a specific joint.
bool getMotorEncodersTimedRaw(double *encs, double *stamps) override
Read the instantaneous position of all motor encoders.
bool disablePidRaw(const yarp::dev::PidControlTypeEnum &pidtype, int j) override
Disable the pid computation for a joint.
void threadRelease() override
Release method.
The components from which ports and connections are built.
bool getPidOutputsRaw(const yarp::dev::PidControlTypeEnum &pidtype, double *outs) override
Get the output of the controllers (e.g.
virtual yarp::conf::float64_t asFloat64() const
Get 64-bit floating point value.
Default implementation of the IPositionDirect interface.
bool setNominalCurrentRaw(int m, const double val) override
@ VOCAB_JOINTTYPE_UNKNOWN
bool getCurrentsRaw(double *vals) override
void resizeBuffers()
Resize previously allocated buffers.
bool getRefSpeedRaw(int j, double *ref) override
Get reference speed for a joint.
bool getMotorTorqueParamsRaw(int j, yarp::dev::MotorTorqueParameters *params) override
Get the motor parameters.
constexpr yarp::conf::vocab32_t VOCAB_CM_IMPEDANCE_POS
bool getPWMLimitRaw(int j, double *val) override
constexpr yarp::conf::vocab32_t VOCAB_CM_VELOCITY
bool setMotorEncoderRaw(int m, const double val) override
Set the value of the motor encoder for a given motor.
virtual bool isInt32() const
Checks if value is a 32-bit integer.