72 cameraImages =
new CByteImage*[2];
76 resultImages =
new CByteImage*[numResultImages];
78 for (
int i = 0; i < numResultImages; i++)
84 StereoCalibrationProviderInterfacePrx calibrationProviderPrx =
85 StereoCalibrationProviderInterfacePrx::checkedCast(imageProviderPrx);
87 if (!calibrationProviderPrx)
89 ARMARX_ERROR <<
"Image provider with name " << providerName
90 <<
" is not a StereoCalibrationProvider" << std::endl;
119 int nNumberImages =
getImages(cameraImages);
124 armarx::PosePtr::dynamicCast(robotStateProxy->getSynchronizedRobot()
125 ->getRobotNode(handFrameName)
126 ->getPoseInRootFrame());
127 Eigen::Matrix4f handNodePose = handNodePosePtr->toEigen();
129 armarx::PosePtr::dynamicCast(robotStateProxy->getSynchronizedRobot()
130 ->getRobotNode(cameraFrameName)
131 ->getPoseInRootFrame());
132 Eigen::Matrix4f cameraNodePose = cameraNodePosePtr->toEigen();
133 Eigen::Matrix4f handPoseInCameraFrame = cameraNodePose.inverse() * handNodePose;
134 Vec3d handNodePosition = {handPoseInCameraFrame(0, 3),
135 handPoseInCameraFrame(1, 3),
136 handPoseInCameraFrame(2, 3)};
137 Mat3d handNodeOrientation = {handPoseInCameraFrame(0, 0),
138 handPoseInCameraFrame(0, 1),
139 handPoseInCameraFrame(0, 2),
140 handPoseInCameraFrame(1, 0),
141 handPoseInCameraFrame(1, 1),
142 handPoseInCameraFrame(1, 2),
143 handPoseInCameraFrame(2, 0),
144 handPoseInCameraFrame(2, 1),
145 handPoseInCameraFrame(2, 2)};
149 double* fingerConfig =
new double[6];
150 fingerConfig[0] = 90 *
M_PI / 180;
151 fingerConfig[1] = 25 *
M_PI / 180;
152 fingerConfig[2] = 15 *
M_PI / 180;
153 fingerConfig[3] = 10 *
M_PI / 180;
154 fingerConfig[4] = 5 *
M_PI / 180;
155 fingerConfig[5] = 5 *
M_PI / 180;
159 double* estimatedConfig =
new double[12];
160 double confidenceRating;
161 handLocalization->LocaliseHand(cameraImages[0],
170 ::ImageProcessor::CopyImage(cameraImages[0], resultImages[0]);
171 ::ImageProcessor::CopyImage(cameraImages[0], resultImages[1]);
172 ::ImageProcessor::CopyImage(cameraImages[0], resultImages[2]);
173 ::ImageProcessor::Zero(resultImages[3]);
175 double* localizationResult = handLocalization->GetResultConfig();
176 handModelVisualizer->UpdateHandModel(localizationResult,
177 drawComplexHandModelInResultImage);
178 delete[] localizationResult;
179 handModelVisualizer->DrawHandModelV2(resultImages[1]);
180 handModelVisualizer->DrawHand(resultImages[2]);
181 handModelVisualizer->DrawSegmentedImage(resultImages[3]);
204 visionx::FramedPositionBaseList ret;
205 std::vector<Vec3d> fingertipPositions = handLocalization->GetFingertipPositions();
207 for (
size_t i = 0; i < fingertipPositions.size(); i++)
209 Eigen::Vector3f position;
210 position << fingertipPositions.at(i).x, fingertipPositions.at(i).y,
211 fingertipPositions.at(i).z;
213 position, cameraFrameName, robotStateProxy->getSynchronizedRobot()->getName());