25 #include <Eigen/Geometry>
35 #include <Calibration/Calibration.h>
36 #include <Image/ImageProcessor.h>
37 #include <Image/IplImageAdaptor.h>
38 #include <Image/PrimitivesDrawer.h>
39 #include <Image/PrimitivesDrawerCV.h>
46 using namespace std::filesystem;
56 usingProxy(
"ObjectPoseProvider");
57 usingProxy(getProperty<std::string>(
"RobotStateComponentName").getValue());
58 offeringTopic(getProperty<std::string>(
"DebugDrawerTopicName").getValue());
65 getProxy(prx,
"ObjectPoseProvider");
66 debugDrawerTopicPrx = getTopic<armarx::DebugDrawerInterfacePrx>(
67 getProperty<std::string>(
"DebugDrawerTopicName").getValue());
68 if (!debugDrawerTopicPrx)
73 robotStateComponent = getProxy<armarx::RobotStateComponentInterfacePrx>(
74 getProperty<std::string>(
"RobotStateComponentName").getValue());
80 UCLObjectRecognition::createPropertyDefinitions()
86 memoryx::ObjectLocalizationResultList
88 const memoryx::ObjectClassNameList& classes,
95 auto agentName = getProperty<std::string>(
"AgentName").getValue();
96 auto cameraFrame = getProperty<std::string>(
"CameraFrameName").getValue();
97 auto mapping =
armarx::Split(getProperty<std::string>(
"ObjectNameIdMap"),
";",
true,
true);
98 std::map<std::string, int> nameIdMap;
99 for (
auto entry : mapping)
109 memoryx::ObjectLocalizationResultList result;
110 for (
auto className : classes)
114 auto id = nameIdMap[className];
115 auto regResult = prx->getObjectPose(
id);
116 if (regResult.confidence <= 0)
121 memoryx::ObjectLocalizationResult r;
122 r.instanceName = className;
123 r.objectClassName = className;
124 r.recognitionCertainty = regResult.confidence * 0.2;
127 Eigen::Map<Eigen::Matrix4f>(regResult.matrix4x4.data()).transpose();
128 pose.block<3, 1>(0, 3) *= 1000.0;
136 localRobot->getRobotNode(cameraFrame)->getGlobalPose() * pose;
137 debugDrawerTopicPrx->setPoseVisu(getName(), className +
"_global",
new Pose{gpose});
168 Eigen::Vector3f cov(10, 10, 10000);