1 #include <visp3/vision/vpHandEyeCalibration.h> 4 int main(
int argc,
char *argv[])
6 unsigned int ndata = 0;
7 for (
int i = 1; i < argc; i++) {
8 if (std::string(argv[i]) ==
"--ndata" && i+1 < argc) {
9 ndata = atoi(argv[i+1]);
10 }
else if (std::string(argv[i]) ==
"--help") {
11 std::cout << argv[0] <<
" [--ndata <number of data to process>] " 12 "[--help]" << std::endl;
17 std::cout <<
"Number of data to process not specified" << std::endl;
18 std::cout << argv[0] <<
" --help" << std::endl;
21 std::vector<vpHomogeneousMatrix> cMo(ndata);
22 std::vector<vpHomogeneousMatrix> wMe(ndata);
25 for (
unsigned int i = 1; i <= ndata; i++) {
26 std::ostringstream ss_fPe, ss_cPo;
27 ss_fPe <<
"pose_fPe_" << i <<
".yaml";
28 ss_cPo <<
"pose_cPo_" << i <<
".yaml";
29 std::cout <<
"Use fPe=" << ss_fPe.str() <<
", cPo=" << ss_cPo.str() << std::endl;
32 if (wPe.
loadYAML(ss_fPe.str(), wPe) ==
false) {
33 std::cout <<
"Unable to read data from: " << ss_fPe.str() << std::endl;
39 if (cPo.
loadYAML(ss_cPo.str(), cPo) ==
false) {
40 std::cout <<
"Unable to read data from: " << ss_cPo.str() << std::endl;
49 std::ofstream file_eMc(
"eMc.txt");
53 std::cout <<
"\nSave eMc.yaml" << std::endl;
54 pose_vec.saveYAML(
"eMc.yaml", pose_vec);
56 std::cout <<
"\nOutput: Hand-eye calibration result: eMc estimated " << std::endl;
57 std::cout << eMc << std::endl;
static bool loadYAML(const std::string &filename, vpArray2D< Type > &A, char *header=NULL)
Implementation of an homogeneous matrix and operations on such kind of matrices.
static int calibrate(const std::vector< vpHomogeneousMatrix > &cMo, const std::vector< vpHomogeneousMatrix > &rMe, vpHomogeneousMatrix &eMc)
static double deg(double rad)
Implementation of a pose vector and operations on poses.
void save(std::ofstream &f) const
Implementation of a rotation vector as axis-angle minimal representation.