yarp-devices
Public Member Functions | Private Member Functions | Private Attributes | List of all members
roboticslab::TechnosoftIposEmbedded Class Reference

A TechnosoftIposBase implementation using the firmware-embedded PID.

#include <TechnosoftIposEmbedded.hpp>

Inheritance diagram for roboticslab::TechnosoftIposEmbedded:
roboticslab::TechnosoftIposBase roboticslab::ICanBusSharer

Public Member Functions

bool open (yarp::os::Searchable &config) override
 
bool close () override
 
bool synchronize (double timestamp) override
 Perform synchronized action on CAN master's request.
 
bool getControlModeRaw (int j, int *mode) override
 
bool setControlModeRaw (int j, int mode) override
 
bool positionMoveRaw (int j, double ref) override
 
bool relativeMoveRaw (int j, double delta) override
 
bool checkMotionDoneRaw (int j, bool *flag) override
 
bool setRefSpeedRaw (int j, double sp) override
 
bool setRefAccelerationRaw (int j, double acc) override
 
bool getRefSpeedRaw (int j, double *ref) override
 
bool getRefAccelerationRaw (int j, double *acc) override
 
bool stopRaw (int j) override
 
bool getTargetPositionRaw (int joint, double *ref) override
 
bool setPositionRaw (int j, double ref) override
 
bool getRefPositionRaw (int joint, double *ref) override
 
bool getRemoteVariableRaw (std::string key, yarp::os::Bottle &val) override
 
bool setRemoteVariableRaw (std::string key, const yarp::os::Bottle &val) override
 
bool getRemoteVariablesListRaw (yarp::os::Bottle *listOfKeys) override
 
bool velocityMoveRaw (int j, double sp) override
 
bool getRefVelocityRaw (int joint, double *vel) override
 
- Public Member Functions inherited from roboticslab::TechnosoftIposBase
bool open (yarp::os::Searchable &config) override
 
bool close () override
 
unsigned int getId () override
 Retrieve CAN node ID.
 
std::vector< unsigned int > getAdditionalIds () override
 Retrieve more associated CAN node IDs, if any.
 
bool notifyMessage (const can_message &message) override
 Notify observers that a new CAN message has arrived.
 
bool initialize () override
 Perform CAN node initialization.
 
bool finalize () override
 Finalize CAN node communications.
 
bool registerSender (ICanSenderDelegate *sender) override
 Pass a handle to a CAN sender delegate instance.
 
bool getAxisNameRaw (int axis, std::string &name) override
 
bool getJointTypeRaw (int axis, yarp::dev::JointTypeEnum &type) override
 
bool setLimitsRaw (int axis, double min, double max) override
 
bool getLimitsRaw (int axis, double *min, double *max) override
 
bool setVelLimitsRaw (int axis, double min, double max) override
 
bool getVelLimitsRaw (int axis, double *min, double *max) override
 
bool getControlModesRaw (int *modes) override
 
bool getControlModesRaw (int n_joint, const int *joints, int *modes) override
 
bool setControlModesRaw (int *modes) override
 
bool setControlModesRaw (int n_joint, const int *joints, int *modes) override
 
bool getCurrentRaw (int m, double *curr) override
 
bool getCurrentsRaw (double *currs) override
 
bool getCurrentRangeRaw (int m, double *min, double *max) override
 
bool getCurrentRangesRaw (double *min, double *max) override
 
bool setRefCurrentRaw (int m, double curr) override
 
bool setRefCurrentsRaw (const double *currs) override
 
bool setRefCurrentsRaw (int n_motor, const int *motors, const double *currs) override
 
bool getRefCurrentRaw (int m, double *curr) override
 
bool getRefCurrentsRaw (double *currs) override
 
bool getAxes (int *ax) override
 
bool resetEncoderRaw (int j) override
 
bool resetEncodersRaw () override
 
bool setEncoderRaw (int j, double val) override
 
bool setEncodersRaw (const double *vals) override
 
bool getEncoderRaw (int j, double *v) override
 
bool getEncodersRaw (double *encs) override
 
bool getEncoderSpeedRaw (int j, double *sp) override
 
bool getEncoderSpeedsRaw (double *spds) override
 
