openrave-yarp-plugins
OywPortReader.hpp
1 // -*- mode:C++; tab-width:4; c-basic-offset:4; indent-tabs-mode:nil -*-
2 
3 #ifndef __OYW_PORT_READER_HPP__
4 #define __OYW_PORT_READER_HPP__
5 
6 #include <yarp/os/Bottle.h>
7 #include <yarp/os/PortReader.h>
8 
9 #include <openrave/openrave.h>
10 
11 namespace roboticslab
12 {
13 
14 class OpenraveYarpWorld;
15 
20 class OywPortReader : public yarp::os::PortReader
21 {
22 public:
23  OywPortReader() : boxCount(0), sboxCount (0), cylCount(0), scylCount(0), sphCount(0), ssphCount(0), meshCount(0), fileCount(0) {}
24  void setOpenraveYarpWorldPtr(OpenraveYarpWorld *value) { openraveYarpWorldPtr = value; }
25 
26 private:
27  OpenraveYarpWorld* openraveYarpWorldPtr;
28 
29  // box/sbox/cyl/scyl/sph/ssph
30  std::vector<OpenRAVE::KinBodyPtr> objKinBodyPtrs;
31  int boxCount, sboxCount, cylCount, scylCount, sphCount, ssphCount, meshCount, fileCount;
32 
33  int robotDraw;
34  double drawRadius, drawR, drawG, drawB;
35 
36  // Implement the actual responder (callback on RPC).
37  bool read(yarp::os::ConnectionReader& in) override;
38 
39  // Internally used members
40  bool checkIfString(yarp::os::Bottle& request, int index, yarp::os::Bottle& response);
41  bool tryToSetActiveManipulator(const std::string& robot, const std::string& manipulator, yarp::os::Bottle& response);
42 };
43 
44 } // namespace roboticslab
45 
46 #endif // __OYW_PORT_READER_HPP__
Opens YARP RpcPort, to control environment.
Definition: OpenraveYarpWorld.hpp:29
Processes RPC requests for OpenraveYarpWorld.
Definition: OywPortReader.hpp:21
The main, catch-all namespace for Robotics Lab UC3M.
Definition: groups.dox:5