YARP
Yet Another Robot Platform
 
Loading...
Searching...
No Matches
ControlBoard_nwc_yarp.h
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2026-2026 Istituto Italiano di Tecnologia (IIT)
3 * SPDX-License-Identifier: BSD-3-Clause
4 */
5
6#ifndef YARP_DEV_CONTROLBOARD_NWC_YARP_H
7#define YARP_DEV_CONTROLBOARD_NWC_YARP_H
8
9#include <yarp/sig/Vector.h>
10
16#include <yarp/dev/IMotor.h>
19#include <yarp/dev/IAxisInfo.h>
35
37
38#include "stateExtendedReader.h"
40#include "ControlBoardMsgs.h"
41
43
44
62 public yarp::dev::IMotor,
82{
83protected:
87
90
91 //this map contains info if the connected device implements a specific interface
92 std::map<std::string, bool> m_device_has_interfaces;
93
94 // Buffer associated to the extendedOutputStatePort port; in this case we will use the type generated
95 // from the YARP .thrift file
96 StateExtendedInputPort extendedIntputStatePort; // Buffered port storing new data
98 yarp::dev::JointStateData last_singleJoint; // tmp to store last received data for a particular joint
99 yarp::dev::JointStateData last_wholePart; // tmp to store last received data for whole part
100
101 mutable Stamp m_lastStamp; //this is shared among all calls that read encoders
102 size_t m_nj{0};
103 bool m_njIsKnown{false};
104
106
107 // Check for number of joints, if needed.
108 // This is to allow for delayed connection to the remote control board.
109 bool isLive();
110
111public:
117 ~ControlBoard_nwc_yarp() override = default;
118
119 bool open(Searchable& config) override;
120
125 bool close() override;
126
127 yarp::dev::ReturnValue getAxes(size_t& ax) override;
128
129 // IPidControl
130 yarp::dev::ReturnValue getAvailablePids(int j, std::vector<yarp::dev::PidControlTypeEnum>& avail) override;
131 yarp::dev::ReturnValue setPid(const PidControlTypeEnum& pidtype, int j, const Pid &pid) override;
132 yarp::dev::ReturnValue setPids(const PidControlTypeEnum& pidtype, const Pid *pids) override;
133 yarp::dev::ReturnValue setPidReference(const PidControlTypeEnum& pidtype, int j, double ref) override;
134 yarp::dev::ReturnValue setPidReferences(const PidControlTypeEnum& pidtype, const double *refs) override;
135 yarp::dev::ReturnValue setPidErrorLimit(const PidControlTypeEnum& pidtype, int j, double limit) override;
136 yarp::dev::ReturnValue setPidErrorLimits(const PidControlTypeEnum& pidtype, const double *limits) override;
137 yarp::dev::ReturnValue getPidError(const PidControlTypeEnum& pidtype, int j, double *err) override;
138 yarp::dev::ReturnValue getPidErrors(const PidControlTypeEnum& pidtype, double *errs) override;
139 yarp::dev::ReturnValue getPid(const PidControlTypeEnum& pidtype, int j, Pid *pid) override;
140 yarp::dev::ReturnValue getPids(const PidControlTypeEnum& pidtype, Pid *pids) override;
141 yarp::dev::ReturnValue getPidReference(const PidControlTypeEnum& pidtype, int j, double *ref) override;
142 yarp::dev::ReturnValue getPidReferences(const PidControlTypeEnum& pidtype, double *refs) override;
143 yarp::dev::ReturnValue getPidErrorLimit(const PidControlTypeEnum& pidtype, int j, double *limit) override;
144 yarp::dev::ReturnValue getPidErrorLimits(const PidControlTypeEnum& pidtype, double *limits) override;
145 yarp::dev::ReturnValue resetPid(const PidControlTypeEnum& pidtype, int j) override;
146 yarp::dev::ReturnValue disablePid(const PidControlTypeEnum& pidtype, int j) override;
147 yarp::dev::ReturnValue enablePid(const PidControlTypeEnum& pidtype, int j) override;
148 yarp::dev::ReturnValue isPidEnabled(const PidControlTypeEnum& pidtype, int j, bool& enabled) override;
149 yarp::dev::ReturnValue getPidOutput(const PidControlTypeEnum& pidtype, int j, double *out) override;
150 yarp::dev::ReturnValue getPidOutputs(const PidControlTypeEnum& pidtype, double *outs) override;
151 yarp::dev::ReturnValue setPidOffset(const PidControlTypeEnum& pidtype, int j, double v) override;
152 yarp::dev::ReturnValue setPidFeedforward(const PidControlTypeEnum& pidtype, int j, double v) override;
153 yarp::dev::ReturnValue getPidOffset(const PidControlTypeEnum& pidtype, int j, double& v) override;
154 yarp::dev::ReturnValue getPidFeedforward(const PidControlTypeEnum& pidtype, int j, double& v) override;
156 yarp::dev::ReturnValue getPidExtraInfos(const PidControlTypeEnum& pidtype, std::vector<PidExtraInfo>& info) override;
157
158 // IEncoder
159 yarp::dev::ReturnValue resetEncoder(int j) override;
161 yarp::dev::ReturnValue setEncoder(int j, double val) override;
162 yarp::dev::ReturnValue setEncoders(const double *vals) override;
163 yarp::dev::ReturnValue getEncoder(int j, double *v) override;
164 yarp::dev::ReturnValue getEncoderTimed(int j, double *v, double *t) override;
165 yarp::dev::ReturnValue getEncoders(double *encs) override;
166 yarp::dev::ReturnValue getEncodersTimed(double *encs, double *ts) override;
167 yarp::dev::ReturnValue getEncoderSpeed(int j, double *sp) override;
168 yarp::dev::ReturnValue getEncoderSpeeds(double *spds) override;
169 yarp::dev::ReturnValue getEncoderAcceleration(int j, double *acc) override;
170 yarp::dev::ReturnValue getEncoderAccelerations(double *accs) override;
171
172 // IRemoteVariable
173 yarp::dev::ReturnValue getRemoteVariable(std::string key, yarp::os::Bottle& val) override;
174 yarp::dev::ReturnValue setRemoteVariable(std::string key, const yarp::os::Bottle& val) override;
176
177 // IMotor
178 yarp::dev::ReturnValue getNumberOfMotors(int *num) override;
179 yarp::dev::ReturnValue getTemperature(int m, double* val) override;
180 yarp::dev::ReturnValue getTemperatures(double *vals) override;
181 yarp::dev::ReturnValue getTemperatureLimit (int m, double* val) override;
182 yarp::dev::ReturnValue setTemperatureLimit (int m, const double val) override;
183 yarp::dev::ReturnValue getGearboxRatio(int m, double* val) override;
184 yarp::dev::ReturnValue setGearboxRatio(int m, const double val) override;
185
186 // IMotorEncoder
189 yarp::dev::ReturnValue setMotorEncoder(int j, const double val) override;
190 yarp::dev::ReturnValue setMotorEncoderCountsPerRevolution(int m, const double cpr) override;
192 yarp::dev::ReturnValue setMotorEncoders(const double *vals) override;
193 yarp::dev::ReturnValue getMotorEncoder(int j, double *v) override;
194 yarp::dev::ReturnValue getMotorEncoderTimed(int j, double *v, double *t) override;
195 yarp::dev::ReturnValue getMotorEncoders(double *encs) override;
196 yarp::dev::ReturnValue getMotorEncodersTimed(double *encs, double *ts) override;
197 yarp::dev::ReturnValue getMotorEncoderSpeed(int j, double *sp) override;
198 yarp::dev::ReturnValue getMotorEncoderSpeeds(double *spds) override;
199 yarp::dev::ReturnValue getMotorEncoderAcceleration(int j, double *acc) override;
202
203 // IPreciselyTimed
204 Stamp getLastInputStamp() override;
205
206 // IPositionControl
207 yarp::dev::ReturnValue positionMove(int j, double ref) override;
208 yarp::dev::ReturnValue positionMove(const int n_joint, const int *joints, const double *refs) override;
209 yarp::dev::ReturnValue positionMove(const double *refs) override;
210 yarp::dev::ReturnValue getTargetPosition(const int joint, double *ref) override;
211 yarp::dev::ReturnValue getTargetPositions(double *refs) override;
212 yarp::dev::ReturnValue getTargetPositions(const int n_joint, const int *joints, double *refs) override;
213 yarp::dev::ReturnValue relativeMove(int j, double delta) override;
214 yarp::dev::ReturnValue relativeMove(const int n_joint, const int *joints, const double *refs) override;
215 yarp::dev::ReturnValue relativeMove(const double *deltas) override;
216 yarp::dev::ReturnValue checkMotionDone(int j, bool& flag) override;
217 yarp::dev::ReturnValue checkMotionDone(const std::vector<int>& joints, bool& flag) override;
218 yarp::dev::ReturnValue checkMotionDone(bool& flag) override;
219 yarp::dev::ReturnValue setTrajSpeed(int j, double sp) override;
220 yarp::dev::ReturnValue setTrajSpeeds(const int n_joint, const int *joints, const double *spds) override;
221 yarp::dev::ReturnValue setTrajSpeeds(const double *spds) override;
222 yarp::dev::ReturnValue setTrajAcceleration(int j, double acc) override;
223 yarp::dev::ReturnValue setTrajAccelerations(const int n_joint, const int *joints, const double *accs) override;
224 yarp::dev::ReturnValue setTrajAccelerations(const double *accs) override;
225 yarp::dev::ReturnValue getTrajSpeed(int j, double *ref) override;
226 yarp::dev::ReturnValue getTrajSpeeds(const int n_joint, const int *joints, double *spds) override;
227 yarp::dev::ReturnValue getTrajSpeeds(double *spds) override;
228 yarp::dev::ReturnValue getTrajAcceleration(int j, double *acc) override;
229 yarp::dev::ReturnValue getTrajAccelerations(const int n_joint, const int *joints, double *accs) override;
230 yarp::dev::ReturnValue getTrajAccelerations(double *accs) override;
231 yarp::dev::ReturnValue stop(int j) override;
232 yarp::dev::ReturnValue stop(const int len, const int *joints) override;
233 yarp::dev::ReturnValue stop() override;
234
235 // IJointFault
236 yarp::dev::ReturnValue getLastJointFault(int j, int& fault, std::string& message) override;
237
238 // IAmplifierControl
239 yarp::dev::ReturnValue enableAmp(int j) override;
240 yarp::dev::ReturnValue disableAmp(int j) override;
242 yarp::dev::ReturnValue getAmpStatus(int j, int *st) override;
243 yarp::dev::ReturnValue setMaxCurrent(int j, double v) override;
244 yarp::dev::ReturnValue getMaxCurrent(int j, double *v) override;
245 yarp::dev::ReturnValue getNominalCurrent(int m, double *val) override;
246 yarp::dev::ReturnValue setNominalCurrent(int m, const double val) override;
247 yarp::dev::ReturnValue getPeakCurrent(int m, double *val) override;
248 yarp::dev::ReturnValue setPeakCurrent(int m, const double val) override;
249 yarp::dev::ReturnValue getPWM(int m, double* val) override;
250 yarp::dev::ReturnValue getPWMLimit(int m, double* val) override;
251 yarp::dev::ReturnValue setPWMLimit(int m, const double val) override;
252 yarp::dev::ReturnValue getPowerSupplyVoltage(int m, double* val) override;
253
254 // IControlLimits
255 yarp::dev::ReturnValue setPosLimits(int axis, double min, double max) override;
256 yarp::dev::ReturnValue getPosLimits(int axis, double *min, double *max) override;
257 yarp::dev::ReturnValue setVelLimits(int axis, double min, double max) override;
258 yarp::dev::ReturnValue getVelLimits(int axis, double *min, double *max) override;
259
260 // IAxisInfo
261 yarp::dev::ReturnValue getAxisName(int j, std::string& name) override;
263
264 // IControlCalibration
268 yarp::dev::ReturnValue park(bool wait=true) override;
269 yarp::dev::ReturnValue calibrateAxisWithParams(int j, unsigned int ui, double v1, double v2, double v3) override;
272
273 // ITorqueControl
274 yarp::dev::ReturnValue getRefTorque(int j, double *t) override;
275 yarp::dev::ReturnValue getRefTorques(double *t) override;
276 yarp::dev::ReturnValue setRefTorques(const double *t) override;
277 yarp::dev::ReturnValue setRefTorque(int j, double v) override;
278 yarp::dev::ReturnValue setRefTorques(const int n_joint, const int *joints, const double *t) override;
281 yarp::dev::ReturnValue getTorque(int j, double *t) override;
282 yarp::dev::ReturnValue getTorques(double *t) override;
283 yarp::dev::ReturnValue getTorqueRange(int j, double *min, double* max) override;
284 yarp::dev::ReturnValue getTorqueRanges(double *min, double *max) override;
285
286 // IImpedanceControl
287 yarp::dev::ReturnValue getImpedance(int j, double *stiffness, double *damping) override;
288 yarp::dev::ReturnValue getImpedanceOffset(int j, double *offset) override;
289 yarp::dev::ReturnValue setImpedance(int j, double stiffness, double damping) override;
290 yarp::dev::ReturnValue setImpedanceOffset(int j, double offset) override;
291 yarp::dev::ReturnValue getCurrentImpedanceLimit(int j, double *min_stiff, double *max_stiff, double *min_damp, double *max_damp) override;
292
293 // IControlMode
294 yarp::dev::ReturnValue getAvailableControlModes(int j, std::vector<yarp::dev::SelectableControlModeEnum>& avail) override;
296 yarp::dev::ReturnValue getControlModes(const std::vector<int>& joints, std::vector<yarp::dev::ControlModeEnum>& modes) override;
297 yarp::dev::ReturnValue getControlModes(std::vector<yarp::dev::ControlModeEnum>& modes) override;
299 yarp::dev::ReturnValue setControlModes(const std::vector<int>& joints, const std::vector<yarp::dev::SelectableControlModeEnum>& modes) override;
300 yarp::dev::ReturnValue setControlModes(const std::vector<yarp::dev::SelectableControlModeEnum>& modes) override;
301
302
303 // IPositionDirect
304 yarp::dev::ReturnValue setPosition(int j, double ref) override;
305 yarp::dev::ReturnValue setPositions(const int n_joint, const int *joints, const double *refs) override;
306 yarp::dev::ReturnValue setPositions(const double *refs) override;
307 yarp::dev::ReturnValue getRefPosition(const int joint, double* ref) override;
308 yarp::dev::ReturnValue getRefPositions(double* refs) override;
309 yarp::dev::ReturnValue getRefPositions(const int n_joint, const int* joints, double* refs) override;
310
311 // IVelocityControl
312 yarp::dev::ReturnValue velocityMove(int j, double v) override;
313 yarp::dev::ReturnValue velocityMove(const double *v) override;
314 yarp::dev::ReturnValue velocityMove(const int n_joint, const int *joints, const double *spds) override;
315 yarp::dev::ReturnValue getTargetVelocity(const int joint, double* vel) override;
317 yarp::dev::ReturnValue getTargetVelocities(const int n_joint, const int* joints, double* vels) override;
318
319 // IInteractionMode
321 yarp::dev::ReturnValue getInteractionModes(const std::vector<int>& joints, std::vector <yarp::dev::InteractionModeEnum>& modes) override;
322 yarp::dev::ReturnValue getInteractionModes(std::vector <yarp::dev::InteractionModeEnum>& modes) override;
324 yarp::dev::ReturnValue setInteractionModes(const std::vector<int>& joints, const std::vector < yarp::dev::InteractionModeEnum>& modes) override;
325 yarp::dev::ReturnValue setInteractionModes(const std::vector<yarp::dev::InteractionModeEnum>& modes) override;
326
327 // IRemoteCalibrator
333 yarp::dev::ReturnValue parkSingleJoint(int j, bool _wait=true) override;
337
338 // ICurrentControl
339 yarp::dev::ReturnValue getRefCurrents(double *t) override;
340 yarp::dev::ReturnValue getRefCurrent(int j, double *t) override;
341 yarp::dev::ReturnValue setRefCurrents(const double *refs) override;
342 yarp::dev::ReturnValue setRefCurrent(int j, double ref) override;
343 yarp::dev::ReturnValue setRefCurrents(const int n_joint, const int *joints, const double *refs) override;
344 yarp::dev::ReturnValue getCurrents(double *vals) override;
345 yarp::dev::ReturnValue getCurrent(int j, double *val) override;
346 yarp::dev::ReturnValue getCurrentRange(int j, double *min, double *max) override;
347 yarp::dev::ReturnValue getCurrentRanges(double *min, double *max) override;
348
349 // IPWMControl
350 yarp::dev::ReturnValue setRefDutyCycle(int j, double v) override;
351 yarp::dev::ReturnValue setRefDutyCycles(const double *v) override;
352 yarp::dev::ReturnValue getRefDutyCycle(int j, double *ref) override;
353 yarp::dev::ReturnValue getRefDutyCycles(double *refs) override;
354 yarp::dev::ReturnValue getDutyCycle(int j, double *out) override;
355 yarp::dev::ReturnValue getDutyCycles(double *outs) override;
356
357 // IJointBrake
358 yarp::dev::ReturnValue isJointBraked(int j, bool& braked) const override;
359 yarp::dev::ReturnValue setManualBrakeActive(int j, bool active) override;
360 yarp::dev::ReturnValue setAutoBrakeEnabled(int j, bool enabled) override;
361 yarp::dev::ReturnValue getAutoBrakeEnabled(int j, bool& enabled) const override;
362
363 // IVelocityDirect
364 yarp::dev::ReturnValue setRefVelocity(int jnt, double vel) override;
365 yarp::dev::ReturnValue setRefVelocity(const std::vector<double>& vels) override;
366 yarp::dev::ReturnValue setRefVelocity(const std::vector<int>& jnts, const std::vector<double>& vels) override;
367 yarp::dev::ReturnValue getRefVelocity(const int jnt, double& vel) override;
368 yarp::dev::ReturnValue getRefVelocity(std::vector<double>& vels) override;
369 yarp::dev::ReturnValue getRefVelocity(const std::vector<int>& jnts, std::vector<double>& vels) override;
370};
371
372
373
374#endif // YARP_DEV_CONTROLBOARD_NWC_YARP_H
FeatureMode mode
define control board standard interfaces
define control board standard interfaces
define control board standard interfaces
contains the definition of a Vector type
This class is the parameters parser for class ControlBoard_nwc_yarp.
ControlBoard_nwc_yarp: The client side of the control board, connects to a remote controlboard using ...
yarp::dev::ReturnValue setCalibrationParameters(int j, const CalibrationParameters &params) override
Start calibration, this method is very often platform specific.
yarp::dev::ReturnValue setPid(const PidControlTypeEnum &pidtype, int j, const Pid &pid) override
Set new PID value for a joint axis.
yarp::dev::ReturnValue setImpedanceOffset(int j, double offset) override
Set current force Offset for a specific joint.
yarp::dev::ReturnValue calibrateWholePart() override
calibrateWholePart: call the procedure for calibrating the whole device
yarp::dev::ReturnValue setImpedance(int j, double stiffness, double damping) override
Set current impedance gains (stiffness,damping) for a specific joint.
StateExtendedInputPort extendedIntputStatePort
yarp::dev::ReturnValue getTrajAccelerations(const int n_joint, const int *joints, double *accs) override
Get reference acceleration for a joint.
yarp::dev::ReturnValue getPidErrorLimits(const PidControlTypeEnum &pidtype, double *limits) override
Get the error limit for all controllers.
yarp::dev::ReturnValue setRefDutyCycles(const double *v) override
Sets the reference dutycycle for all the motors.
yarp::dev::ReturnValue stop() override
Stop motion, multiple joints.
yarp::dev::ReturnValue getRemoteVariablesList(yarp::os::Bottle *listOfKeys) override
yarp::dev::ReturnValue getPidError(const PidControlTypeEnum &pidtype, int j, double *err) override
Get the current error for a joint.
yarp::dev::ReturnValue getAmpStatus(int *st) override
yarp::dev::ReturnValue setPidErrorLimit(const PidControlTypeEnum &pidtype, int j, double limit) override
Set the error limit for the controller on a specific joint.
yarp::dev::ReturnValue parkWholePart() override
parkWholePart: start the parking procedure for the whole part
yarp::dev::ReturnValue setTrajAccelerations(const int n_joint, const int *joints, const double *accs) override
Set reference acceleration on all joints.
yarp::dev::ReturnValue getEncoderAccelerations(double *accs) override
Read the instantaneous acceleration of all axes.
yarp::dev::ReturnValue getCurrent(int j, double *val) override
yarp::dev::ReturnValue setGearboxRatio(int m, const double val) override
Set the gearbox ratio for a specific motor.
yarp::dev::ReturnValue getRefTorques(double *t) override
Get the reference value of the torque for all joints.
yarp::dev::ReturnValue setTrajAcceleration(int j, double acc) override
Set reference acceleration for a joint.
yarp::dev::ReturnValue setPidFeedforward(const PidControlTypeEnum &pidtype, int j, double v) override
Set the feedforward value for the specified PID controller.
bool close() override
Close the device driver and stop the port connections.
yarp::dev::ReturnValue resetMotorEncoders() override
Reset motor encoders.
yarp::dev::ReturnValue getTorqueRanges(double *min, double *max) override
Get the full scale of the torque sensors of all joints.
yarp::dev::ReturnValue setPidErrorLimits(const PidControlTypeEnum &pidtype, const double *limits) override
Get the error limit for the controller on all joints.
yarp::dev::ReturnValue getMotorEncoderCountsPerRevolution(int m, double *cpr) override
Gets number of counts per revolution for motor encoder m.
yarp::dev::ReturnValue calibrationDone(int j) override
Check if the calibration is terminated, on a particular joint.
yarp::dev::ReturnValue getRefPositions(double *refs) override
Get the last position reference for all axes.
yarp::dev::ReturnValue checkMotionDone(int j, bool &flag) override
Check if the current trajectory is terminated.
DiagnosticThread * diagnosticThread
yarp::dev::ReturnValue setPidReferences(const PidControlTypeEnum &pidtype, const double *refs) override
Set the controller reference, multiple axes.
yarp::dev::ReturnValue getMotorEncoder(int j, double *v) override
Read the value of a motor encoder.
yarp::dev::ReturnValue setPids(const PidControlTypeEnum &pidtype, const Pid *pids) override
Set new PID value on multiple axes.
yarp::dev::JointStateData last_wholePart
yarp::dev::ReturnValue resetEncoders() override
Reset encoders.
yarp::dev::ReturnValue getControlMode(int j, yarp::dev::ControlModeEnum &mode) override
Get the current control mode.
yarp::dev::ReturnValue getTorqueRange(int j, double *min, double *max) override
Get the full scale of the torque sensor of a given joint.
ControlBoard_nwc_yarp & operator=(ControlBoard_nwc_yarp &&)=delete
yarp::dev::ReturnValue getAvailablePids(int j, std::vector< yarp::dev::PidControlTypeEnum > &avail) override
Return a list of available pid types mode for the given joint.
yarp::dev::ReturnValue getImpedanceOffset(int j, double *offset) override
Get current force Offset for a specific joint.
yarp::dev::ReturnValue getTemperatures(double *vals) override
Get temperature of all the motors.
yarp::dev::ReturnValue getTargetPosition(const int joint, double *ref) override
Get the last position reference for the specified axis.
yarp::dev::ReturnValue disablePid(const PidControlTypeEnum &pidtype, int j) override
Disable the PID computation 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 setAutoBrakeEnabled(int j, bool enabled) override
Enables/Disables the automatic joint brake.
yarp::dev::ReturnValue getMotorEncoderSpeeds(double *spds) override
Read the instantaneous speed of all motor encoders.
yarp::dev::ReturnValue getPidFeedforward(const PidControlTypeEnum &pidtype, int j, double &v) override
Get the currently set feedforward value for the specified PID controller.
yarp::dev::ReturnValue isCalibratorDevicePresent(bool *isCalib) override
isCalibratorDevicePresent: check if a calibrator device has been set
yarp::dev::ReturnValue setPositions(const int n_joint, const int *joints, const double *refs) override
Set new reference point for all axes.
yarp::dev::ReturnValue getRefCurrent(int j, double *t) override
Get the reference value of the current for a single motor.
yarp::dev::ReturnValue getInteractionMode(int axis, yarp::dev::InteractionModeEnum &mode) override
Get the current interaction mode of the robot, values can be stiff or compliant.
yarp::dev::ReturnValue enableAmp(int j) override
Enable the amplifier on a specific joint.
yarp::dev::ReturnValue getGearboxRatio(int m, double *val) override
Get the gearbox ratio for a specific motor.
yarp::dev::ReturnValue getMotorEncoderAcceleration(int j, double *acc) override
Read the instantaneous acceleration of a motor encoder.
yarp::dev::ReturnValue getCurrentRange(int j, double *min, double *max) override
Get the full scale of the current measurement for a given motor (e.g.
yarp::dev::ReturnValue getRefPosition(const int joint, double *ref) override
Get the last position reference for the specified axis.
yarp::dev::ReturnValue getPidReference(const PidControlTypeEnum &pidtype, int j, double *ref) override
Get the current reference of the PID controller for a specific joint.
yarp::os::BufferedPort< yarp::dev::CommandMessageData > command_p
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 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 getAxes(size_t &ax) override
Get the number of controlled axes.
yarp::dev::ReturnValue setInteractionMode(int axis, yarp::dev::InteractionModeEnum mode) override
Set the interaction mode of the robot, values can be stiff or compliant.
yarp::dev::ReturnValue getDutyCycles(double *outs) override
Gets the current dutycycle of the output of the amplifier (i.e.
yarp::dev::ReturnValue getAvailableControlModes(int j, std::vector< yarp::dev::SelectableControlModeEnum > &avail) override
Return a list of available control mode for the given joint.
ControlBoard_nwc_yarp & operator=(const ControlBoard_nwc_yarp &)=delete
yarp::dev::ReturnValue getPids(const PidControlTypeEnum &pidtype, Pid *pids) override
Get current PID value for a specific joint.
yarp::dev::ReturnValue getEncoderAcceleration(int j, double *acc) override
Read the instantaneous acceleration of an axis.
yarp::dev::ReturnValue abortPark() override
yarp::dev::ReturnValue quitCalibrate() override
quitCalibrate: interrupt the calibration procedure
yarp::dev::ReturnValue disableAmp(int j) override
Disable the amplifier on a specific joint.
yarp::dev::ReturnValue getMaxCurrent(int j, double *v) override
Returns the maximum electric current allowed for a given motor.
yarp::dev::ReturnValue getDutyCycle(int j, double *out) override
Gets the current dutycycle of the output of the amplifier (i.e.
yarp::dev::ReturnValue homingWholePart() override
homingWholePart: call the homing procedure for a the whole part/device
yarp::dev::ReturnValue getRefCurrents(double *t) override
Get the reference value of the currents for all motors.
yarp::dev::ReturnValue setMaxCurrent(int j, double v) override
yarp::dev::ReturnValue positionMove(int j, double ref) override
Set new reference point for a single axis.
yarp::dev::ReturnValue setMotorEncoderCountsPerRevolution(int m, const double cpr) override
Sets number of counts per revolution for motor encoder m.
yarp::dev::ReturnValue setRefTorques(const double *t) override
Set the reference value of the torque for all joints.
yarp::dev::ReturnValue getEncoderSpeed(int j, double *sp) override
Read the istantaneous speed of an axis.
std::map< std::string, bool > m_device_has_interfaces
~ControlBoard_nwc_yarp() override=default
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 setMotorTorqueParams(int j, const MotorTorqueParameters params) override
Set a subset of motor parameters (bemf, ktau etc) useful for torque control.
yarp::dev::ReturnValue setPeakCurrent(int m, const double val) override
yarp::dev::ReturnValue setPosLimits(int axis, double min, double max) override
Set the software limits for a particular axis, the behavior of the control card when these limits are...
yarp::dev::ReturnValue getPWM(int m, double *val) override
yarp::dev::ReturnValue setRefDutyCycle(int j, double v) override
Sets the reference dutycycle to a single motor.
yarp::dev::ReturnValue getPidExtraInfo(const PidControlTypeEnum &pidtype, int j, PidExtraInfo &info) override
Get PID extra info and measurement units for a specific joint.
yarp::dev::ReturnValue getTemperatureLimit(int m, double *val) override
Retrieves the current temperature limit for a specific motor.
yarp::dev::ReturnValue enablePid(const PidControlTypeEnum &pidtype, int j) override
Enable the PID computation for a joint.
yarp::dev::ReturnValue setTrajSpeeds(const int n_joint, const int *joints, const double *spds) override
Set reference speed on all joints.
yarp::dev::ReturnValue velocityMove(int j, double v) override
Start motion at a given speed, single joint.
yarp::dev::ReturnValue getNumberOfMotors(int *num) override
Get the number of available motors.
yarp::dev::ReturnValue getCurrents(double *vals) override
yarp::dev::ReturnValue getPWMLimit(int m, double *val) override
yarp::dev::ReturnValue getEncoders(double *encs) override
Read the position of all axes.
yarp::dev::ReturnValue getEncoderSpeeds(double *spds) override
Read the instantaneous speed of all axes.
yarp::dev::ReturnValue getTrajSpeed(int j, double *ref) override
Get reference speed for a joint.
yarp::dev::ReturnValue getMotorTorqueParams(int j, MotorTorqueParameters *params) override
Get a subset of motor parameters (bemf, ktau etc) useful for torque control.
yarp::dev::ReturnValue getMotorEncoderTimed(int j, double *v, double *t) override
Read the instantaneous position of a motor encoder.
yarp::dev::ReturnValue getJointType(int j, yarp::dev::JointTypeEnum &type) override
yarp::dev::ReturnValue getRefDutyCycles(double *refs) override
Gets the last reference sent using the setRefDutyCycles function.
yarp::dev::ReturnValue getLastJointFault(int j, int &fault, std::string &message) override
yarp::dev::ReturnValue getPidErrorLimit(const PidControlTypeEnum &pidtype, int j, double *limit) override
Get the error limit for the controller on a specific joint.
yarp::dev::ReturnValue getTrajSpeeds(const int n_joint, const int *joints, double *spds) override
Get reference speed of all joints.
yarp::dev::ReturnValue getMotorEncoderAccelerations(double *accs) override
Read the instantaneous acceleration of all motor encoders.
yarp::dev::ReturnValue calibrateSingleJoint(int j) override
calibrateSingleJoint: call the calibration procedure for the single joint
yarp::dev::ReturnValue getPidOffset(const PidControlTypeEnum &pidtype, int j, double &v) override
Get the currently set offset value for the specified PID controller.
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 getImpedance(int j, double *stiffness, double *damping) override
Get current impedance gains (stiffness,damping,offset) for a specific joint.
yarp::dev::ReturnValue setRefTorque(int j, double v) override
Set the reference value of the torque for a given joint.
yarp::dev::ReturnValue parkSingleJoint(int j, bool _wait=true) override
parkSingleJoint(): start the parking procedure for the single joint
yarp::dev::ReturnValue setPWMLimit(int m, const double val) override
bool open(Searchable &config) override
Open the DeviceDriver.
yarp::dev::ReturnValue getPidExtraInfos(const PidControlTypeEnum &pidtype, std::vector< PidExtraInfo > &info) override
Get PID extra info and measurement units for a specific joint.
yarp::dev::ReturnValue getPid(const PidControlTypeEnum &pidtype, int j, Pid *pid) override
Get current PID value for a specific joint.
yarp::dev::ReturnValue setNominalCurrent(int m, const double val) override
yarp::dev::ReturnValue getRefTorque(int j, double *t) override
Get the reference value of the torque for a given joint.
yarp::dev::ReturnValue setManualBrakeActive(int j, bool active) override
Enables/Disables manually the joint brake.
yarp::dev::ReturnValue getNumberOfMotorEncoders(int *num) override
Get the number of available motor encoders.
yarp::dev::ReturnValue abortCalibration() override
yarp::dev::ReturnValue homingSingleJoint(int j) override
homingSingleJoint: call the homing procedure for a single joint
yarp::dev::ReturnValue park(bool wait=true) override
yarp::dev::ReturnValue getAxisName(int j, std::string &name) override
yarp::dev::ReturnValue setPidReference(const PidControlTypeEnum &pidtype, int j, double ref) override
Set the controller reference for a given axis.
yarp::dev::ReturnValue resetEncoder(int j) override
Reset encoder, single joint.
yarp::dev::ReturnValue setControlMode(int j, yarp::dev::SelectableControlModeEnum mode) override
Set the current control mode.
yarp::dev::ReturnValue setPidOffset(const PidControlTypeEnum &pidtype, int j, double v) override
Set an offset value for a given controller.
yarp::dev::ReturnValue getPosLimits(int axis, double *min, double *max) override
Get the software limits for a particular axis.
yarp::dev::ReturnValue setVelLimits(int axis, double min, double max) override
Set the software speed limits for a particular axis, the behavior of the control card when these limi...
yarp::dev::ReturnValue resetMotorEncoder(int j) override
Reset motor encoder, single motor.
yarp::dev::ReturnValue getMotorEncoderSpeed(int j, double *sp) override
Read the instantaneous speed of a motor encoder.
yarp::dev::ReturnValue isPidEnabled(const PidControlTypeEnum &pidtype, int j, bool &enabled) override
Get the current status (enabled/disabled) of the PID.
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 isJointBraked(int j, bool &braked) const override
Check is the joint brake is currently active.
yarp::dev::ReturnValue getTargetVelocity(const int joint, double *vel) override
Get the last reference speed set by velocityMove for single joint.
ControlBoard_nwc_yarp()=default
yarp::dev::ReturnValue setRefCurrents(const double *refs) override
Set the reference value of the currents for all motors.
yarp::dev::ReturnValue getMotorEncoders(double *encs) override
Read the position of all motor encoders.
yarp::dev::ReturnValue getRefDutyCycle(int j, double *ref) override
Gets the last reference sent using the setRefDutyCycle function.
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 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 getEncodersTimed(double *encs, double *ts) override
Read the instantaneous acceleration of all axes.
yarp::dev::ReturnValue setMotorEncoders(const double *vals) override
Set the value of all motor encoders.
yarp::dev::ReturnValue setEncoders(const double *vals) override
Set the value of all encoders.
yarp::dev::ReturnValue getVelLimits(int axis, double *min, double *max) override
Get the software speed limits for a particular axis.
yarp::dev::ReturnValue getTargetVelocities(double *vels) override
Get the last reference speed set by velocityMove for all joints.
yarp::dev::ReturnValue setRefVelocity(int jnt, double vel) override
Set the velocity of single joint.
yarp::dev::ReturnValue getPidOutputs(const PidControlTypeEnum &pidtype, double *outs) override
Get the output of the controllers (e.g.
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 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 calibrateRobot() override
Calibrate robot by using an external calibrator.
yarp::dev::ReturnValue setRefCurrent(int j, double ref) override
Set the reference value of the current for a single motor.
yarp::dev::ReturnValue getEncoder(int j, double *v) override
Read the value of an encoder.
yarp::dev::ReturnValue getPeakCurrent(int m, double *val) override
yarp::dev::ReturnValue getTargetPositions(double *refs) override
Get the last position reference for all axes.
yarp::dev::JointStateData last_singleJoint
yarp::dev::ReturnValue getTrajAcceleration(int j, double *acc) override
Get reference acceleration for a joint.
yarp::dev::ReturnValue relativeMove(int j, double delta) override
Set relative position.
yarp::dev::ReturnValue resetPid(const 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 setMotorEncoder(int j, const double val) override
Set the value of the motor encoder for a given motor.
yarp::dev::ReturnValue getEncoderTimed(int j, double *v, double *t) override
Read the instantaneous acceleration of all axes.
ControlBoard_nwc_yarp(ControlBoard_nwc_yarp &&)=delete
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 setEncoder(int j, double val) override
Set the value of the encoder for a given joint.
Stamp getLastInputStamp() override
Get the time stamp for the last read data.
yarp::dev::ReturnValue getPowerSupplyVoltage(int m, double *val) override
yarp::dev::ReturnValue getPidOutput(const PidControlTypeEnum &pidtype, int j, double *out) override
Get the output of the controller (e.g.
ControlBoard_nwc_yarp(const ControlBoard_nwc_yarp &)=delete
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 setRemoteVariable(std::string key, const yarp::os::Bottle &val) override
yarp::dev::ReturnValue setPosition(int j, double ref) override
Set new position for a single axis.
yarp::dev::ReturnValue getPidErrors(const PidControlTypeEnum &pidtype, double *errs) override
Get the error of all joints.
yarp::dev::ReturnValue setTemperatureLimit(int m, const double val) override
Set the temperature limit for a specific motor.
yarp::dev::ReturnValue getTemperature(int m, double *val) override
Get temperature of a motor.
yarp::dev::ReturnValue getMotorEncodersTimed(double *encs, double *ts) override
Read the instantaneous position of all motor encoders.
yarp::dev::ReturnValue getNominalCurrent(int m, double *val) override
yarp::dev::ReturnValue getPidReferences(const PidControlTypeEnum &pidtype, double *refs) override
Get the current reference of all PID controllers.
Interface implemented by all device drivers.
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 mini-server for performing network communication in the background.
A mini-server for network communication.
Definition Port.h:46
A base class for nested structures that can be searched.
Definition Searchable.h:31
An abstraction for a time stamp and/or sequence number.
Definition Stamp.h:18
SelectableControlModeEnum
PidControlTypeEnum
Definition PidEnums.h:15