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 */
96 yarp::dev::ReturnValue setEncoder(int j, double val) override;
97 yarp::dev::ReturnValue setEncoders(const double *vals) override;
98 yarp::dev::ReturnValue getEncoder(int j, double *v) override;
99 yarp::dev::ReturnValue getEncoders(double *encs) override;
100 yarp::dev::ReturnValue getEncodersTimed(double *encs, double *t) override;
101 yarp::dev::ReturnValue getEncoderTimed(int j, double *v, double *t) override;
102 yarp::dev::ReturnValue getEncoderSpeed(int j, double *sp) override;
103 yarp::dev::ReturnValue getEncoderSpeeds(double *spds) override;
104 yarp::dev::ReturnValue getEncoderAcceleration(int j, double *acc) override;
105 yarp::dev::ReturnValue getEncoderAccelerations(double *accs) override;
106
107 /* IAxisInfo */
108 yarp::dev::ReturnValue getAxes(size_t& ax) override;
109 yarp::dev::ReturnValue getAxisName(int j, std::string &name) override;
111
112};
113
114#endif // YARP_DEV_CONTROLBOARDREMAPPER_CONTROLBOARDREMAPPER_H
define control board standard interfaces
This class is the parameters parser for class ControlBoardCouplingHandler.
yarp::dev::ReturnValue getEncoderTimed(int j, double *v, double *t) override
Read the instantaneous acceleration of all axes.
ControlBoardCouplingHandler & operator=(const ControlBoardCouplingHandler &)=delete
yarp::dev::ReturnValue getEncoders(double *encs) override
Read the position of all axes.
ControlBoardCouplingHandler(const ControlBoardCouplingHandler &)=delete
yarp::dev::ReturnValue getEncoder(int j, double *v) override
Read the value of an encoder.
ControlBoardCouplingHandler & operator=(ControlBoardCouplingHandler &&)=delete
yarp::dev::ReturnValue getJointType(int j, yarp::dev::JointTypeEnum &type) override
bool verbose() const
Return the value of the verbose flag.
yarp::dev::ReturnValue setEncoders(const double *vals) override
Set the value of all encoders.
bool attach(yarp::dev::PolyDriver *poly) override
Attach to another object.
bool close() override
Close the device driver by deallocating all resources and closing ports.
yarp::dev::ReturnValue getEncoderAccelerations(double *accs) override
Read the instantaneous acceleration 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 getEncodersTimed(double *encs, double *t) override
Read the instantaneous acceleration of all axes.
yarp::dev::ReturnValue getEncoderSpeed(int j, double *sp) override
Read the istantaneous speed of an axis.
yarp::dev::ReturnValue getAxes(size_t &ax) override
Get the number of controlled axes.
yarp::dev::ReturnValue resetEncoders() override
Reset encoders.
bool detach() override
Detach the object (you must have first called attach).
yarp::dev::ReturnValue resetEncoder(int j) override
ControlBoard methods.
~ControlBoardCouplingHandler() override=default
yarp::dev::ReturnValue getAxisName(int j, std::string &name) override
ControlBoardCouplingHandler(ControlBoardCouplingHandler &&)=delete
yarp::dev::ReturnValue getEncoderSpeeds(double *spds) override
Read the instantaneous speed of all axes.
yarp::dev::ReturnValue getEncoderAcceleration(int j, double *acc) override
Read the instantaneous acceleration of an axis.
bool open(yarp::os::Searchable &prop) override
Open the device driver.
Interface implemented by all device drivers.
Interface for getting information about specific axes, if available.
Definition IAxisInfo.h:37
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