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 <yarp/os/PeriodicThread.h>
7#include <yarp/os/Property.h>
8
9#include <yarp/dev/DeviceDriver.h>
10#include <yarp/dev/IRGBDSensor.h>
11#include <yarp/dev/PolyDriver.h>
12
13#include <yarp/sig/IntrinsicParams.h>
14#include <yarp/sig/PointCloudUtils.h>
15#include <yarp/sig/Vector.h>
16
17#include <openrave/openrave.h>
18
19#include "YarpOpenraveBase.hpp"
20
21#define DEFAULT_PERIOD 0.1 // [s]
22#define DEFAULT_LOCAL_PREFIX "/YarpOpenraveDepthToMesh/client"
23
24namespace roboticslab
25{
26
39 public yarp::os::PeriodicThread,
40 public yarp::dev::DeviceDriver
41{
42public:
43 YarpOpenraveMeshFromRealDepth() : yarp::os::PeriodicThread(DEFAULT_PERIOD)
44 {}
45
46 // ------- DeviceDriver declarations. Implementation in DeviceDriverImpl.cpp -------
47 bool open(yarp::os::Searchable & config) override;
48 bool close() override;
49
50protected:
51 // ------- PeriodicThread declarations. Implementation in PeriodicThreadImpl.cpp -------
52 void run() override;
53
54private:
55 yarp::dev::PolyDriver sensorDevice;
56 yarp::dev::IRGBDSensor * iRGBDSensor {nullptr};
57 yarp::sig::IntrinsicParams depthIntrinsicParams;
58 yarp::sig::VectorOf<yarp::os::Property> meshOptions;
59
60 OpenRAVE::KinBodyPtr previousMesh {nullptr};
61 OpenRAVE::RobotBase::AttachedSensorPtr depthSensor;
62
63 yarp::sig::utils::PCL_ROI roi;
64 int stepX {1};
65 int stepY {1};
66};
67
68} // namespace roboticslab
69
70#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:41
The main, catch-all namespace for Robotics Lab UC3M.
Definition groups.dox:5