YARP
Yet Another Robot Platform
 
Loading...
Searching...
No Matches
ControlBoardRemappingEngine.h
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2006-2021 Istituto Italiano di Tecnologia (IIT)
3 * SPDX-License-Identifier: BSD-3-Clause
4 */
5
6#ifndef YARP_DEV_CONTROLBOARDREMAPPING_ENGINE_H
7#define YARP_DEV_CONTROLBOARDREMAPPING_ENGINE_H
8
9#include <yarp/os/Network.h>
10
12#include <yarp/dev/PolyDriver.h>
15#include <yarp/os/Semaphore.h>
17
18#include <string>
19#include <vector>
20
23
24#ifdef MSVC
25 #pragma warning(disable:4355)
26#endif
27
37 public yarp::dev::IMotor,
52{
53private:
54 std::vector<std::string> axesNames;
55 mutable RemappedControlBoards remappedControlBoards;
56
58 int controlledJoints{0};
59
61 bool _verb{false};
62
63 // Buffer data used to simplify implementation of multi joint methods
65
66 // Buffer data used for full controlboard methods
68
69 // Buffer data for multiple arbitrary joint methods
70 ControlBoardArbitraryAxesDecomposition selectedJointsBuffers;
71
72 /***
73 * Parse device options if networks option is passed
74 *
75 * This will fill the remappedDevices and controlledJoints attributes, while it
76 * leaves empty the axesNames attribute that will be then
77 * filled only at the attachAll method.
78 */
79 bool parseNetworks(const yarp::os::Property &prop);
80
84 bool attachAllUsingNetworks(const yarp::dev::PolyDriverList &l);
85
89 bool attachAllUsingAxesNames(const yarp::dev::PolyDriverList &l);
90
91protected:
96 void setNrOfControlledAxes(const size_t nrOfControlledAxes);
97 void setAxesNames(const std::vector<std::string>& axesNames);
98
99public:
105 ~ControlBoardRemappingEngine() override = default;
106
111 bool getVerbose() const { return _verb; }
112
116 void setVerbose(bool v) { _verb = v; }
117
118 bool detachAllDevices();
120
121 /* IPidControl */
122 yarp::dev::ReturnValue getAvailablePids(int j, std::vector<yarp::dev::PidControlTypeEnum>& avail) override;
123 yarp::dev::ReturnValue setPid(const yarp::dev::PidControlTypeEnum& pidtype,int j, const yarp::dev::Pid &p) override;
125 yarp::dev::ReturnValue setPidReference(const yarp::dev::PidControlTypeEnum& pidtype,int j, double ref) override;
126 yarp::dev::ReturnValue setPidReferences(const yarp::dev::PidControlTypeEnum& pidtype,const double *refs) override;
127 yarp::dev::ReturnValue setPidErrorLimit(const yarp::dev::PidControlTypeEnum& pidtype,int j, double limit) override;
128 yarp::dev::ReturnValue setPidErrorLimits(const yarp::dev::PidControlTypeEnum& pidtype,const double *limits) override;
129 yarp::dev::ReturnValue getPidError(const yarp::dev::PidControlTypeEnum& pidtype,int j, double *err) override;
130 yarp::dev::ReturnValue getPidErrors(const yarp::dev::PidControlTypeEnum& pidtype,double *errs) override;
131 yarp::dev::ReturnValue getPidOutput(const yarp::dev::PidControlTypeEnum& pidtype,int j, double *out) override;
132 yarp::dev::ReturnValue getPidOutputs(const yarp::dev::PidControlTypeEnum& pidtype,double *outs) override;
133 yarp::dev::ReturnValue setPidOffset(const yarp::dev::PidControlTypeEnum& pidtype,int j, double v) override;
134 yarp::dev::ReturnValue setPidFeedforward(const yarp::dev::PidControlTypeEnum& pidtype,int j, double v) override;
135 yarp::dev::ReturnValue getPidOffset(const yarp::dev::PidControlTypeEnum& pidtype,int j, double& v) override;
136 yarp::dev::ReturnValue getPidFeedforward(const yarp::dev::PidControlTypeEnum& pidtype,int j, double& v) override;
139 yarp::dev::ReturnValue getPidReference(const yarp::dev::PidControlTypeEnum& pidtype,int j, double *ref) override;
140 yarp::dev::ReturnValue getPidReferences(const yarp::dev::PidControlTypeEnum& pidtype,double *refs) override;
141 yarp::dev::ReturnValue getPidErrorLimit(const yarp::dev::PidControlTypeEnum& pidtype,int j, double *limit) override;
142 yarp::dev::ReturnValue getPidErrorLimits(const yarp::dev::PidControlTypeEnum& pidtype,double *limits) override;
146 yarp::dev::ReturnValue isPidEnabled(const yarp::dev::PidControlTypeEnum& pidtype, int j, bool& enabled) override;
148 yarp::dev::ReturnValue getPidExtraInfos(const yarp::dev::PidControlTypeEnum& pidtype, std::vector<yarp::dev::PidExtraInfo>& units) override;
149
150 /* IPositionControl */
151 yarp::dev::ReturnValue getAxes(size_t& ax) override;
152 yarp::dev::ReturnValue positionMove(int j, double ref) override;
153 yarp::dev::ReturnValue positionMove(const double *refs) override;
154 yarp::dev::ReturnValue positionMove(const int n_joints, const int *joints, const double *refs) override;
155 yarp::dev::ReturnValue getTargetPosition(const int joint, double *ref) override;
156 yarp::dev::ReturnValue getTargetPositions(double *refs) override;
157 yarp::dev::ReturnValue getTargetPositions(const int n_joint, const int *joints, double *refs) override;
158 yarp::dev::ReturnValue relativeMove(int j, double delta) override;
159 yarp::dev::ReturnValue relativeMove(const double *deltas) override;
160 yarp::dev::ReturnValue relativeMove(const int n_joints, const int *joints, const double *deltas) override;
161 yarp::dev::ReturnValue checkMotionDone(int j, bool& flag) override;
162 yarp::dev::ReturnValue checkMotionDone(bool& flag) override;
163 yarp::dev::ReturnValue checkMotionDone(const std::vector<int>& joints, bool& flags) override;
164 yarp::dev::ReturnValue setTrajSpeed(int j, double sp) override;
165 yarp::dev::ReturnValue setTrajSpeeds(const double *spds) override;
166 yarp::dev::ReturnValue setTrajSpeeds(const int n_joints, const int *joints, const double *spds) override;
167 yarp::dev::ReturnValue setTrajAcceleration(int j, double acc) override;
168 yarp::dev::ReturnValue setTrajAccelerations(const double *accs) override;
169 yarp::dev::ReturnValue setTrajAccelerations(const int n_joints, const int *joints, const double *accs) override;
170 yarp::dev::ReturnValue getTrajSpeed(int j, double *ref) override;
171 yarp::dev::ReturnValue getTrajSpeeds(double *spds) override;
172 yarp::dev::ReturnValue getTrajSpeeds(const int n_joints, const int *joints, double *spds) override;
173 yarp::dev::ReturnValue getTrajAcceleration(int j, double *acc) override;
174 yarp::dev::ReturnValue getTrajAccelerations(double *accs) override;
175 yarp::dev::ReturnValue getTrajAccelerations(const int n_joints, const int *joints, double *accs) override;
176 yarp::dev::ReturnValue stop(int j) override;
177 yarp::dev::ReturnValue stop() override;
178 yarp::dev::ReturnValue stop(const int n_joints, const int *joints) override;
179
180 /* IJointFault */
181 yarp::dev::ReturnValue getLastJointFault(int j, int& fault, std::string& message) override;
182
183 /* IVelocityControl */
184 yarp::dev::ReturnValue velocityMove(int j, double v) override;
185 yarp::dev::ReturnValue velocityMove(const double *v) override;
186
187 /* IEncoders */
188 yarp::dev::ReturnValue resetEncoder(int j) override;
190 yarp::dev::ReturnValue setEncoder(int j, double val) override;
191 yarp::dev::ReturnValue setEncoders(const double *vals) override;
192 yarp::dev::ReturnValue getEncoder(int j, double *v) override;
193 yarp::dev::ReturnValue getEncoders(double *encs) override;
194 yarp::dev::ReturnValue getEncodersTimed(double *encs, double *t) override;
195 yarp::dev::ReturnValue getEncoderTimed(int j, double *v, double *t) override;
196 yarp::dev::ReturnValue getEncoderSpeed(int j, double *sp) override;
197 yarp::dev::ReturnValue getEncoderSpeeds(double *spds) override;
198 yarp::dev::ReturnValue getEncoderAcceleration(int j, double *acc) override;
199 yarp::dev::ReturnValue getEncoderAccelerations(double *accs) override;
200
201 /* IMotorEncoders */
205 yarp::dev::ReturnValue setMotorEncoderCountsPerRevolution(int m, const double cpr) override;
207 yarp::dev::ReturnValue setMotorEncoder(int m, const double val) override;
208 yarp::dev::ReturnValue setMotorEncoders(const double *vals) override;
209 yarp::dev::ReturnValue getMotorEncoder(int m, double *v) override;
210 yarp::dev::ReturnValue getMotorEncoders(double *encs) override;
211 yarp::dev::ReturnValue getMotorEncodersTimed(double *encs, double *t) override;
212 yarp::dev::ReturnValue getMotorEncoderTimed(int m, double *v, double *t) override;
213 yarp::dev::ReturnValue getMotorEncoderSpeed(int m, double *sp) override;
214 yarp::dev::ReturnValue getMotorEncoderSpeeds(double *spds) override;
215 yarp::dev::ReturnValue getMotorEncoderAcceleration(int m, double *acc) override;
217
218 /* IAmplifierControl */
219 yarp::dev::ReturnValue enableAmp(int j) override;
220 yarp::dev::ReturnValue disableAmp(int j) override;
221 yarp::dev::ReturnValue getAmpStatus(int *st) override;
222 yarp::dev::ReturnValue getAmpStatus(int j, int *v) override;
223 yarp::dev::ReturnValue setMaxCurrent(int j, double v) override;
224 yarp::dev::ReturnValue getMaxCurrent(int j, double *v) override;
225 yarp::dev::ReturnValue getNominalCurrent(int m, double *val) override;
226 yarp::dev::ReturnValue setNominalCurrent(int m, const double val) override;
227 yarp::dev::ReturnValue getPeakCurrent(int m, double *val) override;
228 yarp::dev::ReturnValue setPeakCurrent(int m, const double val) override;
229 yarp::dev::ReturnValue getPWM(int m, double *val) override;
230 yarp::dev::ReturnValue getPWMLimit(int m, double *val) override;
231 yarp::dev::ReturnValue setPWMLimit(int m, const double val) override;
232 yarp::dev::ReturnValue getPowerSupplyVoltage(int m, double *val) override;
233
234 /* IControlLimits */
235 yarp::dev::ReturnValue setPosLimits(int j, double min, double max) override;
236 yarp::dev::ReturnValue getPosLimits(int j, double *min, double *max) override;
237 yarp::dev::ReturnValue setVelLimits(int j, double min, double max) override;
238 yarp::dev::ReturnValue getVelLimits(int j, double *min, double *max) override;
239
240 /* IRemoteVariables */
241 yarp::dev::ReturnValue getRemoteVariable(std::string key, yarp::os::Bottle &val) override;
242 yarp::dev::ReturnValue setRemoteVariable(std::string key, const yarp::os::Bottle &val) override;
244
245 /* IRemoteCalibrator */
252 yarp::dev::ReturnValue parkSingleJoint(int j, bool _wait = true) override;
256
257 /* IControlCalibration */
258 yarp::dev::ReturnValue calibrateAxisWithParams(int j, unsigned int ui, double v1, double v2, double v3) override;
263
264 /* IMotor */
265 yarp::dev::ReturnValue getNumberOfMotors(int *num) override;
266 yarp::dev::ReturnValue getTemperature(int m, double *val) override;
267 yarp::dev::ReturnValue getTemperatures(double *vals) override;
268 yarp::dev::ReturnValue getTemperatureLimit(int m, double *val) override;
269 yarp::dev::ReturnValue setTemperatureLimit(int m, const double val) override;
270 yarp::dev::ReturnValue getGearboxRatio(int m, double *val) override;
271 yarp::dev::ReturnValue setGearboxRatio(int m, const double val) override;
272
273 /* IAxisInfo */
274 yarp::dev::ReturnValue getAxisName(int j, std::string &name) override;
276
277 /* ITorqueControl */
278 yarp::dev::ReturnValue getRefTorques(double *refs) override;
279 yarp::dev::ReturnValue getRefTorque(int j, double *t) override;
280 yarp::dev::ReturnValue setRefTorques(const double *t) override;
281 yarp::dev::ReturnValue setRefTorque(int j, double t) override;
282 yarp::dev::ReturnValue setRefTorques(const int n_joint, const int *joints, const double *t) override;
285 yarp::dev::ReturnValue setImpedance(int j, double stiff, double damp) override;
286 yarp::dev::ReturnValue setImpedanceOffset(int j, double offset) override;
287 yarp::dev::ReturnValue getTorque(int j, double *t) override;
288 yarp::dev::ReturnValue getTorques(double *t) override;
289 yarp::dev::ReturnValue getTorqueRange(int j, double *min, double *max) override;
290 yarp::dev::ReturnValue getTorqueRanges(double *min, double *max) override;
291 yarp::dev::ReturnValue getImpedance(int j, double *stiff, double *damp) override;
292 yarp::dev::ReturnValue getImpedanceOffset(int j, double *offset) override;
293 yarp::dev::ReturnValue getCurrentImpedanceLimit(int j, double *min_stiff, double *max_stiff, double *min_damp, double *max_damp) override;
294
295 // IControlMode interface
296 yarp::dev::ReturnValue getAvailableControlModes(int j, std::vector<yarp::dev::SelectableControlModeEnum>& avail) override;
298 yarp::dev::ReturnValue getControlModes(const std::vector<int>& joints, std::vector<yarp::dev::ControlModeEnum>& modes) override;
299 yarp::dev::ReturnValue getControlModes(std::vector<yarp::dev::ControlModeEnum>& mode) override;
301 yarp::dev::ReturnValue setControlModes(const std::vector<int>& joints, const std::vector<yarp::dev::SelectableControlModeEnum>& modes) override;
302 yarp::dev::ReturnValue setControlModes(const std::vector<yarp::dev::SelectableControlModeEnum>& mode) override;
303
304 // IPositionDirect interface
305 yarp::dev::ReturnValue setPosition(int j, double ref) override;
306 yarp::dev::ReturnValue setPositions(const int n_joints, const int *joints, const double *dpos) override;
307 yarp::dev::ReturnValue setPositions(const double *refs) override;
308 yarp::dev::ReturnValue getRefPosition(const int joint, double *ref) override;
309 yarp::dev::ReturnValue getRefPositions(double *refs) override;
310 yarp::dev::ReturnValue getRefPositions(const int n_joint, const int *joints, double *refs) override;
311
313
314 // IVelocityControl interface
315 yarp::dev::ReturnValue velocityMove(const int n_joints, const int *joints, const double *spds) override;
316 yarp::dev::ReturnValue getTargetVelocity(const int joint, double *vel) override;
317 yarp::dev::ReturnValue getTargetVelocities(double *vels) override;
318 yarp::dev::ReturnValue getTargetVelocities(const int n_joint, const int *joints, double *vels) override;
320 yarp::dev::ReturnValue getInteractionModes(const std::vector<int>& joints, std::vector<yarp::dev::InteractionModeEnum>& modes) override;
321 yarp::dev::ReturnValue getInteractionModes(std::vector <yarp::dev::InteractionModeEnum>& modes) override;
323 yarp::dev::ReturnValue setInteractionModes(const std::vector<int>& joints, const std::vector<yarp::dev::InteractionModeEnum>& modes) override;
324 yarp::dev::ReturnValue setInteractionModes(const std::vector < yarp::dev::InteractionModeEnum>& modes) override;
325
326 // IPWMControl
327 yarp::dev::ReturnValue setRefDutyCycle(int m, double ref) override;
328 yarp::dev::ReturnValue setRefDutyCycles(const double *refs) override;
329 yarp::dev::ReturnValue getRefDutyCycle(int m, double *ref) override;
330 yarp::dev::ReturnValue getRefDutyCycles(double *refs) override;
331 yarp::dev::ReturnValue getDutyCycle(int m, double *val) override;
332 yarp::dev::ReturnValue getDutyCycles(double *vals) override;
333
334 // ICurrentControl
335 yarp::dev::ReturnValue getCurrent(int m, double *curr) override;
336 yarp::dev::ReturnValue getCurrents(double *currs) override;
337 yarp::dev::ReturnValue getCurrentRange(int m, double *min, double *max) override;
338 yarp::dev::ReturnValue getCurrentRanges(double *min, double *max) override;
339 yarp::dev::ReturnValue setRefCurrents(const double *currs) override;
340 yarp::dev::ReturnValue setRefCurrent(int m, double curr) override;
341 yarp::dev::ReturnValue setRefCurrents(const int n_motor, const int *motors, const double *currs) override;
342 yarp::dev::ReturnValue getRefCurrents(double *currs) override;
343 yarp::dev::ReturnValue getRefCurrent(int m, double *curr) override;
344
345 // IJointBrake
346 yarp::dev::ReturnValue isJointBraked(int j, bool& braked) const override;
347 yarp::dev::ReturnValue setManualBrakeActive(int j, bool active) override;
348 yarp::dev::ReturnValue setAutoBrakeEnabled(int j, bool enabled) override;
349 yarp::dev::ReturnValue getAutoBrakeEnabled(int j, bool& enabled) const override;
350
351 // IVelocityDirect
352 yarp::dev::ReturnValue setRefVelocity(int jnt, double vel) override;
353 yarp::dev::ReturnValue setRefVelocity(const std::vector<double>& vels) override;
354 yarp::dev::ReturnValue setRefVelocity(const std::vector<int>& jnts, const std::vector<double>& vels) override;
355 yarp::dev::ReturnValue getRefVelocity(const int jnt, double& vel) override;
356 yarp::dev::ReturnValue getRefVelocity(std::vector<double>& vels) override;
357 yarp::dev::ReturnValue getRefVelocity(const std::vector<int>& jnts, std::vector<double>& vels) override;
358};
359
360#endif // YARP_DEV_CONTROLBOARDREMAPPING_ENGINE_H
define control board standard interfaces
FeatureMode mode
Class storing the decomposition of a subset of the total remapped axes of the remapped controlboard i...
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 positionMove(int j, double ref) override
Set new reference point for a single axis.
yarp::dev::ReturnValue getImpedanceOffset(int j, double *offset) override
Get current force Offset for a specific joint.
yarp::dev::ReturnValue resetEncoders() override
Reset encoders.
yarp::dev::ReturnValue getRemoteVariablesList(yarp::os::Bottle *listOfKeys) override
yarp::dev::ReturnValue getTrajAcceleration(int j, double *acc) override
Get reference acceleration for a joint.
yarp::dev::ReturnValue getTemperature(int m, double *val) override
Get temperature of a motor.
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 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 setPidErrorLimits(const yarp::dev::PidControlTypeEnum &pidtype, const double *limits) override
Get the error limit for the controller on all joints.
bool getVerbose() const
Return the value of the verbose flag.
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 calibrateWholePart() override
calibrateWholePart: call the procedure for calibrating the whole device
yarp::dev::ReturnValue getMotorEncoders(double *encs) override
Read the position of all motor encoders.
yarp::dev::IRemoteCalibrator * getCalibratorDevice() override
getCalibratorDevice: return the pointer stored with the setCalibratorDevice
yarp::dev::ReturnValue getPidOutput(const yarp::dev::PidControlTypeEnum &pidtype, int j, double *out) override
Get the output of the controller (e.g.
ControlBoardRemappingEngine(const ControlBoardRemappingEngine &)=delete
yarp::dev::ReturnValue getPWM(int m, double *val) override
yarp::dev::ReturnValue setMaxCurrent(int j, double v) override
yarp::dev::ReturnValue getRefDutyCycles(double *refs) override
Gets the last reference sent using the setRefDutyCycles function.
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 getEncoderTimed(int j, double *v, double *t) override
Read the instantaneous acceleration of all axes.
yarp::dev::ReturnValue getControlMode(int j, yarp::dev::ControlModeEnum &mode) override
Get the current control mode.
yarp::dev::ReturnValue setCalibrationParameters(int j, const yarp::dev::CalibrationParameters &params) override
Start calibration, this method is very often platform specific.
yarp::dev::ReturnValue getMotorEncoderSpeed(int m, double *sp) override
Read the instantaneous speed of a motor encoder.
yarp::dev::ReturnValue getPosLimits(int j, double *min, double *max) override
Get the software limits for a particular axis.
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 setRefDutyCycle(int m, double ref) override
Sets the reference dutycycle to a single motor.
yarp::dev::ReturnValue setNominalCurrent(int m, const double val) override
yarp::dev::ReturnValue getTemperatures(double *vals) override
Get temperature of all the motors.
yarp::dev::ReturnValue setTrajSpeeds(const double *spds) override
Set reference speed on all joints.
ControlBoardRemappingEngine(ControlBoardRemappingEngine &&)=delete
yarp::dev::ReturnValue getNominalCurrent(int m, double *val) override
yarp::dev::ReturnValue getCurrent(int m, double *curr) override
Get the instantaneous current measurement for a single motor.
yarp::dev::ReturnValue getAmpStatus(int *st) override
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 setPeakCurrent(int m, const double val) override
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 getPids(const yarp::dev::PidControlTypeEnum &pidtype, yarp::dev::Pid *pids) override
Get current PID value for a specific joint.
yarp::dev::ReturnValue disableAmp(int j) override
Disable the amplifier on a specific joint.
yarp::dev::ReturnValue getNumberOfMotorEncoders(int *num) override
Get the number of available motor encoders.
yarp::dev::ReturnValue setControlMode(int j, yarp::dev::SelectableControlModeEnum mode) override
Set the current control mode.
yarp::dev::ReturnValue getEncoderAcceleration(int j, double *acc) override
Read the instantaneous acceleration of an axis.
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 getRefCurrents(double *currs) override
Get the reference value of the currents for all motors.
yarp::dev::ReturnValue setAutoBrakeEnabled(int j, bool enabled) override
Enables/Disables the automatic joint brake.
yarp::dev::ReturnValue getTemperatureLimit(int m, double *val) override
Retrieves the current temperature limit for a specific motor.
yarp::dev::ReturnValue getRefPosition(const int joint, double *ref) override
Get the last position reference for the specified axis.
void setAxesNames(const std::vector< std::string > &axesNames)
yarp::dev::ReturnValue getLastJointFault(int j, int &fault, std::string &message) override
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 setPids(const yarp::dev::PidControlTypeEnum &pidtype, const yarp::dev::Pid *ps) override
Set new PID value on multiple axes.
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.
yarp::dev::ReturnValue abortPark() override
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 getRefTorque(int j, double *t) override
Get the reference value of the torque for a given joint.
yarp::dev::ReturnValue getTorqueRanges(double *min, double *max) override
Get the full scale of the torque sensors of all joints.
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 homingSingleJoint(int j) override
homingSingleJoint: call the homing procedure for a single joint
yarp::dev::ReturnValue enableAmp(int j) override
Enable the amplifier on a specific 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 getMotorEncoder(int m, double *v) override
Read the value of a motor encoder.
yarp::dev::ReturnValue getTargetVelocities(double *vels) override
Get the last reference speed set by velocityMove for all joints.
yarp::dev::ReturnValue parkSingleJoint(int j, bool _wait=true) override
parkSingleJoint(): start the parking procedure for the single joint
yarp::dev::ReturnValue getTrajSpeed(int j, double *ref) override
Get reference speed for a joint.
yarp::dev::ReturnValue getTargetVelocity(const int joint, double *vel) override
Get the last reference speed set by velocityMove for single joint.
yarp::dev::ReturnValue setEncoders(const double *vals) override
Set the value of all encoders.
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 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 getEncoderSpeed(int j, double *sp) override
Read the istantaneous speed of an axis.
yarp::dev::ReturnValue getRefCurrent(int m, double *curr) override
Get the reference value of the current for a single motor.
yarp::dev::ReturnValue getRemoteVariable(std::string key, yarp::os::Bottle &val) override
yarp::dev::ReturnValue getAutoBrakeEnabled(int j, bool &enabled) const override
checks if the automatic joint brake mode is enabled or disabled.
yarp::dev::ReturnValue setPWMLimit(int m, const double val) override
yarp::dev::ReturnValue calibrationDone(int j) override
Check if the calibration is terminated, on a particular joint.
yarp::dev::ReturnValue parkWholePart() override
parkWholePart: start the parking procedure for the whole part
yarp::dev::ReturnValue getPidError(const yarp::dev::PidControlTypeEnum &pidtype, int j, double *err) override
Get the current error for a joint.
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 getRefTorques(double *refs) override
Get the reference value of the torque for all joints.
yarp::dev::ReturnValue isJointBraked(int j, bool &braked) const override
Check is the joint brake is currently active.
yarp::dev::ReturnValue getJointType(int j, yarp::dev::JointTypeEnum &type) override
yarp::dev::ReturnValue getTargetPosition(const int joint, double *ref) override
Get the last position reference for the specified axis.
ControlBoardRemappingEngine & operator=(ControlBoardRemappingEngine &&)=delete
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 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 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 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 getPeakCurrent(int m, double *val) override
yarp::dev::ReturnValue getRefPositions(double *refs) override
Get the last position reference for all axes.
yarp::dev::ReturnValue setManualBrakeActive(int j, bool active) override
Enables/Disables manually the joint brake.
yarp::dev::ReturnValue setPidReferences(const yarp::dev::PidControlTypeEnum &pidtype, const double *refs) override
Set the controller reference, multiple axes.
yarp::dev::ReturnValue setGearboxRatio(int m, const double val) override
Set the gearbox ratio for a specific motor.
yarp::dev::ReturnValue getAxisName(int j, std::string &name) override
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.
yarp::dev::ReturnValue setTrajAccelerations(const double *accs) override
Set reference acceleration on all joints.
yarp::dev::ReturnValue getPidErrors(const yarp::dev::PidControlTypeEnum &pidtype, double *errs) override
Get the error of all joints.
yarp::dev::ReturnValue getGearboxRatio(int m, double *val) override
Get the gearbox ratio for a specific motor.
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 getAxes(size_t &ax) override
Get the number of controlled axes.
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 enablePid(const yarp::dev::PidControlTypeEnum &pidtype, int j) override
Enable the PID computation for a joint.
yarp::dev::ReturnValue getMotorEncoderCountsPerRevolution(int m, double *cpr) override
Gets number of counts per revolution for motor encoder m.
yarp::dev::ReturnValue setMotorEncoder(int m, const double val) override
Set the value of the motor encoder for a given motor.
yarp::dev::ReturnValue quitPark() override
quitPark: interrupt the park procedure
yarp::dev::ReturnValue getMotorEncoderTimed(int m, double *v, double *t) override
Read the instantaneous position of a motor encoder.
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 getEncodersTimed(double *encs, double *t) override
Read the instantaneous acceleration of all axes.
~ControlBoardRemappingEngine() override=default
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 setRefTorque(int j, double t) override
Set the reference value of the torque for a given joint.
yarp::dev::ReturnValue calibrateSingleJoint(int j) override
calibrateSingleJoint: call the calibration procedure for the single joint
yarp::dev::ReturnValue getPWMLimit(int m, double *val) override
yarp::dev::ReturnValue stop() override
Stop motion, multiple joints.
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 homingWholePart() override
homingWholePart: call the homing procedure for a the whole part/device
yarp::dev::ReturnValue resetMotorEncoders() override
Reset motor encoders.
yarp::dev::ReturnValue setMotorEncoderCountsPerRevolution(int m, const double cpr) override
Sets number of counts per revolution for motor encoder m.
yarp::dev::ReturnValue setRefVelocity(int jnt, double vel) override
Set the velocity of single joint.
yarp::dev::ReturnValue getDutyCycle(int m, double *val) override
Gets the current dutycycle of the output of the amplifier (i.e.
yarp::dev::ReturnValue getMotorEncoderAccelerations(double *accs) override
Read the instantaneous acceleration of all motor encoders.
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 setRefTorques(const double *t) override
Set the reference value of the torque for all joints.
ControlBoardRemappingEngine & operator=(const ControlBoardRemappingEngine &)=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 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 getCurrents(double *currs) override
Get the instantaneous current measurement for all motors.
yarp::dev::ReturnValue disablePid(const yarp::dev::PidControlTypeEnum &pidtype, int j) override
Disable the PID computation for a joint.
yarp::dev::ReturnValue isCalibratorDevicePresent(bool *isCalib) override
isCalibratorDevicePresent: check if a calibrator device has been set
yarp::dev::ReturnValue getPidErrorLimits(const yarp::dev::PidControlTypeEnum &pidtype, double *limits) override
Get the error limit for all controllers.
yarp::dev::ReturnValue resetMotorEncoder(int m) override
Reset motor encoder, single motor.
yarp::dev::ReturnValue getMaxCurrent(int j, double *v) override
Returns the maximum electric current allowed for a given motor.
yarp::dev::ReturnValue quitCalibrate() override
quitCalibrate: interrupt the calibration procedure
yarp::dev::ReturnValue setRemoteVariable(std::string key, const yarp::os::Bottle &val) override
void setVerbose(bool v)
Set the value of the verbose flag.
yarp::dev::ReturnValue getTrajAccelerations(double *accs) override
Get reference acceleration of all joints.
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.
bool attachAllDevices(const yarp::dev::PolyDriverList &l)
yarp::dev::ReturnValue getEncoderSpeeds(double *spds) override
Read the instantaneous speed of all axes.
yarp::dev::ReturnValue setEncoder(int j, double val) override
Set the value of the encoder for a given joint.
yarp::dev::ReturnValue getPidOutputs(const yarp::dev::PidControlTypeEnum &pidtype, double *outs) override
Get the output of the controllers (e.g.
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 getMotorEncodersTimed(double *encs, double *t) override
Read the instantaneous position of all motor encoders.
void setNrOfControlledAxes(const size_t nrOfControlledAxes)
Set the number of controlled axes, resizing appropriately all the necessary buffers.
yarp::dev::ReturnValue getRefDutyCycle(int m, double *ref) override
Gets the last reference sent using the setRefDutyCycle function.
yarp::os::Stamp getLastInputStamp() override
Return the time stamp relative to the last acquisition.
yarp::dev::ReturnValue getPidReferences(const yarp::dev::PidControlTypeEnum &pidtype, double *refs) override
Get the current reference of all PID controllers.
yarp::dev::ReturnValue setImpedanceOffset(int j, double offset) override
Set current force Offset for a specific joint.
yarp::dev::ReturnValue setTemperatureLimit(int m, const double val) override
Set the temperature limit for a specific motor.
yarp::dev::ReturnValue abortCalibration() override
yarp::dev::ReturnValue getMotorEncoderSpeeds(double *spds) override
Read the instantaneous speed of all motor encoders.
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 setImpedance(int j, double stiff, double damp) override
Set current impedance gains (stiffness,damping) for a specific joint.
yarp::dev::ReturnValue getTrajSpeeds(double *spds) override
Get reference speed of all joints.
yarp::dev::ReturnValue getTargetPositions(double *refs) override
Get the last position reference for all axes.
yarp::dev::ReturnValue getPowerSupplyVoltage(int m, double *val) override
yarp::dev::ReturnValue getEncoders(double *encs) override
Read the position of all axes.
yarp::dev::ReturnValue getNumberOfMotors(int *num) override
Retrieves the number of controlled motors from the current physical interface.
yarp::dev::ReturnValue setTrajAcceleration(int j, double acc) override
Set reference acceleration for a joint.
yarp::dev::ReturnValue getMotorEncoderAcceleration(int m, double *acc) override
Read the instantaneous acceleration of a motor encoder.
yarp::dev::ReturnValue getEncoderAccelerations(double *accs) override
Read the instantaneous acceleration of all axes.
yarp::dev::ReturnValue setRefCurrents(const double *currs) override
Set the reference value of the currents for all motors.
yarp::dev::ReturnValue setPosition(int j, double ref) override
Set new position for a single axis.
yarp::dev::ReturnValue velocityMove(int j, double v) override
Start motion at a given speed, single joint.
yarp::dev::ReturnValue checkMotionDone(int j, bool &flag) override
Check if the current trajectory is terminated.
yarp::dev::ReturnValue resetEncoder(int j) override
Reset encoder, single joint.
yarp::dev::ReturnValue getAvailablePids(int j, std::vector< yarp::dev::PidControlTypeEnum > &avail) override
ControlBoard methods.
yarp::dev::ReturnValue setRefDutyCycles(const double *refs) override
Sets the reference dutycycle for all the motors.
yarp::dev::ReturnValue getVelLimits(int j, double *min, double *max) override
Get the software speed limits for a particular axis.
yarp::dev::ReturnValue getEncoder(int j, double *v) override
Read the value of an encoder.
yarp::dev::ReturnValue setRefCurrent(int m, double curr) override
Set the reference value of the current for a single motor.
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.
yarp::dev::ReturnValue relativeMove(int j, double delta) override
Set relative position.
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 setMotorEncoders(const double *vals) override
Set the value of all motor encoders.
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 getDutyCycles(double *vals) override
Gets the current dutycycle of the output of the amplifier (i.e.
Class storing the decomposition of all the axes in the Remapped ControlBoard in the SubControlBoard,...
Interface for control devices, amplifier commands.
Interface for getting information about specific axes, if available.
Definition IAxisInfo.h:37
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).
Definition IJointBrake.h:23
Interface for getting info about the fault which may occur on a robot.
Definition IJointFault.h:24
Control board, encoder interface.
Control board, encoder interface.
Definition IMotor.h:95
Interface for controlling an axis, by sending directly a PWM reference signal to a motor.
Definition IPWMControl.h:24
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.
Definition Bottle.h:64
A class for storing options and configuration information.
Definition Property.h:32
An abstraction for a time stamp and/or sequence number.
Definition Stamp.h:18
SelectableControlModeEnum
PidControlTypeEnum
Definition PidEnums.h:15