ocra-recipes
Doxygen documentation for the ocra-recipes repository
ServerCommunications.h
Go to the documentation of this file.
1 #ifndef SERVER_COMMUNICATIONS_H
2 #define SERVER_COMMUNICATIONS_H
3 
4 #include <iostream>
5 #include <memory>
6 
7 #include <ocra/util/Macros.h>
8 
10 #include <ocra/control/Model.h>
12 
14 #include <wocra/WocraController.h>
15 
16 #include <Eigen/Dense>
17 #include <Eigen/Lgsm>
18 
19 
20 // TODO: Should put in defines for yarp independent builds
21 #include <yarp/os/Bottle.h>
22 #include <yarp/os/RpcServer.h>
23 #include <yarp/os/Port.h>
24 #include <yarp/os/PortReader.h>
25 #include <yarp/os/ConnectionReader.h>
26 
27 
29 #include <ocra/util/ErrorsHelper.h>
30 
31 namespace ocra_recipes
32 {
33 class ServerCommunications : public yarp::os::PortReader
34 {
36 public:
38  ServerCommunications(ocra::Controller::Ptr ctrl, ocra::Model::Ptr mdl);
39 
40  virtual ~ServerCommunications();
41 
42  bool open();
43  void close();
44 
45  virtual bool read(yarp::os::ConnectionReader& connection);
46  void parseMessage(yarp::os::Bottle& input, yarp::os::Bottle& reply);
47 
48 
49 private:
50  ocra::Model::Ptr model;
51  ocra::Controller::Ptr controller;
52 
53  yarp::os::RpcServer rpcServerPort;
54  yarp::os::Port outputPort;
55 
56  std::string rpcServerPort_Name;
57  std::string outputPort_Name;
58 };
59 } // namespace ocra_recipes
60 #endif // SERVER_COMMUNICATIONS_H
Define the LQP-based controller developped during my PhD thesis with ocra framework.
Define the internal solver class that can be used in the wOcra controller.
Declaration file of the Model class.
#define DEFINE_CLASS_POINTER_TYPEDEFS(Class)
Definition: Macros.h:8
Controller interface.
virtual bool read(yarp::os::ConnectionReader &connection)
void parseMessage(yarp::os::Bottle &input, yarp::os::Bottle &reply)