27 #include <VisionX/interface/components/OpenPoseEstimationInterface.h>
31 #include <VisionX/interface/components/RGBDImageProvider.h>
40 #include <Image/IplImageAdaptor.h>
41 #include <Image/PrimitivesDrawer.h>
46 #include <SimoxUtility/json/json.hpp>
66 offeringTopic(getProperty<std::string>(
"OpenPoseEstimation2DTopicName").getValue());
67 listener2DPrx = getTopic<OpenPose2DListenerPrx>(getProperty<std::string>(
"OpenPoseEstimation2DTopicName").getValue());
68 offeringTopic(getProperty<std::string>(
"OpenPoseEstimation3DTopicName").getValue());
69 listener3DPrx = getTopic<OpenPose3DListenerPrx>(getProperty<std::string>(
"OpenPoseEstimation3DTopicName").getValue());
73 robotStateInterface = getProxy<RobotStateComponentInterfacePrx>(getProperty<std::string>(
"RobotStateComponentName").getValue(),
false,
"",
false);
74 if (robotStateInterface)
81 ARMARX_ERROR <<
"RobotStateCompontent is not avaiable, 3D-Estimation will be deactivated!!";
138 ARMARX_INFO <<
"Starting OpenPoseEstimation -- 3D";
149 ARMARX_INFO <<
"Stopping OpenPoseEstimation -- 3D";
155 openPoseArVizLayer.
clear();
162 using json = nlohmann::json;
164 json jsonView = json::parse(text.message);
167 long timestamp = jsonView[
"timestamp"].get<
long>();
168 json jsonValues = jsonView[
"values"];
172 void OpenPoseSimulation::run()
177 while (running2D && !runTask->isStopped())
181 long timeProvidedImage = IceUtil::Time::now().toMilliSeconds();
183 if (running3D && localRobot)
195 listener2DPrx->report2DKeypoints({}, timeProvidedImage);
196 listener2DPrx->report2DKeypointsNormalized({}, timeProvidedImage);
198 listener3DPrx->report3DKeypoints({}, timeProvidedImage);
203 listener2DPrx->report2DKeypoints({}, timeProvidedImage);
204 listener2DPrx->report2DKeypointsNormalized({}, timeProvidedImage);
215 defineOptionalProperty<std::string>(
"OpenPoseEstimation2DTopicName",
"OpenPoseEstimation2D");
216 defineOptionalProperty<std::string>(
"OpenPoseEstimation3DTopicName",
"OpenPoseEstimation3D");
218 defineOptionalProperty<std::string>(
"RobotStateComponentName",
"RobotStateComponent");
219 defineOptionalProperty<std::string>(
"CameraNodeName",
"DepthCamera",
"Name of the robot node for the input camera");