openrave-yarp-plugins
OpenraveYarpWorldClientMesh.hpp
1 // -*- mode:C++; tab-width:4; c-basic-offset:4; indent-tabs-mode:nil -*-
2 
3 #ifndef __OPENRAVE_YARP_WORLD_CLIENT_MESH_HPP__
4 #define __OPENRAVE_YARP_WORLD_CLIENT_MESH_HPP__
5 
6 #include <mutex>
7 #include <string>
8 #include <vector>
9 
10 #include <yarp/os/BufferedPort.h>
11 #include <yarp/os/ResourceFinder.h>
12 #include <yarp/os/RFModule.h>
13 #include <yarp/os/RpcClient.h>
14 
15 namespace roboticslab
16 {
17 
21 class OywCallbackPort : public yarp::os::BufferedPort<yarp::os::Bottle>
22 {
23 public:
24  OywCallbackPort();
25  std::vector<std::string> availableIds;
26  std::mutex availableIdsMutex;
27  double lastTime;
28 
29 private:
30  virtual void onRead(yarp::os::Bottle & b) override;
31 };
32 
36 class OpenraveYarpWorldClientMesh : public yarp::os::RFModule
37 {
38 public:
40  bool configure(yarp::os::ResourceFinder & rf) override;
41 
42 private:
43  yarp::os::RpcClient rpcClient;
44  OywCallbackPort callbackPort;
45  std::string openedId;
46 
47  bool openedInAvailable();
48  bool detectedFirst;
49 
50  double getPeriod() override;
51  bool updateModule() override;
52  bool close() override;
53 };
54 
55 } // namespace roboticslab
56 
57 #endif // __OPENRAVE_YARP_WORLD_CLIENT_MESH_HPP__
Definition: OpenraveYarpWorldClientMesh.hpp:37
Definition: OpenraveYarpWorldClientFile.hpp:21
The main, catch-all namespace for Robotics Lab UC3M.
Definition: groups.dox:5