YARP
Yet Another Robot Platform
 
Loading...
Searching...
No Matches
ControlBoard_nws_yarp.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_CONTROLBOARD_NWS_YARP_H
7#define YARP_DEV_CONTROLBOARD_NWS_YARP_H
8
12
18#include <yarp/dev/IMotor.h>
27#include <yarp/dev/IAxisInfo.h>
33#include <yarp/dev/IMotor.h>
34
36#include <yarp/os/Stamp.h>
37#include <yarp/sig/Vector.h>
38
40
41#include <string>
42
44#include "RPCMessagesParser.h"
46
68{
69private:
70 yarp::os::BufferedPort<yarp::sig::Vector> outputPositionStatePort; // Port /state:o streaming out the encoder positions
71 yarp::os::BufferedPort<CommandMessage> inputStreamingPort; // Input streaming port for high frequency commands
72 yarp::os::Port inputRPCPort; // Input RPC port for set/get remote calls
73 yarp::os::Port extendedOutputStatePort; // Port /stateExt:o streaming out the struct with the robot data
74
75 yarp::os::PortWriterBuffer<yarp::dev::impl::jointData> extendedOutputState_buffer; // Buffer associated to the extendedOutputStatePort port
76 yarp::os::PortReaderBuffer<yarp::os::Bottle> inputRPC_buffer; // Buffer associated to the inputRPCPort port
77
78 RPCMessagesParser RPC_parser; // Message parser associated to the inputRPCPort port
79 StreamingMessagesParser streaming_parser; // Message parser associated to the inputStreamingPort port
80
81 std::string partName; // to open ports and print more detailed debug messages
82 yarp::sig::Vector times; // time for each joint
83 yarp::os::Stamp time; // envelope to attach to the state port
84
85 size_t subdevice_joints {0};
86 bool subdevice_ready = false;
87
88 yarp::dev::IPidControl* iPidControl{nullptr};
89 yarp::dev::IPositionControl* iPositionControl{nullptr};
90 yarp::dev::IPositionDirect* iPositionDirect{nullptr};
91 yarp::dev::IVelocityControl* iVelocityControl{nullptr};
92 yarp::dev::IEncodersTimed* iEncodersTimed{nullptr};
93 yarp::dev::IMotor* iMotor{nullptr};
94 yarp::dev::IMotorEncoders* iMotorEncoders{nullptr};
95 yarp::dev::IAmplifierControl* iAmplifierControl{nullptr};
96 yarp::dev::IControlLimits* iControlLimits{nullptr};
97 yarp::dev::IControlCalibration* iControlCalibration{nullptr};
98 yarp::dev::ITorqueControl* iTorqueControl{nullptr};
99 yarp::dev::IImpedanceControl* iImpedanceControl{nullptr};
100 yarp::dev::IControlMode* iControlMode{nullptr};
101 yarp::dev::IAxisInfo* iAxisInfo{nullptr};
102 yarp::dev::IPreciselyTimed* iPreciselyTimed{nullptr};
103 yarp::dev::IInteractionMode* iInteractionMode{nullptr};
104 yarp::dev::IRemoteVariables* iRemoteVariables{nullptr};
105 yarp::dev::IPWMControl* iPWMControl{nullptr};
106 yarp::dev::ICurrentControl* iCurrentControl{nullptr};
107 yarp::dev::IJointFault* iJointFault{ nullptr };
108
109 bool setDevice(yarp::dev::DeviceDriver* device, bool owned);
110 bool openAndAttachSubDevice(yarp::os::Property& prop);
111
112 void closeDevice();
113 void closePorts();
114
115public:
121 ~ControlBoard_nws_yarp() override = default;
122
123 // yarp::dev::DeviceDriver
124 bool close() override;
125 bool open(yarp::os::Searchable& prop) override;
126
127 // yarp::dev::WrapperSingle
128 bool attach(yarp::dev::PolyDriver* poly) override;
129 bool detach() override;
130
131 // yarp::os::PeriodicThread
132 void run() override;
133};
134
135
136#endif // YARP_DEV_CONTROLBOARD_NWS_YARP_H
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_nws_yarp.
controlBoard_nws_yarp: A controlBoard network wrapper server for YARP.
~ControlBoard_nws_yarp() override=default
void run() override
Loop function.
ControlBoard_nws_yarp & operator=(const ControlBoard_nws_yarp &)=delete
bool open(yarp::os::Searchable &prop) override
Open the DeviceDriver.
ControlBoard_nws_yarp & operator=(ControlBoard_nws_yarp &&)=delete
ControlBoard_nws_yarp(const ControlBoard_nws_yarp &)=delete
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).
ControlBoard_nws_yarp(ControlBoard_nws_yarp &&)=delete
Helper object for parsing RPC port messages.
Callback implementation after buffered input.
Interface implemented by all device drivers.
Interface for control devices, amplifier commands.
Interface for getting information about specific axes, if available.
Definition IAxisInfo.h:36
Interface for control devices, calibration commands.
Interface for control devices, commands to get/set position and veloity 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 getting info about the fault which may occur on a robot.
Definition IJointFault.h:23
Control board, encoder interface.
Control board, encoder interface.
Definition IMotor.h:94
Interface for controlling an axis, by sending directly a PWM reference signal to a motor.
Definition IPWMControl.h:23
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.
IRemoteVariables interface.
Interface for control boards implementing torque control.
Interface for control boards implementing velocity control.
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 mini-server for performing network communication in the background.
An abstraction for a periodic thread.
A mini-server for network communication.
Definition Port.h:46
A class for storing options and configuration information.
Definition Property.h:33
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:21