bool getEncoderAccelerationRaw (int j, double *spds) override
 
bool getEncoderAccelerationsRaw (double *accs) override
 
bool getEncoderTimedRaw (int j, double *encs, double *time) override
 
bool getEncodersTimedRaw (double *encs, double *times) override
 
bool getImpedanceRaw (int j, double *stiffness, double *damping) override
 
bool setImpedanceRaw (int j, double stiffness, double damping) override
 
bool setImpedanceOffsetRaw (int j, double offset) override
 
bool getImpedanceOffsetRaw (int j, double *offset) override
 
bool getCurrentImpedanceLimitRaw (int j, double *min_stiff, double *max_stiff, double *min_damp, double *max_damp) override
 
bool getInteractionModeRaw (int axis, yarp::dev::InteractionModeEnum *mode) override
 
bool getInteractionModesRaw (int n_joints, int *joints, yarp::dev::InteractionModeEnum *modes) override
 
bool getInteractionModesRaw (yarp::dev::InteractionModeEnum *modes) override
 
bool setInteractionModeRaw (int axis, yarp::dev::InteractionModeEnum mode) override
 
bool setInteractionModesRaw (int n_joints, int *joints, yarp::dev::InteractionModeEnum *modes) override
 
bool setInteractionModesRaw (yarp::dev::InteractionModeEnum *modes) override
 
bool getLastJointFaultRaw (int j, int &fault, std::string &message) override
 
bool getNumberOfMotorsRaw (int *num) override
 
bool getTemperatureRaw (int m, double *val) override
 
bool getTemperaturesRaw (double *vals) override
 
bool getTemperatureLimitRaw (int m, double *temp) override
 
bool setTemperatureLimitRaw (int m, double temp) override
 
bool getGearboxRatioRaw (int m, double *val) override
 
bool setGearboxRatioRaw (int m, double val) override
 
bool getNumberOfMotorEncodersRaw (int *num) override
 
bool resetMotorEncoderRaw (int m) override
 
bool resetMotorEncodersRaw () override
 
bool setMotorEncoderCountsPerRevolutionRaw (int m, double cpr) override
 
bool getMotorEncoderCountsPerRevolutionRaw (int m, double *cpr) override
 
bool setMotorEncoderRaw (int m, double val) override
 
bool setMotorEncodersRaw (const double *vals) override
 
bool getMotorEncoderRaw (int m, double *v) override
 
bool getMotorEncodersRaw (double *encs) override
 
bool getMotorEncoderTimedRaw (int m, double *encs, double *stamp) override
 
bool getMotorEncodersTimedRaw (double *encs, double *stamps) override
 
bool getMotorEncoderSpeedRaw (int m, double *sp) override
 
bool getMotorEncoderSpeedsRaw (double *spds) override
 
bool getMotorEncoderAccelerationRaw (int m, double *spds) override
 
bool getMotorEncoderAccelerationsRaw (double *accs) override
 
bool setPidRaw (const yarp::dev::PidControlTypeEnum &pidtype, int j, const yarp::dev::Pid &pid) override
 
bool setPidsRaw (const yarp::dev::PidControlTypeEnum &pidtype, const yarp::dev::Pid *pids) override
 
bool setPidReferenceRaw (const yarp::dev::PidControlTypeEnum &pidtype, int j, double ref) override
 
bool setPidReferencesRaw (const yarp::dev::PidControlTypeEnum &pidtype, const double *refs) override
 
bool setPidErrorLimitRaw (const yarp::dev::PidControlTypeEnum &pidtype, int j, double limit) override
 
bool setPidErrorLimitsRaw (const yarp::dev::PidControlTypeEnum &pidtype, const double *limits) override
 
bool getPidErrorRaw (const yarp::dev::PidControlTypeEnum &pidtype, int j, double *err) override
 
bool getPidErrorsRaw (const yarp::dev::PidControlTypeEnum &pidtype, double *errs) override
 
bool getPidOutputRaw (const yarp::dev::PidControlTypeEnum &pidtype, int j, double *out) override
 
bool getPidOutputsRaw (const yarp::dev::PidControlTypeEnum &pidtype, double *outs) override
 
bool getPidRaw (const yarp::dev::PidControlTypeEnum &pidtype, int j, yarp::dev::Pid *pid) override
 
