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/BufferedPort.h>
17 #include <yarp/os/Network.h>
18 #include <yarp/os/PortablePair.h>
19 #include <yarp/os/Semaphore.h>
20 #include <yarp/os/Stamp.h>
21 #include <yarp/os/Time.h>
22 #include <yarp/os/Vocab.h>
23 
24 #include <yarp/sig/Vector.h>
25 
29 #include <yarp/dev/PolyDriver.h>
30 
31 #include <string>
32 #include <vector>
33 
34 #ifdef MSVC
35 # pragma warning(disable : 4355)
36 #endif
37 
38 /*
39  * To optimize memory allocation, for group of joints we can have one mem reserver for rpc port
40  * and on e for streaming. The size could be numOfSubDevices*maxNumOfjointForSubdevice.
41  * (we could also use the actual joint number for each subdevice using a for loop). TODO
42  */
43 
44 
45 /* the control command message type
46 * head is a Bottle which contains the specification of the message type
47 * body is a Vector which move the robot accordingly
48 */
50 
55 {
56 protected:
63  int stream_nJoints {0};
64 
65 public:
70 
76 
82  void onRead(CommandMessage& v) override;
83 
84  bool initialize();
85 };
86 
87 #endif // YARP_DEV_CONTROLBOARDWRAPPER_STREAMINGMESSAGESPARSER_H
StreamingMessagesParser::StreamingMessagesParser
StreamingMessagesParser()=default
Constructor.
Network.h
StreamingMessagesParser::stream_IVel
yarp::dev::IVelocityControl * stream_IVel
Definition: StreamingMessagesParser.h:59
yarp::os::PortablePair
Group a pair of objects to be sent and received together.
Definition: PortablePair.h:51
Vector.h
contains the definition of a Vector type
StreamingMessagesParser::stream_ITorque
yarp::dev::ITorqueControl * stream_ITorque
Definition: StreamingMessagesParser.h:60
IPreciselyTimed.h
yarp::dev::DeviceDriver
Interface implemented by all device drivers.
Definition: DeviceDriver.h:38
StreamingMessagesParser::onRead
void onRead(CommandMessage &v) override
Callback function.
Definition: StreamingMessagesParser.cpp:48
yarp::os::TypedReaderCallback
A callback for typed data from a port.
Definition: TypedReaderCallback.h:31
StreamingMessagesParser::init
void init(yarp::dev::DeviceDriver *x)
Initialization.
Definition: StreamingMessagesParser.cpp:25
ControlBoardInterfaces.h
define control board standard interfaces
PortablePair.h
StreamingMessagesParser::stream_IPosCtrl
yarp::dev::IPositionControl * stream_IPosCtrl
Definition: StreamingMessagesParser.h:57
PolyDriver.h
Stamp.h
StreamingMessagesParser::stream_IPosDirect
yarp::dev::IPositionDirect * stream_IPosDirect
Definition: StreamingMessagesParser.h:58
StreamingMessagesParser
Callback implementation after buffered input.
Definition: StreamingMessagesParser.h:55
StreamingMessagesParser::stream_IPWM
yarp::dev::IPWMControl * stream_IPWM
Definition: StreamingMessagesParser.h:61
CommandMessage
yarp::os::PortablePair< yarp::os::Bottle, yarp::sig::Vector > CommandMessage
Definition: StreamingMessagesParser.h:49
yarp::dev::IPWMControl
Interface for controlling an axis, by sending directly a PWM reference signal to a motor.
Definition: IPWMControl.h:28
Semaphore.h
BufferedPort.h
yarp::dev::IVelocityControl
Interface for control boards implementing velocity control.
Definition: IVelocityControl.h:160
yarp::dev::ICurrentControl
Interface for control boards implementing current control.
Definition: ICurrentControl.h:28
StreamingMessagesParser::stream_ICurrent
yarp::dev::ICurrentControl * stream_ICurrent
Definition: StreamingMessagesParser.h:62
yarp::dev::IPositionDirect
Interface for a generic control board device implementing position control.
Definition: IPositionDirect.h:32
Vocab.h
ControlBoardInterfacesImpl.h
Time.h
yarp::dev::ITorqueControl
Interface for control boards implementing torque control.
Definition: ITorqueControl.h:39
yarp::dev::IPositionControl
Interface for a generic control board device implementing position control.
Definition: IPositionControl.h:257
StreamingMessagesParser::initialize
bool initialize()
Definition: StreamingMessagesParser.cpp:37
StreamingMessagesParser::stream_nJoints
int stream_nJoints
Definition: StreamingMessagesParser.h:63