YARP
Yet Another Robot Platform
 
Loading...
Searching...
No Matches
ControlBoardCouplingHandler.h
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2006-2023 Istituto Italiano di Tecnologia (IIT)
3 * SPDX-License-Identifier: BSD-3-Clause
4 */
5
6#ifndef YARP_DEV_CONTROLBOARDREMAPPER_CONTROLBOARDREMAPPER_H
7#define YARP_DEV_CONTROLBOARDREMAPPER_CONTROLBOARDREMAPPER_H
8
9#include <yarp/os/Network.h>
10
12#include <yarp/dev/PolyDriver.h>
16#include <yarp/os/Semaphore.h>
19
20#include <string>
21#include <vector>
22
23
24#ifdef MSVC
25 #pragma warning(disable:4355)
26#endif
33private:
34 yarp::dev::PolyDriver jointCouplingHandler;
35 yarp::dev::IEncodersTimed *iJntEnc{nullptr};
36 //yarp::dev::IControlLimits *lim;
37 yarp::dev::IAxisInfo *iAxInfo{nullptr};
38 yarp::dev::IJointCoupling *iJntCoupling{nullptr};
39
40 yarp::sig::Vector physJointsPos;
41 yarp::sig::Vector physJointsVel;
42 yarp::sig::Vector physJointsAcc;
43 yarp::sig::Vector physJointsTime;
44 yarp::sig::Vector actAxesPos;
45 yarp::sig::Vector actAxesVel;
46 yarp::sig::Vector actAxesAcc;
47 yarp::sig::Vector actAxesTime;
48
50 bool _verb{false};
51
52 // to open ports and print more detailed debug messages
53 std::string partName;
54
58 void configureBuffers();
59
60
61public:
67 ~ControlBoardCouplingHandler() override = default;
68
73 bool verbose() const { return _verb; }
74
79 bool close() override;
80
81
87 bool open(yarp::os::Searchable &prop) override;
88
89 bool detach() override;
90
91 bool attach(yarp::dev::PolyDriver* poly) override;
92
93 /* IEncoders */
94 bool resetEncoder(int j) override;
95
96 bool resetEncoders() override;
97
98 bool setEncoder(int j, double val) override;
99
100 bool setEncoders(const double *vals) override;
101
102 bool getEncoder(int j, double *v) override;
103
104 bool getEncoders(double *encs) override;
105
106 bool getEncodersTimed(double *encs, double *t) override;
107
108 bool getEncoderTimed(int j, double *v, double *t) override;
109
110 bool getEncoderSpeed(int j, double *sp) override;
111
112 bool getEncoderSpeeds(double *spds) override;
113
114 bool getEncoderAcceleration(int j, double *acc) override;
115
116 bool getEncoderAccelerations(double *accs) override;
117
118 /* IAxisInfo */
119 bool getAxes(int *ax) override;
120
121 bool getAxisName(int j, std::string &name) override;
122
123 bool getJointType(int j, yarp::dev::JointTypeEnum &type) override;
124
125};
126
127#endif // YARP_DEV_CONTROLBOARDREMAPPER_CONTROLBOARDREMAPPER_H
define control board standard interfaces
This class is the parameters parser for class ControlBoardCouplingHandler.
ControlBoardCouplingHandler & operator=(const ControlBoardCouplingHandler &)=delete
bool getEncoderAccelerations(double *accs) override
Read the instantaneous acceleration of all axes.
ControlBoardCouplingHandler(const ControlBoardCouplingHandler &)=delete
bool getEncoderTimed(int j, double *v, double *t) override
Read the instantaneous acceleration of all axes.
ControlBoardCouplingHandler & operator=(ControlBoardCouplingHandler &&)=delete
bool getEncoders(double *encs) override
Read the position of all axes.
bool verbose() const
Return the value of the verbose flag.
bool getEncoder(int j, double *v) override
Read the value of an encoder.
bool setEncoder(int j, double val) override
Set the value of the encoder for a given joint.
bool setEncoders(const double *vals) override
Set the value of all encoders.
bool getAxisName(int j, std::string &name) override
bool attach(yarp::dev::PolyDriver *poly) override
Attach to another object.
bool getEncoderSpeeds(double *spds) override
Read the instantaneous speed of all axes.
bool close() override
Close the device driver by deallocating all resources and closing ports.
bool resetEncoders() override
Reset encoders.
bool detach() override
Detach the object (you must have first called attach).
~ControlBoardCouplingHandler() override=default
bool getEncodersTimed(double *encs, double *t) override
Read the instantaneous acceleration of all axes.
bool getAxes(int *ax) override
Get the number of controlled axes.
ControlBoardCouplingHandler(ControlBoardCouplingHandler &&)=delete
bool resetEncoder(int j) override
ControlBoard methods.
bool getEncoderSpeed(int j, double *sp) override
Read the istantaneous speed of an axis.
bool open(yarp::os::Searchable &prop) override
Open the device driver.
bool getEncoderAcceleration(int j, double *acc) override
Read the instantaneous acceleration of an axis.
bool getJointType(int j, yarp::dev::JointTypeEnum &type) override
Interface implemented by all device drivers.
Interface for getting information about specific axes, if available.
Definition IAxisInfo.h:36
Control board, extend encoder interface with timestamps.
A container for a device driver.
Definition PolyDriver.h:23
Helper interface for an object that can wrap/or "attach" to a single other device.
A base class for nested structures that can be searched.
Definition Searchable.h:31