bool getPidsRaw (const yarp::dev::PidControlTypeEnum &pidtype, yarp::dev::Pid *pids) override
 
bool getPidReferenceRaw (const yarp::dev::PidControlTypeEnum &pidtype, int j, double *ref) override
 
bool getPidReferencesRaw (const yarp::dev::PidControlTypeEnum &pidtype, double *refs) override
 
bool getPidErrorLimitRaw (const yarp::dev::PidControlTypeEnum &pidtype, int j, double *limit) override
 
bool getPidErrorLimitsRaw (const yarp::dev::PidControlTypeEnum &pidtype, double *limits) override
 
bool resetPidRaw (const yarp::dev::PidControlTypeEnum &pidtype, int j) override
 
bool disablePidRaw (const yarp::dev::PidControlTypeEnum &pidtype, int j) override
 
bool enablePidRaw (const yarp::dev::PidControlTypeEnum &pidtype, int j) override
 
bool setPidOffsetRaw (const yarp::dev::PidControlTypeEnum &pidtype, int j, double v) override
 
bool isPidEnabledRaw (const yarp::dev::PidControlTypeEnum &pidtype, int j, bool *enabled) override
 
bool positionMoveRaw (const double *refs) override
 
bool positionMoveRaw (int n_joint, const int *joints, const double *refs) override
 
bool relativeMoveRaw (const double *deltas) override
 
bool relativeMoveRaw (int n_joint, const int *joints, const double *deltas) override
 
bool checkMotionDoneRaw (bool *flag) override
 
bool checkMotionDoneRaw (int n_joint, const int *joints, bool *flag) override
 
bool setRefSpeedsRaw (const double *spds) override
 
bool setRefSpeedsRaw (int n_joint, const int *joints, const double *spds) override
 
bool setRefAccelerationsRaw (const double *accs) override
 
bool setRefAccelerationsRaw (int n_joint, const int *joints, const double *accs) override
 
bool getRefSpeedsRaw (double *spds) override
 
bool getRefSpeedsRaw (int n_joint, const int *joints, double *spds) override
 
bool getRefAccelerationsRaw (double *accs) override
 
bool getRefAccelerationsRaw (int n_joint, const int *joints, double *accs) override
 
bool stopRaw () override
 
bool stopRaw (int n_joint, const int *joints) override
 
bool getTargetPositionsRaw (double *refs) override
 
bool getTargetPositionsRaw (int n_joint, const int *joints, double *refs) override
 
bool setPositionsRaw (const double *refs) override
 
bool setPositionsRaw (int n_joint, const int *joints, const double *refs) override
 
bool getRefPositionsRaw (double *refs) override
 
bool getRefPositionsRaw (int n_joint, const int *joints, double *refs) override
 
bool getRefTorqueRaw (int j, double *t) override
 
bool getRefTorquesRaw (double *t) override
 
bool setRefTorqueRaw (int j, double t) override
 
bool setRefTorquesRaw (int n_joint, const int *joints, const double *t) override
 
bool setRefTorquesRaw (const double *t) override
 
bool getTorqueRaw (int j, double *t) override
 
bool getTorquesRaw (double *t) override
 
bool getTorqueRangeRaw (int j, double *min, double *max) override
 
bool getTorqueRangesRaw (double *min, double *max) override
 
bool getMotorTorqueParamsRaw (int j, yarp::dev::MotorTorqueParameters *params) override
 
bool setMotorTorqueParamsRaw (int j, const yarp::dev::MotorTorqueParameters params) override
 
bool velocityMoveRaw (const double *sp) override
 
bool velocityMoveRaw (int n_joint, const int *joints, const double *spds) override
 
bool getRefVelocitiesRaw (double *vels) override
 
bool getRefVelocitiesRaw (int n_joint, const int *joints, double *vels) override
 
- Public Member Functions inherited from roboticslab::ICanBusSharer
virtual ~ICanBusSharer ()=default
 Destructor.
 
- Public Member Functions inherited from roboticslab::ICanMessageNotifier
virtual ~ICanMessageNotifier ()=default
 Virtual destructor.
 

Private Member Functions

void interpretModesOfOperation (std::int8_t modesOfOperation) override
 
