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