24 #include <Image/PrimitivesDrawerCV.h>
25 #include <Image/PrimitivesDrawer.h>
38 #include <Image/ImageProcessor.h>
39 #include <Image/IplImageAdaptor.h>
41 #include <Eigen/Geometry>
42 #include <Calibration/Calibration.h>
46 using namespace std::filesystem;
54 usingProxy(
"ObjectPoseProvider");
55 usingProxy(getProperty<std::string>(
"RobotStateComponentName").getValue());
56 offeringTopic(getProperty<std::string>(
"DebugDrawerTopicName").getValue());
63 getProxy(prx,
"ObjectPoseProvider");
64 debugDrawerTopicPrx = getTopic<armarx::DebugDrawerInterfacePrx>(getProperty<std::string>(
"DebugDrawerTopicName").getValue());
65 if (!debugDrawerTopicPrx)
70 robotStateComponent = getProxy<armarx::RobotStateComponentInterfacePrx>(getProperty<std::string>(
"RobotStateComponentName").getValue());
83 getConfigIdentifier()));
94 auto agentName = getProperty<std::string>(
"AgentName").getValue();
95 auto cameraFrame = getProperty<std::string>(
"CameraFrameName").getValue();
96 auto mapping =
armarx::Split(getProperty<std::string>(
"ObjectNameIdMap"),
";",
true,
true);
97 std::map<std::string, int> nameIdMap;
98 for (
auto entry : mapping)
108 memoryx::ObjectLocalizationResultList result;
109 for (
auto className : classes)
112 auto id = nameIdMap[className];
113 auto regResult = prx->getObjectPose(
id);
114 if (regResult.confidence <= 0)
119 memoryx::ObjectLocalizationResult r;
120 r.instanceName = className;
121 r.objectClassName = className;
122 r.recognitionCertainty = regResult.confidence * 0.2;
124 Eigen::Matrix4f pose = Eigen::Map<Eigen::Matrix4f>(regResult.matrix4x4.data()).transpose();
125 pose.block<3, 1>(0, 3) *= 1000.0;
132 const Eigen::Matrix4f gpose = localRobot->getRobotNode(cameraFrame)->getGlobalPose() * pose;
133 debugDrawerTopicPrx->setPoseVisu(getName(), className +
"_global",
new Pose {gpose});
164 Eigen::Vector3f cov(10, 10, 10000);