void interpretIpStatus (std::uint16_t ipStatus) override
 
void onPositionLimitTriggered () override
 
void reset () override
 

Private Attributes

InterpolatedPositionBufferipBuffer {nullptr}
 
std::string ipMode
 
int ipPeriodMs {0}
 
std::bitset< 16 > ipStatus
 
std::atomic< bool > ipMotionStarted {false}
 
std::atomic< bool > ipBufferFilled {false}
 
std::atomic< bool > ipBufferEnabled {false}
 
std::atomic< bool > enableSync {false}
 
std::atomic< bool > enableCsv {false}
 
std::atomic< double > targetPosition {0.0}
 
std::atomic< double > targetVelocity {0.0}
 

Additional Inherited Members

- Protected Types inherited from roboticslab::TechnosoftIposBase
enum  report_level { NONE , INFO , WARN , FAULT }
 
enum  limit_switch { POSITIVE , NEGATIVE , INACTIVE }
 
- Protected Member Functions inherited from roboticslab::TechnosoftIposBase
bool reportBitToggle (report_storage report, int level, std::size_t pos, const char *msgSet, const char *msgReset=nullptr)
 
bool awaitControlMode (yarp::conf::vocab32_t mode)
 Wait with timeout for requested control mode change.
 
double degreesToInternalUnits (double value, int derivativeOrder=0) const
 Convert position, speed or acceleration to internal units.
 
double internalUnitsToDegrees (double value, int derivativeOrder=0) const
 Convert position, speed or acceleration to degrees.
 
std::int16_t currentToInternalUnits (double value) const
 Convert current to internal units.
 
double internalUnitsToCurrent (std::int16_t value) const
 Convert current to amperes.
 
double internalUnitsToPeakCurrent (std::int16_t value) const
 Apply internal iPOS conversion to express drive peak current in amperes.
 
double currentToTorque (double current) const
 Convert current (amperes) to torque (Nm).
 
double torqueToCurrent (double torque) const
 Convert torque (Nm) to current (amperes).
 
- Protected Attributes inherited from roboticslab::TechnosoftIposBase
CanOpenNodecan
 
CommandBuffer commandBuffer
 
std::unique_ptr< StateObservercontrolModeObserverPtr {new StateObserver(1.0)}
 
std::unique_ptr< EncoderReadlastEncoderRead {nullptr}
 
std::bitset< 16 > msr
 
std::bitset< 16 > mer
 
std::bitset< 16 > der
 
std::bitset< 16 > der2
 
std::bitset< 16 > cer
 
std::int8_t modesOfOperation {0}
 
DriveState driveState {DriveState::NOT_READY_TO_SWITCH_ON}
 
bool configuredOnce {false}
 
std::atomic< std::int16_t > lastCurrentRead {0}
 
std::atomic< yarp::conf::vocab32_t > actualControlMode {0}
 
std::atomic< yarp::conf::vocab32_t > requestedcontrolMode {0}
 
std::atomic< double > tr {0.0}
 
std::atomic< double > k {0.0}
 
std::atomic< int > encoderPulses {0}
 
std::atomic< double > maxVel {0.0}
 
std::atomic< double > min {0.0}
 
std::atomic< double > max {0.0}
 
std::atomic< double > refSpeed {0.0}
 
std::atomic< double > refAcceleration {0.0}
 
std::atomic< double > lastHeartbeat {0.0}
 
std::atomic< std::uint8_t > lastNmtState {0}
 
std::atomic< std::uint16_t > lastFaultCode {0}
 
std::atomic< const char * > lastFaultMessage
 
std::atomic< limit_switch > limitSwitchState {INACTIVE}
 
yarp::conf::vocab32_t initialControlMode {0}
 
double drivePeakCurrent {0.0}
 
double samplingPeriod {0.0}
 
std::string axisName
 
yarp::conf::vocab32_t jointType {0}
 
bool reverse {false}
 
PdoConfiguration tpdo1Conf
 
PdoConfiguration tpdo2Conf
 
PdoConfiguration tpdo3Conf
 
double heartbeatPeriod {0.0}
 
double syncPeriod {0.0}
 
unsigned int canId {0}
 

The documentation for this class was generated from the following files: