34 #include <VisionX/interface/components/OpenPoseEstimationInterface.h>
35 #include <VisionX/interface/components/RGBDImageProvider.h>
40 #include <Image/IplImageAdaptor.h>
41 #include <Image/PrimitivesDrawer.h>
45 #include <SimoxUtility/json/json.hpp>
65 offeringTopic(getProperty<std::string>(
"OpenPoseEstimation2DTopicName").getValue());
66 listener2DPrx = getTopic<OpenPose2DListenerPrx>(
67 getProperty<std::string>(
"OpenPoseEstimation2DTopicName").getValue());
68 offeringTopic(getProperty<std::string>(
"OpenPoseEstimation3DTopicName").getValue());
69 listener3DPrx = getTopic<OpenPose3DListenerPrx>(
70 getProperty<std::string>(
"OpenPoseEstimation3DTopicName").getValue());
74 robotStateInterface = getProxy<RobotStateComponentInterfacePrx>(
75 getProperty<std::string>(
"RobotStateComponentName").getValue(),
false,
"",
false);
76 if (robotStateInterface)
83 ARMARX_ERROR <<
"RobotStateCompontent is not avaiable, 3D-Estimation will be deactivated!!";
142 ARMARX_INFO <<
"Starting OpenPoseEstimation -- 3D";
154 ARMARX_INFO <<
"Stopping OpenPoseEstimation -- 3D";
160 openPoseArVizLayer.
clear();
168 using json = nlohmann::json;
170 json jsonView = json::parse(text.message);
173 long timestamp = jsonView[
"timestamp"].get<
long>();
174 json jsonValues = jsonView[
"values"];
179 OpenPoseSimulation::run()
184 while (running2D && !runTask->isStopped())
188 long timeProvidedImage = IceUtil::Time::now().toMilliSeconds();
190 if (running3D && localRobot)
196 localRobot, robotStateInterface, timeProvidedImage);
203 listener2DPrx->report2DKeypoints({}, timeProvidedImage);
204 listener2DPrx->report2DKeypointsNormalized({}, timeProvidedImage);
207 listener3DPrx->report3DKeypoints({}, timeProvidedImage);
213 listener2DPrx->report2DKeypoints({}, timeProvidedImage);
214 listener2DPrx->report2DKeypointsNormalized({}, timeProvidedImage);
225 defineOptionalProperty<std::string>(
"OpenPoseEstimation2DTopicName",
"OpenPoseEstimation2D");
226 defineOptionalProperty<std::string>(
"OpenPoseEstimation3DTopicName",
"OpenPoseEstimation3D");
228 defineOptionalProperty<std::string>(
"RobotStateComponentName",
"RobotStateComponent");
229 defineOptionalProperty<std::string>(
230 "CameraNodeName",
"DepthCamera",
"Name of the robot node for the input camera");