YARP
Yet Another Robot Platform
StreamingMessagesParser.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_CONTROLBOARDWRAPPER_STREAMINGMESSAGESPARSER_H
7 #define YARP_DEV_CONTROLBOARDWRAPPER_STREAMINGMESSAGESPARSER_H
8 
9 
10 // This file contains helper functions for the ControlBoardWrapper
11 
12 
13 #include <yarp/os/BufferedPort.h>
14 #include <yarp/os/Network.h>
15 #include <yarp/os/PortablePair.h>
16 #include <yarp/os/Semaphore.h>
17 #include <yarp/os/Stamp.h>
18 #include <yarp/os/Time.h>
19 #include <yarp/os/Vocab.h>
20 
21 #include <yarp/sig/Vector.h>
22 
26 #include <yarp/dev/PolyDriver.h>
27 
28 #include <string>
29 #include <vector>
30 
31 #ifdef MSVC
32 # pragma warning(disable : 4355)
33 #endif
34 
35 /*
36  * To optimize memory allocation, for group of joints we can have one mem reserver for rpc port
37  * and on e for streaming. The size could be numOfSubDevices*maxNumOfjointForSubdevice.
38  * (we could also use the actual joint number for each subdevice using a for loop). TODO
39  */
40 
41 
42 /* the control command message type
43 * head is a Bottle which contains the specification of the message type
44 * body is a Vector which move the robot accordingly
45 */
47 
52 {
53 protected:
60  int stream_nJoints {0};
61 
62 public:
67 
73 
74  void reset();
75 
81  void onRead(CommandMessage& v) override;
82 
83  bool initialize();
84 };
85 
86 #endif // YARP_DEV_CONTROLBOARDWRAPPER_STREAMINGMESSAGESPARSER_H
define control board standard interfaces
yarp::os::PortablePair< yarp::os::Bottle, yarp::sig::Vector > CommandMessage
contains the definition of a Vector type
Callback implementation after buffered input.
yarp::dev::IPositionDirect * stream_IPosDirect
void init(yarp::dev::DeviceDriver *x)
Initialization.
yarp::dev::IVelocityControl * stream_IVel
yarp::dev::ICurrentControl * stream_ICurrent
void onRead(CommandMessage &v) override
Callback function.
yarp::dev::IPWMControl * stream_IPWM
StreamingMessagesParser()=default
Constructor.
yarp::dev::ITorqueControl * stream_ITorque
yarp::dev::IPositionControl * stream_IPosCtrl
Interface implemented by all device drivers.
Definition: DeviceDriver.h:35
Interface for control boards implementing current control.
Interface for controlling an axis, by sending directly a PWM reference signal to a motor.
Definition: IPWMControl.h:25
Interface for a generic control board device implementing position control.
Interface for a generic control board device implementing position control.
Interface for control boards implementing torque control.
Interface for control boards implementing velocity control.
Group a pair of objects to be sent and received together.
Definition: PortablePair.h:48
A callback for typed data from a port.