34 #include <MemoryX/interface/workingmemory/WorkingMemoryUpdaterBase.h>
36 #include <MemoryX/interface/observers/ObjectMemoryObserverInterface.h>
40 #include <VisionX/interface/components/ObjectLocalizerInterfaces.h>
45 #include <Eigen/Geometry>
47 #include <RobotAPI/interface/visualization/DebugDrawerInterface.h>
50 #include <opencv2/opencv.hpp>
51 #include <Image/IplImageAdaptor.h>
52 #include <Image/ImageProcessor.h>
53 #include <pcl/filters/crop_box.h>
70 defineOptionalProperty<std::string>(
"providerName",
"OpenNIPointCloudProvider",
"");
71 defineOptionalProperty<std::string>(
"RobotStateComponentProxyName",
"RobotStateComponent",
"");
72 defineOptionalProperty<std::string>(
"HandNameInRobotModel",
"TCP R",
"");
73 defineOptionalProperty<std::string>(
"HandNameInMemory",
"handright3aRGBD",
"");
74 defineOptionalProperty<std::string>(
"SensorFrameName",
"DepthCamera",
"");
75 defineOptionalProperty<std::string>(
"RightHandNameViewSelection",
"handright3a",
"Name of the normal hand");
76 defineOptionalProperty<std::string>(
"MarkerName",
"Marker R",
"");
77 defineOptionalProperty<std::string>(
"DebugDrawerTopicName",
"DebugDrawerUpdates",
"Name of the debug drawer topic that should be used");
79 defineOptionalProperty<bool>(
"PrimitiveCalibrationOnStart",
true,
"If true the component calibrates itself in a primitive way.");
80 defineOptionalProperty<float>(
"MarkerRadiusMM", 10,
"");
82 defineOptionalProperty<float>(
"uncertaintyMM", 100,
"");
84 defineOptionalProperty<int>(
"hueMin", 48,
"");
85 defineOptionalProperty<int>(
"hueMax", 90,
"");
87 defineOptionalProperty<int>(
"satMin", 50,
"");
88 defineOptionalProperty<int>(
"satMax", 255,
"");
90 defineOptionalProperty<int>(
"valMin", 105,
"");
91 defineOptionalProperty<int>(
"valMax", 255,
"");
109 virtual public ObjectLocalizerPointCloudAndImageInterface
117 return "RGBDHandLocalizer";
120 memoryx::ObjectLocalizationResultList
localizeObjectClasses(
const memoryx::ObjectClassNameList&,
const Ice::Current&)
override;
140 std::string providerName;
147 int calibrationCounter = 0;
148 Eigen::Vector3f calibrationSum = Eigen::Vector3f::Zero();
150 std::mutex positionLock;
152 pcl::CropBox<pcl::PointXYZRGBA> cropper;
154 std::string sensorFrameName;
155 std::string markerFrameName;
156 std::string handFrameName;
159 void calcPositions(cv::Mat& binaryImage, pcl::PointCloud<pcl::PointXYZRGBA>::Ptr pointcloud, std::vector<Eigen::Vector3f>& medianCoordinates);
160 void cropFilter(pcl::PointCloud<pcl::PointXYZRGBA>::Ptr
input, pcl::PointCloud<pcl::PointXYZRGBA>::Ptr output,
float uncertaintyMM, Eigen::Vector3f guessMM);