6#ifndef YARP_DEV_CONTROLBOARDREMAPPER_CONTROLBOARDREMAPPER_H
7#define YARP_DEV_CONTROLBOARDREMAPPER_CONTROLBOARDREMAPPER_H
24 #pragma warning(disable:4355)
97 std::vector<std::string> axesNames;
101 int controlledJoints{0};
107 std::string partName;
122 void setNrOfControlledAxes(
const size_t nrOfControlledAxes);
129 bool updateAxesName();
134 void configureBuffers();
139 bool usingAxesNamesForAttachAll{
false};
140 bool usingNetworksForAttachAll{
false};
188 bool close()
override;
define control board standard interfaces
Class storing the decomposition of a subset of the total remapped axes of the remapped controlboard i...
controlboardremapper : device that takes a list of axes from multiple controlboards and expose them a...
yarp::dev::ReturnValue getPidReferences(const yarp::dev::PidControlTypeEnum &pidtype, double *refs) override
Get the current reference of all PID controllers.
yarp::dev::ReturnValue getTargetVelocities(double *vels) override
Get the last reference speed set by velocityMove for all joints.
yarp::dev::ReturnValue getTemperatures(double *vals) override
Get temperature of all the motors.
yarp::dev::ReturnValue homingSingleJoint(int j) override
homingSingleJoint: call the homing procedure for a single joint
yarp::dev::ReturnValue isCalibratorDevicePresent(bool *isCalib) override
isCalibratorDevicePresent: check if a calibrator device has been set
yarp::dev::ReturnValue getTargetPositions(double *refs) override
Get the last position reference for all axes.
yarp::dev::ReturnValue quitCalibrate() override
quitCalibrate: interrupt the calibration procedure
yarp::dev::ReturnValue getPWM(int m, double *val) override
ControlBoardRemapper & operator=(ControlBoardRemapper &&)=delete
yarp::dev::ReturnValue getPidErrorLimit(const yarp::dev::PidControlTypeEnum &pidtype, int j, double *limit) override
Get the error limit for the controller on a specific joint.
yarp::dev::ReturnValue setEncoder(int j, double val) override
Set the value of the encoder for a given joint.
yarp::dev::ReturnValue getPidExtraInfo(const yarp::dev::PidControlTypeEnum &pidtype, int j, yarp::dev::PidExtraInfo &units) override
Get PID extra info and measurement units for a specific joint.
yarp::dev::ReturnValue getTrajSpeed(int j, double *ref) override
Get reference speed for a joint.
yarp::dev::ReturnValue homingWholePart() override
homingWholePart: call the homing procedure for a the whole part/device
yarp::dev::ReturnValue setTemperatureLimit(int m, const double val) override
Set the temperature limit for a specific motor.
yarp::dev::ReturnValue stop() override
Stop motion, multiple joints.
yarp::dev::ReturnValue setPosition(int j, double ref) override
Set new position for a single axis.
yarp::dev::ReturnValue checkMotionDone(int j, bool &flag) override
Check if the current trajectory is terminated.
yarp::dev::ReturnValue getCurrentRange(int m, double *min, double *max) override
Get the full scale of the current measurement for a given motor (e.g.
yarp::dev::ReturnValue setRefTorque(int j, double t) override
Set the reference value of the torque for a given joint.
yarp::dev::ReturnValue setPositions(const int n_joints, const int *joints, const double *dpos) override
Set new reference point for all axes.
yarp::dev::ReturnValue getMotorEncoderAcceleration(int m, double *acc) override
Read the instantaneous acceleration of a motor encoder.
yarp::dev::ReturnValue getMotorEncoderAccelerations(double *accs) override
Read the instantaneous acceleration of all motor encoders.
bool close() override
Close the device driver by deallocating all resources and closing ports.
yarp::dev::ReturnValue getEncodersTimed(double *encs, double *t) override
Read the instantaneous acceleration of all axes.
yarp::dev::ReturnValue getPWMLimit(int m, double *val) override
yarp::dev::ReturnValue getNominalCurrent(int m, double *val) override
ControlBoardRemapper()=default
yarp::dev::ReturnValue getAmpStatus(int *st) override
yarp::dev::ReturnValue getAvailableControlModes(int j, std::vector< yarp::dev::SelectableControlModeEnum > &avail) override
Return a list of available control mode for the given joint.
yarp::dev::ReturnValue getNumberOfMotorEncoders(int *num) override
Get the number of available motor encoders.
yarp::dev::ReturnValue getEncoderAccelerations(double *accs) override
Read the instantaneous acceleration of all axes.
ControlBoardRemapper & operator=(const ControlBoardRemapper &)=delete
yarp::dev::ReturnValue getControlModes(const std::vector< int > &joints, std::vector< yarp::dev::ControlModeEnum > &modes) override
Get the current control mode for a subset of axes.
yarp::dev::ReturnValue setPeakCurrent(int m, const double val) override
yarp::dev::ReturnValue calibrateAxisWithParams(int j, unsigned int ui, double v1, double v2, double v3) override
Start calibration, this method is very often platform specific.
yarp::dev::ReturnValue quitPark() override
quitPark: interrupt the park procedure
yarp::dev::ReturnValue setInteractionMode(int j, yarp::dev::InteractionModeEnum mode) override
Set the interaction mode of the robot, values can be stiff or compliant.
yarp::dev::ReturnValue setPidReference(const yarp::dev::PidControlTypeEnum &pidtype, int j, double ref) override
Set the controller reference for a given axis.
yarp::dev::ReturnValue getMotorTorqueParams(int j, yarp::dev::MotorTorqueParameters *params) override
Get a subset of motor parameters (bemf, ktau etc) useful for torque control.
yarp::dev::ReturnValue getPidOutput(const yarp::dev::PidControlTypeEnum &pidtype, int j, double *out) override
Get the output of the controller (e.g.
yarp::dev::ReturnValue setRefCurrent(int m, double curr) override
Set the reference value of the current for a single motor.
yarp::dev::ReturnValue getGearboxRatio(int m, double *val) override
Get the gearbox ratio for a specific motor.
yarp::dev::ReturnValue positionMove(int j, double ref) override
Set new reference point for a single axis.
yarp::dev::ReturnValue getAvailablePids(int j, std::vector< yarp::dev::PidControlTypeEnum > &avail) override
ControlBoard methods.
yarp::dev::ReturnValue getRemoteVariable(std::string key, yarp::os::Bottle &val) override
yarp::dev::ReturnValue getRefDutyCycles(double *refs) override
Gets the last reference sent using the setRefDutyCycles function.
yarp::dev::ReturnValue velocityMove(int j, double v) override
Start motion at a given speed, single joint.
yarp::dev::ReturnValue getEncoders(double *encs) override
Read the position of all axes.
yarp::dev::ReturnValue setMotorEncoder(int m, const double val) override
Set the value of the motor encoder for a given motor.
yarp::dev::ReturnValue getNumberOfMotors(int *num) override
Retrieves the number of controlled motors from the current physical interface.
yarp::dev::ReturnValue getMotorEncoder(int m, double *v) override
Read the value of a motor encoder.
yarp::dev::ReturnValue parkWholePart() override
parkWholePart: start the parking procedure for the whole part
yarp::dev::ReturnValue setPidFeedforward(const yarp::dev::PidControlTypeEnum &pidtype, int j, double v) override
Set the feedforward value for the specified PID controller.
yarp::dev::ReturnValue abortCalibration() override
yarp::dev::ReturnValue abortPark() override
yarp::dev::ReturnValue getInteractionMode(int j, yarp::dev::InteractionModeEnum &mode) override
Get the current interaction mode of the robot, values can be stiff or compliant.
yarp::dev::ReturnValue disablePid(const yarp::dev::PidControlTypeEnum &pidtype, int j) override
Disable the PID computation for a joint.
yarp::dev::ReturnValue getRefDutyCycle(int m, double *ref) override
Gets the last reference sent using the setRefDutyCycle function.
yarp::dev::ReturnValue getPidError(const yarp::dev::PidControlTypeEnum &pidtype, int j, double *err) override
Get the current error for a joint.
yarp::dev::ReturnValue getPidErrorLimits(const yarp::dev::PidControlTypeEnum &pidtype, double *limits) override
Get the error limit for all controllers.
yarp::dev::ReturnValue setRefCurrents(const double *currs) override
Set the reference value of the currents for all motors.
yarp::dev::ReturnValue getEncoderSpeeds(double *spds) override
Read the instantaneous speed of all axes.
yarp::dev::ReturnValue getPidReference(const yarp::dev::PidControlTypeEnum &pidtype, int j, double *ref) override
Get the current reference of the PID controller for a specific joint.
yarp::dev::ReturnValue calibrationDone(int j) override
Check if the calibration is terminated, on a particular joint.
yarp::dev::ReturnValue getMotorEncoderSpeeds(double *spds) override
Read the instantaneous speed of all motor encoders.
yarp::dev::ReturnValue getAxisName(int j, std::string &name) override
yarp::dev::ReturnValue setCalibrationParameters(int j, const yarp::dev::CalibrationParameters ¶ms) override
Start calibration, this method is very often platform specific.
yarp::dev::ReturnValue resetMotorEncoders() override
Reset motor encoders.
yarp::dev::ReturnValue getJointType(int j, yarp::dev::JointTypeEnum &type) override
yarp::dev::ReturnValue getTorqueRanges(double *min, double *max) override
Get the full scale of the torque sensors of all joints.
yarp::dev::ReturnValue getCurrents(double *currs) override
Get the instantaneous current measurement for all motors.
yarp::dev::ReturnValue enablePid(const yarp::dev::PidControlTypeEnum &pidtype, int j) override
Enable the PID computation for a joint.
yarp::dev::ReturnValue setImpedanceOffset(int j, double offset) override
Set current force Offset for a specific joint.
yarp::dev::ReturnValue getRefVelocity(const int jnt, double &vel) override
Get the last reference velocity set by setRefVelocity() for a single joint.
yarp::dev::ReturnValue setPid(const yarp::dev::PidControlTypeEnum &pidtype, int j, const yarp::dev::Pid &p) override
Set new PID value for a joint axis.
bool open(yarp::os::Searchable &prop) override
Open the device driver.
yarp::dev::ReturnValue setTrajAcceleration(int j, double acc) override
Set reference acceleration for a joint.
yarp::dev::IRemoteCalibrator * getCalibratorDevice() override
getCalibratorDevice: return the pointer stored with the setCalibratorDevice
yarp::dev::ReturnValue setPidErrorLimits(const yarp::dev::PidControlTypeEnum &pidtype, const double *limits) override
Get the error limit for the controller on all joints.
yarp::dev::ReturnValue setPidErrorLimit(const yarp::dev::PidControlTypeEnum &pidtype, int j, double limit) override
Set the error limit for the controller on a specific joint.
yarp::dev::ReturnValue getMotorEncodersTimed(double *encs, double *t) override
Read the instantaneous position of all motor encoders.
yarp::dev::ReturnValue enableAmp(int j) override
Enable the amplifier on a specific joint.
yarp::dev::ReturnValue getPidErrors(const yarp::dev::PidControlTypeEnum &pidtype, double *errs) override
Get the error of all joints.
yarp::dev::ReturnValue setNominalCurrent(int m, const double val) override
yarp::dev::ReturnValue setControlMode(int j, yarp::dev::SelectableControlModeEnum mode) override
Set the current control mode.
yarp::dev::ReturnValue getTorque(int j, double *t) override
Get the value of the torque on a given joint (this is the feedback if you have a torque sensor).
yarp::dev::ReturnValue isJointBraked(int j, bool &braked) const override
Check is the joint brake is currently active.
~ControlBoardRemapper() override=default
yarp::dev::ReturnValue calibrateSingleJoint(int j) override
calibrateSingleJoint: call the calibration procedure for the single joint
yarp::dev::ReturnValue getPowerSupplyVoltage(int m, double *val) override
yarp::dev::ReturnValue getTrajAccelerations(double *accs) override
Get reference acceleration of all joints.
yarp::dev::ReturnValue setVelLimits(int j, double min, double max) override
Set the software speed limits for a particular axis, the behavior of the control card when these limi...
yarp::dev::ReturnValue setImpedance(int j, double stiff, double damp) override
Set current impedance gains (stiffness,damping) for a specific joint.
bool detachAll() override
Detach the object (you must have first called attach).
yarp::dev::ReturnValue getControlMode(int j, yarp::dev::ControlModeEnum &mode) override
Get the current control mode.
yarp::dev::ReturnValue setMotorTorqueParams(int j, const yarp::dev::MotorTorqueParameters params) override
Set a subset of motor parameters (bemf, ktau etc) useful for torque control.
yarp::dev::ReturnValue relativeMove(int j, double delta) override
Set relative position.
yarp::dev::ReturnValue getVelLimits(int j, double *min, double *max) override
Get the software speed limits for a particular axis.
yarp::dev::ReturnValue resetEncoders() override
Reset encoders.
yarp::dev::ReturnValue getAxes(size_t &ax) override
Get the number of controlled axes.
yarp::dev::ReturnValue resetMotorEncoder(int m) override
Reset motor encoder, single motor.
yarp::dev::ReturnValue getTargetPosition(const int joint, double *ref) override
Get the last position reference for the specified axis.
yarp::dev::ReturnValue getRefCurrents(double *currs) override
Get the reference value of the currents for all motors.
yarp::dev::ReturnValue getMotorEncoderSpeed(int m, double *sp) override
Read the instantaneous speed of a motor encoder.
ControlBoardRemapper(const ControlBoardRemapper &)=delete
yarp::dev::ReturnValue getPidExtraInfos(const yarp::dev::PidControlTypeEnum &pidtype, std::vector< yarp::dev::PidExtraInfo > &units) override
Get PID extra info and measurement units for a specific joint.
yarp::dev::ReturnValue getImpedance(int j, double *stiff, double *damp) override
Get current impedance gains (stiffness,damping,offset) for a specific joint.
yarp::dev::ReturnValue getEncoderAcceleration(int j, double *acc) override
Read the instantaneous acceleration of an axis.
yarp::dev::ReturnValue setRefTorques(const double *t) override
Set the reference value of the torque for all joints.
yarp::dev::ReturnValue setPWMLimit(int m, const double val) override
yarp::os::Stamp getLastInputStamp() override
Return the time stamp relative to the last acquisition.
yarp::dev::ReturnValue getEncoder(int j, double *v) override
Read the value of an encoder.
yarp::dev::ReturnValue setGearboxRatio(int m, const double val) override
Set the gearbox ratio for a specific motor.
yarp::dev::ReturnValue getDutyCycles(double *vals) override
Gets the current dutycycle of the output of the amplifier (i.e.
yarp::dev::ReturnValue getCurrentImpedanceLimit(int j, double *min_stiff, double *max_stiff, double *min_damp, double *max_damp) override
Get the current impedance limits for a specific joint.
yarp::dev::ReturnValue setTrajAccelerations(const double *accs) override
Set reference acceleration on all joints.
yarp::dev::ReturnValue parkSingleJoint(int j, bool _wait=true) override
parkSingleJoint(): start the parking procedure for the single joint
yarp::dev::ReturnValue setMotorEncoders(const double *vals) override
Set the value of all motor encoders.
yarp::dev::ReturnValue getTemperatureLimit(int m, double *val) override
Retrieves the current temperature limit for a specific motor.
yarp::dev::ReturnValue getCurrent(int m, double *curr) override
Get the instantaneous current measurement for a single motor.
yarp::dev::ReturnValue setPidOffset(const yarp::dev::PidControlTypeEnum &pidtype, int j, double v) override
Set an offset value for a given controller.
yarp::dev::ReturnValue setInteractionModes(const std::vector< int > &joints, const std::vector< yarp::dev::InteractionModeEnum > &modes) override
Set the interaction mode of the robot for a set of joints, values can be stiff or compliant.
bool attachAll(const yarp::dev::PolyDriverList &l) override
Attach to a list of objects.
yarp::dev::ReturnValue disableAmp(int j) override
Disable the amplifier on a specific joint.
yarp::dev::ReturnValue getMotorEncoderCountsPerRevolution(int m, double *cpr) override
Gets number of counts per revolution for motor encoder m.
yarp::dev::ReturnValue resetEncoder(int j) override
Reset encoder, single joint.
yarp::dev::ReturnValue getAutoBrakeEnabled(int j, bool &enabled) const override
checks if the automatic joint brake mode is enabled or disabled.
yarp::dev::ReturnValue getPeakCurrent(int m, double *val) override
yarp::dev::ReturnValue setControlModes(const std::vector< int > &joints, const std::vector< yarp::dev::SelectableControlModeEnum > &modes) override
Set the current control mode for a subset of axes.
yarp::dev::ReturnValue getTorqueRange(int j, double *min, double *max) override
Get the full scale of the torque sensor of a given joint.
yarp::dev::ReturnValue getPids(const yarp::dev::PidControlTypeEnum &pidtype, yarp::dev::Pid *pids) override
Get current PID value for a specific joint.
yarp::dev::ReturnValue getCurrentRanges(double *min, double *max) override
Get the full scale of the current measurements for all motors motor (e.g.
yarp::dev::ReturnValue setAutoBrakeEnabled(int j, bool enabled) override
Enables/Disables the automatic joint brake.
yarp::dev::ReturnValue getPid(const yarp::dev::PidControlTypeEnum &pidtype, int j, yarp::dev::Pid *p) override
Get current PID value for a specific joint.
yarp::dev::ReturnValue getMotorEncoderTimed(int m, double *v, double *t) override
Read the instantaneous position of a motor encoder.
yarp::dev::ReturnValue setRefDutyCycles(const double *refs) override
Sets the reference dutycycle for all the motors.
yarp::dev::ReturnValue setTrajSpeed(int j, double sp) override
Set reference speed for a joint, this is the speed used during the interpolation of the trajectory.
ControlBoardRemapper(ControlBoardRemapper &&)=delete
yarp::dev::ReturnValue setPids(const yarp::dev::PidControlTypeEnum &pidtype, const yarp::dev::Pid *ps) override
Set new PID value on multiple axes.
yarp::dev::ReturnValue setPosLimits(int j, double min, double max) override
Set the software limits for a particular axis, the behavior of the control card when these limits are...
yarp::dev::ReturnValue getTemperature(int m, double *val) override
Get temperature of a motor.
yarp::dev::ReturnValue getRefPositions(double *refs) override
Get the last position reference for all axes.
yarp::dev::ReturnValue setRemoteVariable(std::string key, const yarp::os::Bottle &val) override
yarp::dev::ReturnValue getInteractionModes(const std::vector< int > &joints, std::vector< yarp::dev::InteractionModeEnum > &modes) override
Get the current interaction mode of the robot for a set of joints, values can be stiff or compliant.
yarp::dev::ReturnValue setMaxCurrent(int j, double v) override
yarp::dev::ReturnValue getMotorEncoders(double *encs) override
Read the position of all motor encoders.
yarp::dev::ReturnValue getMaxCurrent(int j, double *v) override
Returns the maximum electric current allowed for a given motor.
bool verbose() const
Return the value of the verbose flag.
yarp::dev::ReturnValue getEncoderTimed(int j, double *v, double *t) override
Read the instantaneous acceleration of all axes.
yarp::dev::ReturnValue getPidFeedforward(const yarp::dev::PidControlTypeEnum &pidtype, int j, double &v) override
Get the currently set feedforward value for the specified PID controller.
yarp::dev::ReturnValue getRefPosition(const int joint, double *ref) override
Get the last position reference for the specified axis.
yarp::dev::ReturnValue getPidOutputs(const yarp::dev::PidControlTypeEnum &pidtype, double *outs) override
Get the output of the controllers (e.g.
yarp::dev::ReturnValue getLastJointFault(int j, int &fault, std::string &message) override
yarp::dev::ReturnValue getDutyCycle(int m, double *val) override
Gets the current dutycycle of the output of the amplifier (i.e.
yarp::dev::ReturnValue setEncoders(const double *vals) override
Set the value of all encoders.
yarp::dev::ReturnValue isPidEnabled(const yarp::dev::PidControlTypeEnum &pidtype, int j, bool &enabled) override
Get the current status (enabled/disabled) of the PID.
yarp::dev::ReturnValue getEncoderSpeed(int j, double *sp) override
Read the istantaneous speed of an axis.
yarp::dev::ReturnValue setTrajSpeeds(const double *spds) override
Set reference speed on all joints.
yarp::dev::ReturnValue getRemoteVariablesList(yarp::os::Bottle *listOfKeys) override
yarp::dev::ReturnValue setPidReferences(const yarp::dev::PidControlTypeEnum &pidtype, const double *refs) override
Set the controller reference, multiple axes.
yarp::dev::ReturnValue setRefDutyCycle(int m, double ref) override
Sets the reference dutycycle to a single motor.
yarp::dev::ReturnValue setRefVelocity(int jnt, double vel) override
Set the velocity of single joint.
yarp::dev::ReturnValue resetPid(const yarp::dev::PidControlTypeEnum &pidtype, int j) override
Reset the controller of a given joint, usually sets the current status of the joint as the reference ...
yarp::dev::ReturnValue setMotorEncoderCountsPerRevolution(int m, const double cpr) override
Sets number of counts per revolution for motor encoder m.
yarp::dev::ReturnValue getTrajSpeeds(double *spds) override
Get reference speed of all joints.
yarp::dev::ReturnValue calibrateWholePart() override
calibrateWholePart: call the procedure for calibrating the whole device
yarp::dev::ReturnValue getRefTorque(int j, double *t) override
Get the reference value of the torque for a given joint.
yarp::dev::ReturnValue getRefCurrent(int m, double *curr) override
Get the reference value of the current for a single motor.
yarp::dev::ReturnValue getPidOffset(const yarp::dev::PidControlTypeEnum &pidtype, int j, double &v) override
Get the currently set offset value for the specified PID controller.
yarp::dev::ReturnValue getPosLimits(int j, double *min, double *max) override
Get the software limits for a particular axis.
yarp::dev::ReturnValue getTrajAcceleration(int j, double *acc) override
Get reference acceleration for a joint.
yarp::dev::ReturnValue getTorques(double *t) override
Get the value of the torque for all joints (this is the feedback if you have torque sensors).
yarp::dev::ReturnValue getRefTorques(double *refs) override
Get the reference value of the torque for all joints.
yarp::dev::ReturnValue setManualBrakeActive(int j, bool active) override
Enables/Disables manually the joint brake.
yarp::dev::ReturnValue getImpedanceOffset(int j, double *offset) override
Get current force Offset for a specific joint.
yarp::dev::ReturnValue getTargetVelocity(const int joint, double *vel) override
Get the last reference speed set by velocityMove for single joint.
Class storing the decomposition of all the axes in the Remapped ControlBoard in the SubControlBoard,...
Interface implemented by all device drivers.
Interface for control devices, amplifier commands.
Interface for getting information about specific axes, if available.
Interface for control devices, calibration commands.
Interface for control devices, commands to get/set position and velocity limits.
Interface for setting control mode in control board.
Interface for control boards implementing current control.
Control board, extend encoder interface with timestamps.
Interface for control boards implementing impedance control.
Interface settings the way the robot interacts with the environment: basic interaction types are Stif...
Interface for controlling a joint equipped with brakes (hardware or simulated).
Interface for getting info about the fault which may occur on a robot.
Control board, encoder interface.
Control board, encoder interface.
Interface for an object that can wrap/attach to to another.
Interface for controlling an axis, by sending directly a PWM reference signal to a motor.
Interface for a generic control board device implementing a PID controller, with scaled arguments.
Interface for a generic control board device implementing position control.
Interface for a generic control board device implementing position control.
IRemoteCalibrator interface is meant to remotize the access of the calibration device in order to all...
IRemoteVariables interface.
Interface for control boards implementing torque control.
Interface for control boards implementing velocity control.
Interface for control boards implementing direct velocity control.
Contains the parameters for a PID.
A simple collection of objects that can be described and transmitted in a portable way.
A class for storing options and configuration information.
A base class for nested structures that can be searched.
An abstraction for a time stamp and/or sequence number.
SelectableControlModeEnum