openrave-yarp-plugins
OpenraveYarpWorld.hpp
1 // -*- mode:C++; tab-width:4; c-basic-offset:4; indent-tabs-mode:nil -*-
2 
3 #ifndef __OPENRAVE_YARP_WORLD_HPP__
4 #define __OPENRAVE_YARP_WORLD_HPP__
5 
6 #include <yarp/os/Network.h>
7 #include <yarp/os/RpcServer.h>
8 
9 #include <openrave/openrave.h>
10 #include <openrave/plugin.h>
11 
12 #include "OywPortReader.hpp"
13 #include "OywPeriodicWrite.hpp"
14 
15 namespace roboticslab
16 {
17 
28 class OpenraveYarpWorld : public OpenRAVE::ModuleBase
29 {
30 public:
31  OpenraveYarpWorld(OpenRAVE::EnvironmentBasePtr penv);
32 
33  ~OpenraveYarpWorld() override;
34  virtual void Destroy() override;
35 
36  bool addWorldInfo(yarp::os::Bottle & info);
37  int main(const std::string & cmd) override;
38 
39  bool Open(std::ostream & sout, std::istream & sinput);
40 
41 private:
42  yarp::os::Network yarp;
43 
44  OywPortReader oywPortReader;
45  yarp::os::RpcServer oywRpcServer;
46 
47  OywPeriodicWrite oywPeriodicWrite;
48 };
49 
54 class OpenraveYarpWorldPlugin : public RavePlugin
55 {
56 public:
57  OpenRAVE::InterfaceBasePtr CreateInterface(OpenRAVE::InterfaceType type,
58  const std::string & interfacename,
59  std::istream & sinput,
60  OpenRAVE::EnvironmentBasePtr penv) override;
61 
62  const InterfaceMap & GetInterfaces() const override;
63  const std::string & GetPluginName() const override;
64 };
65 
66 } // namespace roboticslab
67 
68 #endif // __OPENRAVE_YARP_WORLD_HPP__
OpenraveYarpWorld plugin.
Definition: OpenraveYarpWorld.hpp:55
Opens YARP RpcPort, to control environment.
Definition: OpenraveYarpWorld.hpp:29
Publishes bodies.
Definition: OywPeriodicWrite.hpp:19
Processes RPC requests for OpenraveYarpWorld.
Definition: OywPortReader.hpp:21
The main, catch-all namespace for Robotics Lab UC3M.
Definition: groups.dox:5