openrave-yarp-plugins
Loading...
Searching...
No Matches
YarpOpenraveMeshFromRealDepth.hpp
1// -*- mode:C++; tab-width:4; c-basic-offset:4; indent-tabs-mode:nil -*-
2
3#ifndef __YARP_OPENRAVE_MESH_FROM_REAL_DEPTH_HPP__
4#define __YARP_OPENRAVE_MESH_FROM_REAL_DEPTH_HPP__
5
6#include <vector>
7
8#include <yarp/os/PeriodicThread.h>
9#include <yarp/os/Property.h>
10
11#include <yarp/dev/DeviceDriver.h>
12#include <yarp/dev/IRGBDSensor.h>
13#include <yarp/dev/PolyDriver.h>
14
15#include <yarp/sig/IntrinsicParams.h>
16#include <yarp/sig/PointCloudUtils.h>
17
18#include <openrave/openrave.h>
19
20#include "YarpOpenraveBase.hpp"
21
22#define DEFAULT_PERIOD 0.1 // [s]
23#define DEFAULT_LOCAL_PREFIX "/YarpOpenraveDepthToMesh/client"
24
25namespace roboticslab
26{
27
40 public yarp::os::PeriodicThread,
41 public yarp::dev::DeviceDriver
42{
43public:
44 YarpOpenraveMeshFromRealDepth() : yarp::os::PeriodicThread(DEFAULT_PERIOD)
45 {}
46
47 // ------- DeviceDriver declarations. Implementation in DeviceDriverImpl.cpp -------
48 bool open(yarp::os::Searchable & config) override;
49 bool close() override;
50
51protected:
52 // ------- PeriodicThread declarations. Implementation in PeriodicThreadImpl.cpp -------
53 void run() override;
54
55private:
56 yarp::dev::PolyDriver sensorDevice;
57 yarp::dev::IRGBDSensor * iRGBDSensor {nullptr};
58 yarp::sig::IntrinsicParams depthIntrinsicParams;
59 std::vector<yarp::os::Property> meshOptions;
60
61 OpenRAVE::KinBodyPtr previousMesh {nullptr};
62 OpenRAVE::RobotBase::AttachedSensorPtr depthSensor;
63
64 yarp::sig::utils::PCL_ROI roi;
65 int stepX {1};
66 int stepY {1};
67};
68
69} // namespace roboticslab
70
71#endif // __YARP_OPENRAVE_MESH_FROM_REAL_DEPTH_HPP__
Implements shared configuration functions.
Definition YarpOpenraveBase.hpp:32
Converts depth frames into a 3D mesh.
Definition YarpOpenraveMeshFromRealDepth.hpp:42
The main, catch-all namespace for Robotics Lab UC3M.
Definition groups.dox:5