30 #include <Eigen/Geometry>
32 #include <pcl/filters/crop_box.h>
34 #include <opencv2/opencv.hpp>
40 #include <RobotAPI/interface/visualization/DebugDrawerInterface.h>
47 #include <VisionX/interface/components/ObjectLocalizerInterfaces.h>
52 #include <Image/ImageProcessor.h>
53 #include <Image/IplImageAdaptor.h>
55 #include <MemoryX/interface/observers/ObjectMemoryObserverInterface.h>
56 #include <MemoryX/interface/workingmemory/WorkingMemoryUpdaterBase.h>
70 defineOptionalProperty<std::string>(
"providerName",
"OpenNIPointCloudProvider",
"");
71 defineOptionalProperty<std::string>(
72 "RobotStateComponentProxyName",
"RobotStateComponent",
"");
73 defineOptionalProperty<std::string>(
"HandNameInRobotModel",
"TCP R",
"");
74 defineOptionalProperty<std::string>(
"HandNameInMemory",
"handright3aRGBD",
"");
75 defineOptionalProperty<std::string>(
"SensorFrameName",
"DepthCamera",
"");
76 defineOptionalProperty<std::string>(
77 "RightHandNameViewSelection",
"handright3a",
"Name of the normal hand");
78 defineOptionalProperty<std::string>(
"MarkerName",
"Marker R",
"");
79 defineOptionalProperty<std::string>(
80 "DebugDrawerTopicName",
82 "Name of the debug drawer topic that should be used");
84 defineOptionalProperty<bool>(
85 "PrimitiveCalibrationOnStart",
87 "If true the component calibrates itself in a primitive way.");
88 defineOptionalProperty<float>(
"MarkerRadiusMM", 10,
"");
90 defineOptionalProperty<float>(
"uncertaintyMM", 100,
"");
92 defineOptionalProperty<int>(
"hueMin", 48,
"");
93 defineOptionalProperty<int>(
"hueMax", 90,
"");
95 defineOptionalProperty<int>(
"satMin", 50,
"");
96 defineOptionalProperty<int>(
"satMax", 255,
"");
98 defineOptionalProperty<int>(
"valMin", 105,
"");
99 defineOptionalProperty<int>(
"valMax", 255,
"");
117 virtual public ObjectLocalizerPointCloudAndImageInterface
126 return "RGBDHandLocalizer";
129 memoryx::ObjectLocalizationResultList
148 std::string providerName;
151 getFramedPosition(pcl::PointCloud<pcl::PointXYZRGBA>::Ptr,
int x,
int y);
156 int calibrationCounter = 0;
157 Eigen::Vector3f calibrationSum = Eigen::Vector3f::Zero();
159 std::mutex positionLock;
161 pcl::CropBox<pcl::PointXYZRGBA> cropper;
163 std::string sensorFrameName;
164 std::string markerFrameName;
165 std::string handFrameName;
168 void calcPositions(cv::Mat& binaryImage,
169 pcl::PointCloud<pcl::PointXYZRGBA>::Ptr pointcloud,
170 std::vector<Eigen::Vector3f>& medianCoordinates);
171 void cropFilter(pcl::PointCloud<pcl::PointXYZRGBA>::Ptr
input,
172 pcl::PointCloud<pcl::PointXYZRGBA>::Ptr output,
174 Eigen::Vector3f guessMM);