12 #ifndef __CanBusMotionControlh__
13 #define __CanBusMotionControlh__
15 #include <yarp/dev/DeviceDriver.h>
16 #include <yarp/dev/ControlBoardHelper.h>
17 #include <yarp/dev/ControlBoardInterfaces.h>
18 #include <yarp/dev/ControlBoardInterfacesImpl.h>
19 #include <yarp/dev/IAnalogSensor.h>
20 #include <yarp/dev/CanBusInterface.h>
21 #include <yarp/dev/IPreciselyTimed.h>
22 #include <yarp/os/PeriodicThread.h>
33 class CanBusMotionControl;
34 class CanBusMotionControlParameters;
142 bool fromConfig(yarp::os::Searchable &config);
204 _data=
new double[_bufferSize];
205 for(
int k=0;k<_bufferSize;k++)
228 public yarp::dev::DeviceDriver
248 unsigned int counterSat;
249 unsigned int counterError;
250 unsigned int counterTimeout;
260 yarp::os::Bottle initMsg;
261 yarp::os::Bottle speedMsg;
262 yarp::os::Bottle closeMsg;
263 std::string deviceIdentifier;
265 short useCalibration;
266 bool isVirtualSensor;
268 bool decode8(
const unsigned char *msg,
int id,
double *data);
269 bool decode16(
const unsigned char *msg,
int id,
double *data);
299 return deviceIdentifier;
317 {
return useCalibration;}
319 {
return scaleFactor;}
322 if (chan>=0 && chan<data->size())
323 return scaleFactor[chan];
331 virtual int read(yarp::sig::Vector &
out);
361 if (jnt>=0 && jnt<jointsNum)
return estim_params[jnt];
367 delete [] estim_params;
371 #define BOARD_TYPE_4DC 0x03
372 #define BOARD_TYPE_BLL 0x04
423 for (
int i=0; i<jointsNum; i++)
425 infos[i] = f_infos[i];
434 bool printed =
false;
435 for (
int j=0; j<jointsNum; j++)
437 if (
infos[j].board_type==0)
483 yInfo(
"**********************************\n");
485 yInfo(
"Firmware report:\n");
486 for (
int j=0; j<jointsNum; j++)
490 yInfo(
"**********************************\n");
496 yWarning(
"###################################################################################\n");
497 yWarning(
"###################################################################################\n");
499 yWarning(
" yarprobotinterface detected that your control boards are not running the latest\n");
500 yWarning(
" available firmware version, although it is still compatible with it.\n");
501 yWarning(
" Upgrading your iCub firmware to build %d is highly recommended.\n",
LAST_BLL_BUILD);
502 yWarning(
" For further information please visit: https://icub-tech-iit.github.io/documentation/icub_firmware\n");
504 yWarning(
"###################################################################################\n");
505 yWarning(
"###################################################################################\n");
511 yWarning(
"#################################################################################################\n");
512 yWarning(
"#################################################################################################\n");
514 yWarning(
" yarprobotinterface detected that your control boards are running a firmware version\n");
515 yWarning(
" which is newer than the recommended version (build %d), although it is still compatible with it.\n",
LAST_BLL_BUILD);
516 yWarning(
" It may also be that you are running an experimental firmware version. \n");
517 yWarning(
" An update of Yarp/iCub SW is recommended. Proceed only if you are aware of what you are doing.\n");
519 yWarning(
"#################################################################################################\n");
520 yWarning(
"#################################################################################################\n");
526 yError(
"###################################################################################\n");
527 yError(
"###################################################################################\n");
529 yError(
" It has been detected that your control boards are not using the same\n");
530 yError(
" CAN protocol used by yarprobotinterface. yarprobotinterface cannot continue.\n");
531 yError(
" Please update your system (yarprobotinterface and/or your control board firmware.\n");
532 yError(
" For further information please visit: https://icub-tech-iit.github.io/documentation/icub_firmware\n");
534 yError(
"###################################################################################\n");
535 yError(
"###################################################################################\n");
567 yarp::dev::ControlBoardHelper* helper;
576 delete [] maxUserStep;
582 inline double posA2E (
double ang,
int j) {
return helper->posA2E(ang, j);}
583 inline double posE2A (
double ang,
int j) {
return helper->posE2A(ang, j);}
593 int* torqueSensorChan;
594 double* maximumTorque;
595 double* newtonsToSensor;
598 axisTorqueHelper(
int njoints,
int*
id,
int* chan,
double* maxTrq,
double* newtons2sens );
601 if (jnt>=0 && jnt<jointsNum)
return torqueSensorId[jnt];
606 if (jnt>=0 && jnt<jointsNum)
return torqueSensorChan[jnt];
611 if (jnt>=0 && jnt<jointsNum)
return maximumTorque[jnt];
616 if (jnt>=0 && jnt<jointsNum)
return newtonsToSensor[jnt];
625 if (torqueSensorId)
delete [] torqueSensorId;
626 if (torqueSensorChan)
delete [] torqueSensorChan;
627 if (maximumTorque)
delete [] maximumTorque;
628 if (newtonsToSensor)
delete [] newtonsToSensor;
655 public os::PeriodicThread,
656 public IPidControlRaw,
657 public IPositionControlRaw,
658 public IPositionDirectRaw,
659 public IVelocityControlRaw,
660 public IAmplifierControlRaw,
661 public IControlCalibrationRaw,
662 public IControlLimitsRaw,
663 public ITorqueControlRaw,
664 public IImpedanceControlRaw,
665 public IControlModeRaw,
666 public IPreciselyTimed,
667 public ImplementPositionControl,
668 public ImplementPositionDirect,
669 public ImplementVelocityControl,
670 public ImplementPidControl,
671 public IEncodersTimedRaw,
672 public ImplementEncodersTimed,
673 public IMotorEncodersRaw,
674 public ImplementMotorEncoders,
676 public ImplementMotor,
677 public ImplementControlCalibration,
678 public ImplementAmplifierControl,
679 public ImplementControlLimits,
680 public ImplementTorqueControl,
681 public ImplementImpedanceControl,
682 public ImplementControlMode,
683 public IInteractionModeRaw,
684 public ImplementInteractionMode,
685 public IRemoteVariablesRaw,
686 public ImplementRemoteVariables,
688 public ImplementAxisInfo,
689 public IPWMControlRaw,
690 public ImplementPWMControl,
691 public ICurrentControlRaw,
692 public ImplementCurrentControl,
696 class torqueControlHelper
699 double* newtonsToSensor;
700 double* angleToEncoders;
703 torqueControlHelper(
int njoints,
double* angleToEncoders,
double* newtons2sens);
704 inline ~torqueControlHelper()
706 if (newtonsToSensor)
delete [] newtonsToSensor;
707 if (angleToEncoders)
delete [] angleToEncoders;
711 inline double getNewtonsToSensor (
int jnt)
713 if (jnt>=0 && jnt<jointsNum)
return newtonsToSensor[jnt];
716 inline double getAngleToEncoders (
int jnt)
718 if (jnt>=0 && jnt<jointsNum)
return angleToEncoders[jnt];
721 inline int getNumberOfJoints ()
731 void handleBroadcasts();
734 double averagePeriod;
735 double averageThreadTime;
738 double lastReportTime;
739 os::Stamp stampEncoders;
742 std::string errorstring;
743 static constexpr
size_t errorstringsize = 512;
745 std::list<TBR_AnalogSensor *> analogSensors;
747 std::string canDevName;
748 std::string networkName;
752 bool readFullScaleAnalog(
int analog_can_address,
int channel,
double* fullScale);
753 TBR_AnalogSensor *instantiateAnalog(yarp::os::Searchable& config, std::string
id);
773 virtual bool open(yarp::os::Searchable& config);
787 virtual bool close(
void);
790 yarp::dev::DeviceDriver *
createDevice(yarp::os::Searchable& config);
798 #ifdef _USE_INTERFACEGUI
800 void logNetworkData(
const char *devName,
int network,
int index,
const yarp::os::Value&
data)
804 sprintf(_buff,
"%s %d,network,%d",devName,network,index);
805 mServerLogger->
log(std::string(_buff),
data);
809 void logJointData(
const char *devName,
int network,
int joint,
int index,
const yarp::os::Value&
data)
813 sprintf(_buff,
"%s %d,BLL,%d,%d",devName,network,joint,index);
814 mServerLogger->
log(std::string(_buff),
data);
818 void logAnalogData(
const char *devName,
int network,
int board,
int index,
const yarp::os::Value&
data)
822 sprintf(_buff,
"%s %d,analog,%d,%d",devName,network,
board,index);
823 mServerLogger->
log(std::string(_buff),
data);
827 #define logJointData(a,b,c,d,e)
828 #define logNetworkData(a,b,c,d)
829 #define logBoardData(a,b,c,d,e)
834 virtual bool setPidRaw(
const PidControlTypeEnum& pidtype,
int j,
const Pid &pid)
override;
835 virtual bool setPidsRaw(
const PidControlTypeEnum& pidtype,
const Pid *pids)
override;
836 virtual bool setPidReferenceRaw(
const PidControlTypeEnum& pidtype,
int j,
double ref)
override;
837 virtual bool setPidReferencesRaw(
const PidControlTypeEnum& pidtype,
const double *refs)
override;
838 virtual bool setPidErrorLimitRaw(
const PidControlTypeEnum& pidtype,
int j,
double limit)
override;
839 virtual bool setPidErrorLimitsRaw(
const PidControlTypeEnum& pidtype,
const double *limits)
override;
840 virtual bool getPidErrorRaw(
const PidControlTypeEnum& pidtype,
int j,
double *err)
override;
841 virtual bool getPidErrorsRaw(
const PidControlTypeEnum& pidtype,
double *errs)
override;
842 virtual bool getPidOutputRaw(
const PidControlTypeEnum& pidtype,
int j,
double *
out)
override;
843 virtual bool getPidOutputsRaw(
const PidControlTypeEnum& pidtype,
double *outs)
override;
844 virtual bool getPidRaw(
const PidControlTypeEnum& pidtype,
int j, Pid *pid)
override;
845 virtual bool getPidsRaw(
const PidControlTypeEnum& pidtype, Pid *pids)
override;
846 virtual bool getPidReferenceRaw(
const PidControlTypeEnum& pidtype,
int j,
double *ref)
override;
847 virtual bool getPidReferencesRaw(
const PidControlTypeEnum& pidtype,
double *refs)
override;
848 virtual bool getPidErrorLimitRaw(
const PidControlTypeEnum& pidtype,
int j,
double *limit)
override;
850 virtual bool resetPidRaw(
const PidControlTypeEnum& pidtype,
int j)
override;
851 virtual bool disablePidRaw(
const PidControlTypeEnum& pidtype,
int j)
override;
852 virtual bool enablePidRaw(
const PidControlTypeEnum& pidtype,
int j)
override;
853 virtual bool setPidOffsetRaw(
const PidControlTypeEnum& pidtype,
int j,
double v)
override;
854 virtual bool isPidEnabledRaw(
const PidControlTypeEnum& pidtype,
int j,
bool* enabled);
861 virtual bool getAxes(
int *ax)
override;
876 virtual bool stopRaw(
int j)
override;
877 virtual bool stopRaw()
override;
892 virtual bool setRefTorquesRaw(
const int n_joint,
const int *joints,
const double *t)
override;
910 virtual bool getImpedanceRaw(
int j,
double *stiff,
double *damp)
override;
911 virtual bool setImpedanceRaw(
int j,
double stiff,
double damp)
override;
914 virtual bool getCurrentImpedanceLimitRaw(
int j,
double *min_stiff,
double *max_stiff,
double *min_damp,
double *max_damp)
override;
924 virtual bool getControlModesRaw(
const int n_joint,
const int *joints,
int *modes)
override;
926 virtual bool setControlModesRaw(
const int n_joint,
const int *joints,
int *modes)
override;
996 virtual bool getPWMRaw(
int j,
double* val)
override;
1016 virtual bool getAxisNameRaw(
int axis, std::string& name)
override;
1017 virtual bool getJointTypeRaw(
int axis, yarp::dev::JointTypeEnum& type)
override;
1030 virtual bool setParameterRaw(
int j,
unsigned int type,
double value) ;
1031 virtual bool getParameterRaw(
int j,
unsigned int type,
double* value) ;
1049 virtual bool positionMoveRaw(
const int n_joint,
const int *joints,
const double *refs)
override;
1050 virtual bool relativeMoveRaw(
const int n_joint,
const int *joints,
const double *deltas)
override;
1051 virtual bool checkMotionDoneRaw(
const int n_joint,
const int *joints,
bool *flags)
override;
1052 virtual bool setRefSpeedsRaw(
const int n_joint,
const int *joints,
const double *spds)
override;
1054 virtual bool getRefSpeedsRaw(
const int n_joint,
const int *joints,
double *spds)
override;
1056 virtual bool stopRaw(
const int n_joint,
const int *joints)
override;
1062 virtual bool velocityMoveRaw(
const int n_joint,
const int *joints,
const double *spds)
override;
1065 virtual bool getRefVelocitiesRaw(
const int n_joint,
const int *joints,
double *refs)
override;
1073 virtual bool setTorqueSource(
int axis,
char board_id,
char board_chan);
1077 virtual bool setPositionsRaw(
const int n_joint,
const int *joints,
const double *refs)
override;
1081 virtual bool getRefPositionsRaw(
const int n_joint,
const int *joints,
double *refs)
override;
1085 virtual bool getInteractionModesRaw(
int n_joints,
int *joints, yarp::dev::InteractionModeEnum* modes)
override;
1088 virtual bool setInteractionModesRaw(
int n_joints,
int *joints, yarp::dev::InteractionModeEnum* modes)
override;
1107 virtual bool setRefCurrentsRaw(
const int n_joint,
const int *joints,
const double *t)
override;
1138 inline bool ENABLED (
int axis);
1140 virtual void run(
void);
1146 bool _writeWord16Ex (
int msg,
int axis,
short s1,
short s2,
bool check=
true);
1147 bool _readWord16 (
int msg,
int axis,
short& value);
1148 bool _readWord16Ex (
int msg,
int axis,
short& value1,
short& value2);
1150 bool _readDWord (
int msg,
int axis,
int& value);
1155 bool _readByte8(
int msg,
int axis,
int& value);
1156 bool _writeByteWords16(
int msg,
int axis,
unsigned char value,
short s1,
short s2,
short s3);
1177 #define MAX_POSITION_MOVE_INTERVAL 0.080
1192 return short(
x + .5);
1194 return short(
x - .5);
#define logNetworkData(a, b, c, d)
#define logJointData(a, b, c, d, e)
Interface for a factory device; a device that can create objects.
double & operator[](int i)
TBR_AnalogData(int ch, int buffsize)
virtual int calibrateChannel(int ch, double v)
bool handleAnalog(void *)
std::string getDeviceId()
short getUseCalibration()
double getScaleFactor(int chan)
bool open(int channels, AnalogDataFormat f, short bId, short useCalib, bool isVirtualSensor)
virtual int getState(int ch)
TBR_CanBackDoor * backDoor
virtual int read(yarp::sig::Vector &out)
void getCounters(unsigned int &sat, unsigned int &err, unsigned int &to)
virtual int getChannels()
void setDeviceId(std::string id)
double * getScaleFactor()
virtual int calibrateSensor(const yarp::sig::Vector &value)
virtual int calibrateSensor()
virtual int calibrateChannel(int ch)
axisImpedanceHelper(int njoints, ImpedanceLimits *imped_limits)
ImpedanceLimits * getImpedanceLimits()
double getMaxHwStep(int j)
double posA2E(double ang, int j)
double getMaxUserStep(int j)
double getSaturatedValue(int j, double curr_value, double ref_value)
axisPositionDirectHelper(int njoints, const int *aMap, const double *angToEncs, double *_maxStep)
~axisPositionDirectHelper()
double posE2A(double ang, int j)
double getMaximumTorque(int jnt)
double getNewtonsToSensor(int jnt)
axisTorqueHelper(int njoints, int *id, int *chan, double *maxTrq, double *newtons2sens)
int getTorqueSensorChan(int jnt)
int getTorqueSensorId(int jnt)
void printFirmwareVersions()
void printMessagePleaseUpgradeFirmware()
void printMessagePleaseUpgradeiCub()
void printMessageSevereError()
bool checkFirmwareVersions()
firmwareVersionHelper(int joints, firmware_info *f_infos, can_protocol_info &protocol)
can_protocol_info icub_protocol
speedEstimationHelper(int njoints, SpeedEstimationParameters *estim_parameters)
SpeedEstimationParameters getEstimationParameters(int jnt)
The PlxCan motion controller device driver.
double * _motorPwmLimits
current limits
double * _maxTorque
Channel of associated Joint Torque Sensor.
int _timeout
thread polling interval [ms]
std::string * _axisName
number of cycles before timing out
DebugParameters * _debug_params
parameters for speed/acceleration estimation
int _polling_interval
my address
double * _optical_factor
max velocity command for a joint
bool parseImpedanceGroup_NewFormat(yarp::os::Bottle &pidsGroup, ImpedanceParameters vals[])
int * _torqueSensorId
reduction ratio of the optical encoder on motor axis
double * _ktau
bemf compensation gain
double * _ampsToSensor
Newtons to force sensor units conversion factors.
double * _rotToEncoder
angle to encoder conversion factors
double * _zeros
angle to rotor conversion factors
bool parseTrqPidsGroup_OldFormat(yarp::os::Bottle &pidsGroup, int nj, Pid myPid[])
bool setBroadCastMask(yarp::os::Bottle &list, int MASK)
SpeedEstimationParameters * _estim_params
set to true if pwm is limited
unsigned char _my_address
destination addresses
bool parsePosPidsGroup_OldFormat(yarp::os::Bottle &pidsGroup, int nj, Pid myPid[])
unsigned char * _destinations
number of joints/axes/controlled motors
Pid * _tpids
initial gains
std::string * _axisType
axis name
bool fromConfig(yarp::os::Searchable &config)
double * _currentLimits
joint limits, min
double * _angleToEncoder
axis remapping lookup-table
~CanBusMotionControlParameters()
Destructor, with memory deallocation.
double * _maxJntCmdVelocity
max size of a positionDirect step
bool _pwmIsLimited
initial torque gains
double * _bemfGain
impedancel imits
int * _torqueSensorChan
Id of associated Joint Torque Sensor.
int * _velocityShifts
pwm limits
double * _newtonsToSensor
Max torque of a joint.
int * _filterType
motor torque constant
torqueControlUnitsType _torqueControlUnits
ImpedanceParameters * _impedance_params
debug parameters
std::string _networkName
network number
CanBusMotionControlParameters()
Constructor (please make sure you use the constructor to allocate memory).
bool parsePidsGroup_NewFormat(yarp::os::Bottle &pidsGroup, Pid myPid[])
ImpedanceLimits * _impedance_limits
impedance parameters
double * _limitsMax
joint limits, max
int * _velocityTimeout
velocity shifts
bool _torqueControlEnabled
double * _maxStep
velocity shifts
bool parseDebugGroup_NewFormat(yarp::os::Bottle &pidsGroup, DebugParameters vals[])
canbusmotioncontrol : driver for motor control boards on a CAN bus.
virtual bool setInteractionModeRaw(int axis, yarp::dev::InteractionModeEnum mode) override
bool _readDWordArray(int msg, double *out)
reads an array of double words.
virtual bool enablePidRaw(const PidControlTypeEnum &pidtype, int j) override
virtual bool getTemperatureLimitRaw(int m, double *temp) override
virtual bool setEncoderRaw(int j, double val) override
bool _readByte8(int msg, int axis, int &value)
virtual bool getRefVelocitiesRaw(double *refs) override
virtual bool setRefCurrentsRaw(const double *t) override
bool _writeWord16(int msg, int axis, short s)
to send a Word16.
virtual bool getMotorEncodersTimedRaw(double *v, double *t) override
virtual bool getCurrentImpedanceLimitRaw(int j, double *min_stiff, double *max_stiff, double *min_damp, double *max_damp) override
bool _readWord16Ex(int msg, int axis, short &value1, short &value2)
virtual bool getEncoderAccelerationsRaw(double *accs) override
virtual bool setRefSpeedsRaw(const double *spds) override
virtual bool getMotorEncoderRaw(int m, double *v) override
icubCanProto_controlmode_t from_modevocab_to_modeint(int modevocab)
virtual bool setPrintFunction(int(*f)(const char *fmt,...))
IControlDebug Interface.
void setServerLogger(const IServerLogger *server)
virtual bool getRemoteVariableRaw(std::string key, yarp::os::Bottle &val) override
virtual bool getNominalCurrentRaw(int m, double *val) override
int from_interactionint_to_interactionvocab(unsigned char interactionint)
virtual bool setPidReferenceRaw(const PidControlTypeEnum &pidtype, int j, double ref) override
cmd is a SingleAxis poitner with 1 double arg
virtual bool getCurrentRaw(int j, double *val) override
virtual bool setRefAccelerationRaw(int j, double acc) override
virtual bool getEncoderRaw(int j, double *v) override
virtual bool setParameterRaw(int j, unsigned int type, double value)
axisPositionDirectHelper * _axisPositionDirectHelper
firmwareVersionHelper * _firmwareVersionHelper
virtual bool getPidRaw(const PidControlTypeEnum &pidtype, int j, Pid *pid) override
virtual bool stopRaw() override
virtual bool getEncodersRaw(double *encs) override
virtual bool getLimitsRaw(int axis, double *min, double *max) override
virtual ~CanBusMotionControl()
Destructor.
virtual bool disableAmpRaw(int j) override
virtual bool setTorqueSource(int axis, char board_id, char board_chan)
virtual bool getRefVelocityRaw(const int joint, double *ref) override
virtual bool setInteractionModesRaw(int n_joints, int *joints, yarp::dev::InteractionModeEnum *modes) override
virtual bool setMotorEncoderCountsPerRevolutionRaw(int m, const double cpr) override
virtual bool setPidOffsetRaw(const PidControlTypeEnum &pidtype, int j, double v) override
virtual bool getTorqueRangesRaw(double *min, double *max) override
virtual bool getDutyCyclesRaw(double *v) override
bool helper_getTrqPidRaw(int j, Pid *pid)
virtual bool getRefTorqueRaw(int j, double *ref_trq) override
TORQUE CONTROL INTERFACE RAW.
virtual bool setRefTorquesRaw(const double *ref_trqs) override
cmd is an array of double (LATER: to be optimized).
bool _writeWord16Ex(int msg, int axis, short s1, short s2, bool check=true)
two shorts in a single Can message (both must belong to the same control card).
virtual bool setPositionsRaw(const int n_joint, const int *joints, const double *refs) override
bool helper_setTrqPidRaw(int j, const Pid &pid)
virtual bool getPidOutputRaw(const PidControlTypeEnum &pidtype, int j, double *out) override
speedEstimationHelper * _speedEstimationHelper
virtual bool resetEncodersRaw() override
yarp::dev::DeviceDriver * createDevice(yarp::os::Searchable &config)
virtual bool saveBootMemory()
bool _writeDWord(int msg, int axis, int value)
write a DWord
CanBusMotionControl()
Default constructor.
virtual bool getImpedanceOffsetRaw(int j, double *offs) override
bool _readWord16(int msg, int axis, short &value)
virtual yarp::os::Stamp getLastInputStamp() override
virtual bool getEncoderSpeedsRaw(double *spds) override
virtual bool setMotorEncodersRaw(const double *vals) override
bool helper_getVelPidRaw(int j, Pid *pid)
virtual bool calibrationDoneRaw(int j) override
axisTorqueHelper * _axisTorqueHelper
virtual bool getMotorEncoderAccelerationRaw(int m, double *spds) override
virtual bool getControlModesRaw(int *v) override
virtual bool setVelLimitsRaw(int axis, double min, double max) override
double * _max_vel_jnt_cmd
virtual bool setMaxCurrentRaw(int j, double val) override
virtual bool checkMotionDoneRaw(bool *flag) override
ret is a pointer to a bool
virtual bool getVelLimitsRaw(int axis, double *min, double *max) override
virtual bool getCurrentsRaw(double *vals) override
bool getFilterTypeRaw(int j, int *type)
virtual bool getCurrentRangeRaw(int j, double *min, double *max) override
bool open(const CanBusMotionControlParameters &par)
Open the device driver.
virtual bool getInteractionModesRaw(int n_joints, int *joints, yarp::dev::InteractionModeEnum *modes) override
virtual bool getRefPositionsRaw(double *refs) override
bool ENABLED(int axis)
helper function to check whether the enabled flag is on or off.
bool helper_setPosPidRaw(int j, const Pid &pid)
virtual bool setControlModesRaw(const int n_joint, const int *joints, int *modes) override
virtual bool getPidReferencesRaw(const PidControlTypeEnum &pidtype, double *refs) override
virtual bool setImpedanceRaw(int j, double stiff, double damp) override
virtual bool setPidErrorLimitRaw(const PidControlTypeEnum &pidtype, int j, double limit) override
virtual bool getEncoderTimedRaw(int j, double *v, double *t) override
virtual bool getCurrentRangesRaw(double *min, double *max) override
virtual bool getMotorEncoderTimedRaw(int m, double *v, double *t) override
virtual bool getJointTypeRaw(int axis, yarp::dev::JointTypeEnum &type) override
std::recursive_mutex _mutex
axisImpedanceHelper * _axisImpedanceHelper
virtual bool getMotorEncoderSpeedRaw(int m, double *sp) override
virtual bool setTemperatureLimitRaw(int m, const double temp) override
virtual bool getEncodersTimedRaw(double *v, double *t) override
virtual bool resetMotorEncodersRaw() override
virtual bool getPidErrorsRaw(const PidControlTypeEnum &pidtype, double *errs) override
double * _ref_command_positions
virtual bool getInteractionModeRaw(int axis, yarp::dev::InteractionModeEnum *mode) override
virtual bool setImpedanceOffsetRaw(int j, double offs) override
virtual bool getControlModeRaw(int j, int *v) override
virtual bool getRefCurrentsRaw(double *t) override
bool helper_getPosPidRaw(int j, Pid *pid)
bool _readWord16Array(int msg, double *out)
reads an array.
virtual bool getPowerSupplyVoltageRaw(int j, double *val) override
virtual bool loadBootMemory()
virtual bool getTargetPositionRaw(const int joint, double *ref) override
virtual bool getNumberOfMotorEncodersRaw(int *num) override
bool helper_setCurPidRaw(int j, const Pid &pid)
int from_modeint_to_modevocab(unsigned char modeint)
bool _writeByteWords16(int msg, int axis, unsigned char value, short s1, short s2, short s3)
virtual bool getAxes(int *ax) override
POSITION CONTROL INTERFACE RAW.
virtual bool setMotorEncoderRaw(int m, const double val) override
virtual bool getRefCurrentRaw(int j, double *t) override
virtual bool getRefAccelerationRaw(int j, double *acc) override
cmd is an array of double (LATER: to be optimized).
virtual bool setPWMLimitRaw(int j, const double val) override
bool _writeNone(int msg, int axis)
WRITE functions sends a message without parameters.
bool setBCastMessages(int axis, unsigned int v)
sets the broadcast policy for a given board (don't need to be called twice).
virtual bool calibrateAxisWithParamsRaw(int axis, unsigned int type, double p1, double p2, double p3) override
virtual bool getRefSpeedsRaw(double *spds) override
cmd is an array of double (LATER: to be optimized).
virtual bool close(void)
Closes the device driver.
virtual bool setPositionRaw(int j, double ref) override
virtual bool open(yarp::os::Searchable &config)
Open the device driver and start communication with the hardware.
bool _readDWord(int msg, int axis, int &value)
READ functions sends a message and gets a dword back.
virtual bool setDebugReferencePositionRaw(int j, double value)
virtual bool getPWMLimitRaw(int j, double *val) override
unsigned char from_interactionvocab_to_interactionint(int interactionvocab)
virtual bool getAxisNameRaw(int axis, std::string &name) override
IAxisInfo.
virtual bool positionMoveRaw(int j, double ref) override
virtual bool setPidErrorLimitsRaw(const PidControlTypeEnum &pidtype, const double *limits) override
virtual bool setRefCurrentRaw(int j, double t) override
virtual bool getEncoderAccelerationRaw(int j, double *spds) override
virtual bool getTorqueRangeRaw(int j, double *min, double *max) override
virtual bool threadInit()
virtual bool setPidReferencesRaw(const PidControlTypeEnum &pidtype, const double *refs) override
cmd is an array of double (LATER: to be optimized).
virtual bool setPidRaw(const PidControlTypeEnum &pidtype, int j, const Pid &pid) override
double * _last_position_move_time
virtual bool setPeakCurrentRaw(int m, const double val) override
virtual bool setLimitsRaw(int axis, double min, double max) override
virtual bool getFirmwareVersionRaw(int axis, can_protocol_info const &icub_interface_protocol, firmware_info *info)
virtual bool getTemperatureRaw(int m, double *val) override
virtual bool getDutyCycleRaw(int j, double *v) override
virtual bool relativeMoveRaw(int j, double delta) override
virtual bool getNumberOfMotorsRaw(int *m) override
IMotor.
virtual bool getDebugParameterRaw(int j, unsigned int index, double *value)
virtual bool getRefDutyCycleRaw(int j, double *v) override
virtual bool getMaxCurrentRaw(int j, double *val) override
int _filter
filter for recurrent messages.
virtual bool getRefDutyCyclesRaw(double *v) override
virtual bool isPidEnabledRaw(const PidControlTypeEnum &pidtype, int j, bool *enabled)
virtual bool getMotorTorqueParamsRaw(int j, MotorTorqueParameters *params) override
virtual bool getMotorEncodersRaw(double *encs) override
virtual bool setRefDutyCyclesRaw(const double *v) override
virtual bool getMotorEncoderSpeedsRaw(double *spds) override
virtual bool getRefAccelerationsRaw(double *accs) override
cmd is an array of double (LATER: to be optimized).
virtual bool getMotorEncoderCountsPerRevolutionRaw(int m, double *cpr) override
virtual bool velocityMoveRaw(int j, double sp) override
Velocity control interface raw.
bool setVelocityShiftRaw(int j, double val)
bool setFilterTypeRaw(int j, int type)
virtual bool getPidsRaw(const PidControlTypeEnum &pidtype, Pid *pids) override
virtual bool getPeakCurrentRaw(int m, double *val) override
virtual bool getTargetPositionsRaw(double *refs) override
bool setVelocityTimeoutRaw(int j, double val)
virtual bool resetEncoderRaw(int j) override
virtual bool getRemoteVariablesListRaw(yarp::os::Bottle *listOfKeys) override
virtual bool setCalibrationParametersRaw(int j, const CalibrationParameters ¶ms) override
bool helper_setVelPidRaw(int j, const Pid &pid)
bool setSpeedEstimatorShiftRaw(int j, double jnt_speed, double jnt_acc, double mot_speed, double mot_acc)
virtual bool setRefTorqueRaw(int j, double ref_trq) override
cmd is a SingleAxis poitner with 1 double arg
virtual bool setControlModeRaw(const int j, const int mode) override
double * _ref_command_speeds
virtual bool getParameterRaw(int j, unsigned int type, double *value)
virtual bool getPWMRaw(int j, double *val) override
bool _writeByte8(int msg, int axis, int value)
write a byte
virtual bool setDebugParameterRaw(int j, unsigned int index, double value)
virtual bool getAmpStatusRaw(int *st) override
virtual bool getRefTorquesRaw(double *ref_trqs) override
cmd is an array of double (LATER: to be optimized).
virtual bool getPidOutputsRaw(const PidControlTypeEnum &pidtype, double *outs) override
virtual bool getPidErrorRaw(const PidControlTypeEnum &pidtype, int j, double *err) override
virtual bool setRemoteVariableRaw(std::string key, const yarp::os::Bottle &val) override
virtual bool setRefAccelerationsRaw(const double *accs) override
virtual bool getRefPositionRaw(const int joint, double *ref) override
virtual bool getPidReferenceRaw(const PidControlTypeEnum &pidtype, int j, double *ref) override
bool helper_getCurPidRaw(int j, Pid *pid)
virtual bool getImpedanceRaw(int j, double *stiff, double *damp) override
IMPEDANCE CONTROL INTERFACE RAW.
virtual bool getPidErrorLimitsRaw(const PidControlTypeEnum &pidtype, double *limits) override
virtual bool setRefSpeedRaw(int j, double sp) override
virtual bool getTorqueRaw(int j, double *trq) override
cmd is a SingleAxis pointer with 1 double arg
virtual bool resetMotorEncoderRaw(int m) override
virtual bool getDebugReferencePositionRaw(int j, double *value)
virtual bool getTemperaturesRaw(double *vals) override
bool _MCtorqueControlEnabled
virtual bool setEncodersRaw(const double *vals) override
virtual bool getEncoderSpeedRaw(int j, double *sp) override
virtual bool disablePidRaw(const PidControlTypeEnum &pidtype, int j) override
virtual bool getTorquesRaw(double *trqs) override
cmd is an array of double (LATER: to be optimized).
virtual bool setMotorTorqueParamsRaw(int j, const MotorTorqueParameters params) override
virtual bool resetPidRaw(const PidControlTypeEnum &pidtype, int j) override
virtual bool setRefDutyCycleRaw(int j, double v) override
short S_16(double x) const
virtual bool getPidErrorLimitRaw(const PidControlTypeEnum &pidtype, int j, double *limit) override
virtual bool setPidsRaw(const PidControlTypeEnum &pidtype, const Pid *pids) override
virtual bool enableAmpRaw(int j) override
virtual void threadRelease()
virtual bool getRefSpeedRaw(int j, double *ref) override
virtual bool setNominalCurrentRaw(int m, const double val) override
virtual bool getMotorEncoderAccelerationsRaw(double *accs) override
Interface for a client that logs status messages to a server.
Interface for a factory device; a device that can create objects.
Interface for a server that logs status messages.
virtual bool log(const std::string &key, const yarp::os::Value &data)=0
Get a reference to log server data.
double sat(const double val, const double min, const double max)
Copyright (C) 2008 RobotCub Consortium.
SpeedEstimationParameters()
double jnt_Vel_estimator_shift
double mot_Acc_estimator_shift
double mot_Vel_estimator_shift
double jnt_Acc_estimator_shift
can_protocol_info can_protocol