YARP
Yet Another Robot Platform
StreamingMessagesParser.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2006-2020 Istituto Italiano di Tecnologia (IIT)
3  * All rights reserved.
4  *
5  * This software may be modified and distributed under the terms of the
6  * BSD-3-Clause license. See the accompanying LICENSE file for details.
7  */
8 
9 #ifndef YARP_DEV_CONTROLBOARDWRAPPER_STREAMINGMESSAGESPARSER_H
10 #define YARP_DEV_CONTROLBOARDWRAPPER_STREAMINGMESSAGESPARSER_H
11 
12 
13 // This file contains helper functions for the ControlBoardWrapper
14 
15 
16 #include <yarp/os/PortablePair.h>
17 #include <yarp/os/BufferedPort.h>
18 #include <yarp/os/Time.h>
19 #include <yarp/os/Network.h>
20 #include <yarp/os/Stamp.h>
21 #include <yarp/os/Vocab.h>
22 
24 #include <yarp/dev/PolyDriver.h>
27 #include <yarp/sig/Vector.h>
28 #include <yarp/os/Semaphore.h>
29 
30 #include <string>
31 #include <vector>
32 
33 #ifdef MSVC
34  #pragma warning(disable:4355)
35 #endif
36 
37 /*
38  * To optimize memory allocation, for group of joints we can have one mem reserver for rpc port
39  * and on e for streaming. The size could be numOfSubDevices*maxNumOfjointForSubdevice.
40  * (we could also use the actual joint number for each subdevice using a for loop). TODO
41  */
42 
44 
45 
46 /* the control command message type
47 * head is a Bottle which contains the specification of the message type
48 * body is a Vector which move the robot accordingly
49 */
51 
52 
53 
58 {
59 protected:
67 
68 public:
73 
78  void init(ControlBoardWrapper *x);
79 
85  void onRead(CommandMessage& v) override;
86 
87  bool initialize();
88 };
89 
90 #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(ControlBoardWrapper *x)
Initialization.
yarp::dev::IVelocityControl * stream_IVel
yarp::dev::ICurrentControl * stream_ICurrent
void onRead(CommandMessage &v) override
Callback function.
yarp::dev::IPWMControl * stream_IPWM
yarp::dev::ITorqueControl * stream_ITorque
yarp::dev::IPositionControl * stream_IPosCtrl
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:28
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:51
A callback for typed data from a port.