YARP
Yet Another Robot Platform
 
Loading...
Searching...
No Matches
ControlBoard_nws_yarp.cpp
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2006-2021 Istituto Italiano di Tecnologia (IIT)
3 * SPDX-FileCopyrightText: 2006-2010 RobotCub Consortium
4 * SPDX-License-Identifier: BSD-3-Clause
5 */
6
8
11
12#include <yarp/os/LogStream.h>
14
15#include <numeric>
16#include <cmath>
17
18using namespace yarp::os;
19using namespace yarp::dev;
20using namespace yarp::sig;
22
23const double DEFAULT_PERIOD = 0.02;
24
29
30void ControlBoard_nws_yarp::closePorts()
31{
32 m_rpcPort.interrupt();
33 m_rpcPort.removeCallbackLock();
34 m_rpcPort.close();
35
36 inputStreamingPort.interrupt();
37 inputStreamingPort.close();
38
39 outputPositionStatePort.interrupt();
40 outputPositionStatePort.close();
41
42 extendedOutputStatePort.interrupt();
43 extendedOutputStatePort.close();
44}
45
47{
48 // Ensure that the device is not running
49 if (isRunning()) {
50 stop();
51 }
52
53 closeDevice();
54 closePorts();
55
56 return true;
57}
58
60{
61 if (!parseParams(config)) { return false; }
62
63 //rpc port
64 std::string server_rpc_portname = m_name + "/nws/rpc:i";
65 if (!m_rpcPort.open(server_rpc_portname))
66 {
67 yCError(CONTROLBOARD, "Failed to open port %s", server_rpc_portname.c_str());
68 return false;
69 }
70 m_rpcPort.setReader(*this);
71
72 std::string rootName = m_name;
73
74 //streaming port
75 if (!inputStreamingPort.open(rootName + "/command:i")) {
76 yCError(CONTROLBOARD) << "Error opening port " << rootName + "/rpc:i";
77 closePorts();
78 return false;
79 }
80 inputStreamingPort.setStrict();
81 inputStreamingPort.useCallback(streaming_parser);
82
83 if (!outputPositionStatePort.open(rootName + "/state:o")) {
84 yCError(CONTROLBOARD) << "Error opening port " << rootName + "/state:o";
85 closePorts();
86 return false;
87 }
88
89 // Extended output state port
90 if (!extendedOutputStatePort.open(rootName + "/stateExt:o")) {
91 yCError(CONTROLBOARD) << "Error opening port " << rootName + "/state:o";
92 closePorts();
93 return false;
94 }
95
96 // In case attach is not deferred and the controlboard already owns a valid device
97 // we can start the thread. Otherwise this will happen when attachAll is called
98 if (subdevice_ready) {
100 if (!start()) {
101 yCError(CONTROLBOARD) << "Error starting thread";
102 return false;
103 }
104 }
105
106 return true;
107}
108
109bool ControlBoard_nws_yarp::setDevice(yarp::dev::DeviceDriver* driver, bool owned)
110{
111 // Save the pointer and subDeviceOwned
113
114 subdevice_ptr->view(m_allInterfaces.iJointFault);
115 if (!m_allInterfaces.iJointFault) {
116 yCWarning(CONTROLBOARD, "Part <%s>: iJointFault interface was not found in subdevice.", partName.c_str());
117 }
118
119 subdevice_ptr->view(m_allInterfaces.iPidControl);
120 if (!m_allInterfaces.iPidControl) {
121 yCWarning(CONTROLBOARD, "Part <%s>: IPidControl interface was not found in subdevice.", partName.c_str());
122 }
123
124 subdevice_ptr->view(m_allInterfaces.iPositionControl);
125 if (!m_allInterfaces.iPositionControl) {
126 yCWarning(CONTROLBOARD, "Part <%s>: IPositionControl interface was not found in subdevice.", partName.c_str());
127 }
128
129 subdevice_ptr->view(m_allInterfaces.iPositionDirect);
130 if (!m_allInterfaces.iPositionDirect) {
131 yCWarning(CONTROLBOARD, "Part <%s>: IPositionDirect interface was not found in subdevice.", partName.c_str());
132 }
133
134 subdevice_ptr->view(m_allInterfaces.iVelocityControl);
135 if (!m_allInterfaces.iVelocityControl) {
136 yCWarning(CONTROLBOARD, "Part <%s>: IVelocityControl interface was not found in subdevice.", partName.c_str());
137 }
138
139 subdevice_ptr->view(m_allInterfaces.iEncodersTimed);
140 if (!m_allInterfaces.iEncodersTimed) {
141 yCWarning(CONTROLBOARD, "Part <%s>: IEncodersTimed interface was not found in subdevice.", partName.c_str());
142 }
143
144 subdevice_ptr->view(m_allInterfaces.iMotor);
145 if (!m_allInterfaces.iMotor) {
146 yCWarning(CONTROLBOARD, "Part <%s>: IMotor interface was not found in subdevice.", partName.c_str());
147 }
148
149 subdevice_ptr->view(m_allInterfaces.iMotorEncoders);
150 if (!m_allInterfaces.iMotorEncoders) {
151 yCWarning(CONTROLBOARD, "Part <%s>: IMotorEncoders interface was not found in subdevice.", partName.c_str());
152 }
153
154 subdevice_ptr->view(m_allInterfaces.iAmplifierControl);
155 if (!m_allInterfaces.iAmplifierControl) {
156 yCWarning(CONTROLBOARD, "Part <%s>: IAmplifierControl interface was not found in subdevice.", partName.c_str());
157 }
158
159 subdevice_ptr->view(m_allInterfaces.iControlLimits);
160 if (!m_allInterfaces.iControlLimits) {
161 yCWarning(CONTROLBOARD, "Part <%s>: IControlLimits interface was not found in subdevice.", partName.c_str());
162 }
163
164 subdevice_ptr->view(m_allInterfaces.iControlCalibration);
165 if (!m_allInterfaces.iControlCalibration) {
166 yCWarning(CONTROLBOARD, "Part <%s>: IControlCalibration interface was not found in subdevice.", partName.c_str());
167 }
168
169 subdevice_ptr->view(m_allInterfaces.iTorqueControl);
170 if (!m_allInterfaces.iTorqueControl) {
171 yCWarning(CONTROLBOARD, "Part <%s>: ITorqueControl interface was not found in subdevice.", partName.c_str());
172 }
173
174 subdevice_ptr->view(m_allInterfaces.iImpedanceControl);
175 if (!m_allInterfaces.iImpedanceControl) {
176 yCWarning(CONTROLBOARD, "Part <%s>: IImpedanceControl interface was not found in subdevice.", partName.c_str());
177 }
178
179 subdevice_ptr->view(m_allInterfaces.iControlMode);
180 if (!m_allInterfaces.iControlMode) {
181 yCWarning(CONTROLBOARD, "Part <%s>: IControlMode interface was not found in subdevice.", partName.c_str());
182 }
183
184 subdevice_ptr->view(m_allInterfaces.iAxisInfo);
185 if (!m_allInterfaces.iAxisInfo) {
186 yCWarning(CONTROLBOARD, "Part <%s>: IAxisInfo interface was not found in subdevice.", partName.c_str());
187 }
188
189 subdevice_ptr->view(m_allInterfaces.iPreciselyTimed);
190 if (!m_allInterfaces.iPreciselyTimed) {
191 yCWarning(CONTROLBOARD, "Part <%s>: IPreciselyTimed interface was not found in subdevice.", partName.c_str());
192 }
193
194 subdevice_ptr->view(m_allInterfaces.iInteractionMode);
195 if (!m_allInterfaces.iInteractionMode) {
196 yCWarning(CONTROLBOARD, "Part <%s>: IInteractionMode interface was not found in subdevice.", partName.c_str());
197 }
198
199 subdevice_ptr->view(m_allInterfaces.iRemoteCalibrator);
200 if (!m_allInterfaces.iRemoteCalibrator) {
201 yCWarning(CONTROLBOARD, "Part <%s>: iRemoteCalibrator interface was not found in subdevice.", partName.c_str());
202 }
203
204 subdevice_ptr->view(m_allInterfaces.iRemoteVariables);
205 if (!m_allInterfaces.iRemoteVariables) {
206 yCWarning(CONTROLBOARD, "Part <%s>: IRemoteVariables interface was not found in subdevice.", partName.c_str());
207 }
208
209 subdevice_ptr->view(m_allInterfaces.iPWMControl);
210 if (!m_allInterfaces.iPWMControl) {
211 yCWarning(CONTROLBOARD, "Part <%s>: IPWMControl interface was not found in subdevice.", partName.c_str());
212 }
213
214 subdevice_ptr->view(m_allInterfaces.iCurrentControl);
215 if (!m_allInterfaces.iCurrentControl) {
216 yCWarning(CONTROLBOARD, "Part <%s>: ICurrentControl interface was not found in subdevice.", partName.c_str());
217 }
218
219 subdevice_ptr->view(m_allInterfaces.iJointBrake);
220 if (!m_allInterfaces.iJointBrake) {
221 yCWarning(CONTROLBOARD, "Part <%s>: iJointBrake interface was not found in subdevice.", partName.c_str());
222 }
223
224 subdevice_ptr->view(m_allInterfaces.iVelocityDirect);
225 if (!m_allInterfaces.iVelocityDirect) {
226 yCWarning(CONTROLBOARD, "Part <%s>: iVelocityDirect interface was not found in subdevice.", partName.c_str());
227 }
228
229 // Get the number of controlled joints
230 size_t tmp_axes = 0;
231 if (m_allInterfaces.iAxisInfo)
232 {
233 if (!m_allInterfaces.iAxisInfo->getAxes(tmp_axes)) {
234 yCError(CONTROLBOARD) << "Part <%s>: iAxisInfo->getAxes() failed for subdevice " << partName.c_str();
235 return false;
236 }
237 }
238 else if (m_allInterfaces.iEncodersTimed)
239 {
240 if (!m_allInterfaces.iEncodersTimed->getAxes(tmp_axes)) {
241 yCError(CONTROLBOARD) << "Part <%s>: iEncodersTimed->getAxes() failed for subdevice " << partName.c_str();
242 return false;
243 }
244 }
245 else if (m_allInterfaces.iPositionControl)
246 {
247 if (!m_allInterfaces.iPositionControl->getAxes(tmp_axes)) {
248 yCError(CONTROLBOARD) << "Part <%s>: iPositionControl->getAxes() failed for subdevice " << partName.c_str();
249 return false;
250 }
251 }
252 else if (m_allInterfaces.iVelocityControl)
253 {
254 if (!m_allInterfaces.iVelocityControl->getAxes(tmp_axes)) {
255 yCError(CONTROLBOARD) << "Part <%s>: iVelocityControl->getAxes() failed for subdevice " << partName.c_str();
256 return false;
257 }
258 }
259
260 if (tmp_axes <= 0) {
261 yCError(CONTROLBOARD, "Part <%s>: attached device has an invalid number of joints (%d)", partName.c_str(), tmp_axes);
262 return false;
263 }
264 subdevice_joints = static_cast<size_t>(tmp_axes);
265 times.resize(subdevice_joints);
266
267 // Initialization
268 streaming_parser.init(subdevice_ptr);
269 streaming_parser.initialize();
270
271 return true;
272}
273
274void ControlBoard_nws_yarp::closeDevice()
275{
276 // Reset callbacks
277 streaming_parser.reset();
278
279 subdevice_joints = 0;
280 subdevice_ready = false;
281
282 times.clear();
283
284 // Clear all interfaces
285 m_allInterfaces.iPidControl = nullptr;
286 m_allInterfaces.iPositionControl = nullptr;
287 m_allInterfaces.iPositionDirect = nullptr;
288 m_allInterfaces.iVelocityControl = nullptr;
289 m_allInterfaces.iEncodersTimed = nullptr;
290 m_allInterfaces.iMotor = nullptr;
291 m_allInterfaces.iMotorEncoders = nullptr;
292 m_allInterfaces.iAmplifierControl = nullptr;
293 m_allInterfaces.iControlLimits = nullptr;
294 m_allInterfaces.iControlCalibration = nullptr;
295 m_allInterfaces.iTorqueControl = nullptr;
296 m_allInterfaces.iImpedanceControl = nullptr;
297 m_allInterfaces.iControlMode = nullptr;
298 m_allInterfaces.iAxisInfo = nullptr;
299 m_allInterfaces.iPreciselyTimed = nullptr;
300 m_allInterfaces.iInteractionMode = nullptr;
301 m_allInterfaces.iRemoteVariables = nullptr;
302 m_allInterfaces.iPWMControl = nullptr;
303 m_allInterfaces.iCurrentControl = nullptr;
304 m_allInterfaces.iJointFault = nullptr;
305 m_allInterfaces.iVelocityDirect = nullptr;
306}
307
309{
310 // Check if we already instantiated a subdevice previously
311 if (subdevice_ready) {
312 return false;
313 }
314
315 if (!setDevice(poly, false)) {
316 return false;
317 }
318
320 if (!start()) {
321 yCError(CONTROLBOARD) << "Error starting thread";
322 return false;
323 }
324
325 m_RPC = std::make_unique<ControlBoardRPCd>(this->subdevice_joints, m_allInterfaces);
326
327 return true;
328}
329
331{
332 // Ensure that the device is not running
333 if (isRunning()) {
334 stop();
335 }
336
337 closeDevice();
338
339 return true;
340}
341
343{
344 // check we are not overflowing with input messages
345 constexpr int reads_for_warning = 20;
346 if (inputStreamingPort.getPendingReads() >= reads_for_warning) {
347 yCIWarning(CONTROLBOARD, id()) << "Number of streaming input messages to be read is " << inputStreamingPort.getPendingReads() << " and can overflow";
348 }
349 // handle stateExt first
350 JointStateData& data = extendedOutputStatePort.prepare();
351
352 data.jointPosition.resize(subdevice_joints);
353 data.jointVelocity.resize(subdevice_joints);
354 data.jointAcceleration.resize(subdevice_joints);
355 data.motorPosition.resize(subdevice_joints);
356 data.motorVelocity.resize(subdevice_joints);
357 data.motorAcceleration.resize(subdevice_joints);
358 data.torque.resize(subdevice_joints);
359 data.pwmDutycycle.resize(subdevice_joints);
360 data.temperature.resize(subdevice_joints);
361 data.current.resize(subdevice_joints);
362 data.controlMode.resize(subdevice_joints);
363 data.interactionMode.resize(subdevice_joints);
364
365 // resize the temporary vector
366 tmpVariableForFloatSignals.resize(subdevice_joints);
367 tmpVariableForControlModes.resize(subdevice_joints);
368 tmpVariableForInteractionModes.resize(subdevice_joints);
369
370 // Get data from HW
371 if (m_allInterfaces.iEncodersTimed) {
372 data.jointPosition_isValid = m_allInterfaces.iEncodersTimed->getEncodersTimed(data.jointPosition.data(), times.data());
373 data.jointVelocity_isValid = m_allInterfaces.iEncodersTimed->getEncoderSpeeds(data.jointVelocity.data());
375 } else {
376 data.jointPosition_isValid = false;
377 data.jointVelocity_isValid = false;
378 data.jointAcceleration_isValid = false;
379 }
380
381 if (m_allInterfaces.iMotorEncoders) {
382 data.motorPosition_isValid = m_allInterfaces.iMotorEncoders->getMotorEncoders(data.motorPosition.data());
383 data.motorVelocity_isValid = m_allInterfaces.iMotorEncoders->getMotorEncoderSpeeds(data.motorVelocity.data());
385 } else {
386 data.motorPosition_isValid = false;
387 data.motorVelocity_isValid = false;
388 data.motorAcceleration_isValid = false;
389 }
390
391 if (m_allInterfaces.iMotor) {
392 // the temperature is a double in the interface, but a float in the jointData struct.
393 data.temperature_isValid = m_allInterfaces.iMotor->getTemperatures(tmpVariableForFloatSignals.data());
394
395 // The temperature values are stored as double in the interface but need to be converted to float in the jointData struct.
396 // We manually copy them, and while this conversion may lead to a minor loss of precision, it is negligible for temperature values,
397 // which typically do not require double precision. std::copy ensures a safe and efficient conversion.
398 std::copy(tmpVariableForFloatSignals.begin(), tmpVariableForFloatSignals.end(), data.temperature.begin());
399 } else {
400 data.temperature_isValid = false;
401 }
402
403 if (m_allInterfaces.iTorqueControl) {
404 data.torque_isValid = m_allInterfaces.iTorqueControl->getTorques(data.torque.data());
405 } else {
406 data.torque_isValid = false;
407 }
408
409 if (m_allInterfaces.iPWMControl) {
410 // the pwmDutycycle is a double in the interface, but a float in the jointData struct.
411 data.pwmDutycycle_isValid = m_allInterfaces.iPWMControl->getDutyCycles(tmpVariableForFloatSignals.data());
412
413 // The pwmDutycycle values are stored as double in the interface but need to be converted to float in the jointData struct.
414 // We manually copy them, and while this conversion may lead to a minor loss of precision, it is negligible for pwmDutycycle values,
415 // which typically do not require double precision. std::copy ensures a safe and efficient conversion.
416 std::copy(tmpVariableForFloatSignals.begin(), tmpVariableForFloatSignals.end(), data.pwmDutycycle.begin());
417 } else {
418 data.pwmDutycycle_isValid = false;
419 }
420
421 if (m_allInterfaces.iCurrentControl) {
422 data.current_isValid = m_allInterfaces.iCurrentControl->getCurrents(data.current.data());
423 } else if (m_allInterfaces.iAmplifierControl) {
424 data.current_isValid = m_allInterfaces.iAmplifierControl->getCurrents(data.current.data());
425 } else {
426 data.current_isValid = false;
427 }
428
429 if (m_allInterfaces.iControlMode) {
430 data.controlMode_isValid = m_allInterfaces.iControlMode->getControlModes(tmpVariableForControlModes);
431 for (size_t i =0; i< tmpVariableForControlModes.size(); i++)
432 {
433 data.controlMode[i] = static_cast<int>(tmpVariableForControlModes[i]);
434 }
435 } else {
436 data.controlMode_isValid = false;
437 }
438
439 if (m_allInterfaces.iInteractionMode) {
440 data.interactionMode_isValid = m_allInterfaces.iInteractionMode->getInteractionModes(tmpVariableForInteractionModes);
441 for (size_t i =0; i< tmpVariableForInteractionModes.size(); i++)
442 {
443 data.interactionMode[i] = static_cast<int>(tmpVariableForInteractionModes[i]);
444 }
445 } else {
446 data.interactionMode_isValid = false;
447 }
448
449 // Check if the encoders timestamps are consistent.
450 for (double tt : times)
451 {
452 if (std::abs(times[0] - tt) > 1.0)
453 {
454 yCIErrorThrottle(CONTROLBOARD, id(), 1.0) << "Encoder timestamps are not consistent! Data will not be published.";
455 return;
456 }
457 }
458
459 // Update the port envelope time by averaging all timestamps
460 time.update(std::accumulate(times.begin(), times.end(), 0.0) / subdevice_joints);
462
463 extendedOutputStatePort.setEnvelope(averageTime);
464 extendedOutputStatePort.write();
465
466 // handle state:o
467 yarp::sig::Vector& v = outputPositionStatePort.prepare();
468 v.resize(subdevice_joints);
469 std::copy(data.jointPosition.begin(), data.jointPosition.end(), v.begin());
470
471 outputPositionStatePort.setEnvelope(averageTime);
472 outputPositionStatePort.write();
473}
474
476{
477 if (!connection.isValid()) {
478 return false;
479 }
480 if (!m_RPC) {
481 return false;
482 }
483
484 std::lock_guard<std::mutex> lock(m_mutex);
485 bool b = m_RPC->read(connection);
486 if (b) {
487 return true;
488 }
489 yCDebug(CONTROLBOARD) << "read() Command failed";
490 return false;
491}
const yarp::os::LogComponent & CONTROLBOARD()
const double DEFAULT_PERIOD
bool parseParams(const yarp::os::Searchable &config) override
Parse the DeviceDriver parameters.
void run() override
Loop function.
bool read(yarp::os::ConnectionReader &connection) override
Read this object from a network connection.
bool open(yarp::os::Searchable &prop) override
Open the DeviceDriver.
bool close() override
Close the DeviceDriver.
bool attach(yarp::dev::PolyDriver *poly) override
Attach to another object.
bool detach() override
Detach the object (you must have first called attach).
void init(yarp::dev::DeviceDriver *x)
Initialization.
Interface implemented by all device drivers.
virtual yarp::dev::ReturnValue getCurrents(double *vals)=0
virtual yarp::dev::ReturnValue getAxes(size_t &ax)=0
Get the number of controlled axes.
virtual yarp::dev::ReturnValue getControlModes(std::vector< yarp::dev::ControlModeEnum > &mode)=0
Get the current control mode (multiple joints).
virtual yarp::dev::ReturnValue getCurrents(double *currs)=0
Get the instantaneous current measurement for all motors.
virtual yarp::dev::ReturnValue getEncodersTimed(double *encs, double *time)=0
Read the instantaneous acceleration of all axes.
virtual yarp::dev::ReturnValue getEncoderAccelerations(double *accs)=0
Read the instantaneous acceleration of all axes.
virtual yarp::dev::ReturnValue getEncoderSpeeds(double *spds)=0
Read the instantaneous speed of all axes.
virtual yarp::dev::ReturnValue getAxes(size_t &ax)=0
Get the number of controlled axes.
virtual yarp::dev::ReturnValue getInteractionModes(const std::vector< int > &joints, std::vector< yarp::dev::InteractionModeEnum > &modes)=0
Get the current interaction mode of the robot for a set of joints, values can be stiff or compliant.
virtual yarp::dev::ReturnValue getMotorEncoders(double *encs)=0
Read the position of all motor encoders.
virtual yarp::dev::ReturnValue getMotorEncoderSpeeds(double *spds)=0
Read the instantaneous speed of all motor encoders.
virtual yarp::dev::ReturnValue getMotorEncoderAccelerations(double *accs)=0
Read the instantaneous acceleration of all motor encoders.
virtual yarp::dev::ReturnValue getTemperatures(double *vals)=0
Get temperature of all the motors.
virtual yarp::dev::ReturnValue getDutyCycles(double *vals)=0
Gets the current dutycycle of the output of the amplifier (i.e.
virtual yarp::dev::ReturnValue getAxes(size_t &ax)=0
Get the number of controlled axes.
virtual yarp::dev::ReturnValue getTorques(double *t)=0
Get the value of the torque for all joints (this is the feedback if you have torque sensors).
virtual yarp::dev::ReturnValue getAxes(size_t &axes)=0
Get the number of controlled axes.
yarp::sig::VectorOf< float > pwmDutycycle
yarp::sig::VectorOf< int > controlMode
yarp::sig::VectorOf< int > interactionMode
yarp::sig::VectorOf< double > motorAcceleration
yarp::sig::VectorOf< double > jointPosition
yarp::sig::VectorOf< double > torque
yarp::sig::VectorOf< double > motorVelocity
yarp::sig::VectorOf< double > jointVelocity
yarp::sig::VectorOf< double > current
yarp::sig::VectorOf< float > temperature
yarp::sig::VectorOf< double > jointAcceleration
yarp::sig::VectorOf< double > motorPosition
A container for a device driver.
Definition PolyDriver.h:23
bool removeCallbackLock() override
Remove a lock on callbacks added with setCallbackLock()
bool open(const std::string &name) override
Start port operation, with a specific name, with automatically-chosen network parameters.
void setReader(PortReader &reader) override
Set an external reader for port data.
void close() override
Stop port activity.
void interrupt() override
Interrupt any current reads or writes attached to the port.
A mini-server for performing network communication in the background.
void close() override
Stop port activity.
bool setEnvelope(PortWriter &envelope) override
Set an envelope (e.g., a timestamp) to the next message which will be sent.
bool open(const std::string &name) override
Start port operation, with a specific name, with automatically-chosen network parameters.
int getPendingReads() override
Get the number of objects ready to be read.
void interrupt() override
Interrupt any current reads or writes attached to the port.
void useCallback(TypedReaderCallback< T > &callback) override
Set an object whose onRead method will be called when data is available.
void setStrict(bool strict=true) override
Call this to strictly keep all messages, or allow old ones to be quietly dropped.
void write(bool forceStrict=false)
Write the current object being returned by BufferedPort::prepare.
T & prepare()
Access the object which will be transmitted by the next call to yarp::os::BufferedPort::write.
An interface for reading from a network connection.
virtual bool isValid() const =0
An abstraction for a periodic thread.
bool setPeriod(double period)
Set the (new) period of the thread.
bool isRunning() const
Returns true when the thread is started, false otherwise.
bool start()
Call this to start the thread.
void stop()
Call this to stop the thread, this call blocks until the thread is terminated (and releaseThread() ca...
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
void update()
Set the timestamp to the current time, and increment the sequence number (wrapping to 0 if the sequen...
Definition Stamp.cpp:49
Scalar * data()
Return a pointer to the first element of the vector.
Definition VectorBase.h:245
iterator begin() noexcept
Returns an iterator to the beginning of the Vector.
Definition VectorBase.h:305
iterator end() noexcept
Definition VectorBase.h:311
void resize(size_t size)
Resize the vector.
Definition VectorBase.h:106
void clear()
Clear (removes all elements) the vector.
Definition VectorBase.h:216
#define yCError(component,...)
#define yCWarning(component,...)
#define yCIErrorThrottle(component, id, period,...)
#define yCDebug(component,...)
#define yCIWarning(component, id,...)
For streams capable of holding different kinds of content, check what they actually have.
An interface to the operating system, including Port based communication.
The main, catch-all namespace for YARP.
Definition dirs.h:16
yarp::dev::IJointBrake * iJointBrake
yarp::dev::IRemoteCalibrator * iRemoteCalibrator
yarp::dev::IControlMode * iControlMode
yarp::dev::IJointFault * iJointFault
yarp::dev::IPidControl * iPidControl
yarp::dev::IAmplifierControl * iAmplifierControl
yarp::dev::ITorqueControl * iTorqueControl
yarp::dev::IPWMControl * iPWMControl
yarp::dev::IImpedanceControl * iImpedanceControl
yarp::dev::IVelocityDirect * iVelocityDirect
yarp::dev::IVelocityControl * iVelocityControl
yarp::dev::IInteractionMode * iInteractionMode
yarp::dev::IEncodersTimed * iEncodersTimed
yarp::dev::IRemoteVariables * iRemoteVariables
yarp::dev::IControlLimits * iControlLimits
yarp::dev::IAxisInfo * iAxisInfo
yarp::dev::IPositionDirect * iPositionDirect
yarp::dev::ICurrentControl * iCurrentControl
yarp::dev::IPreciselyTimed * iPreciselyTimed
yarp::dev::IMotorEncoders * iMotorEncoders
yarp::dev::IControlCalibration * iControlCalibration
yarp::dev::IMotor * iMotor
yarp::dev::IPositionControl * iPositionControl