42 #include <visp3/core/vpXmlParserHomogeneousMatrix.h> 43 #include <visp3/core/vpIoTools.h> 48 std::string tmp_dir =
"C:/temp/";
50 std::string tmp_dir =
"/tmp/";
57 tmp_dir += username +
"/test_xml_parser_homogeneous/";
59 std::cout <<
"Create: " << tmp_dir << std::endl;
65 std::string filename = tmp_dir +
"test_write_homogeneous.xml";
68 std::cout <<
"Write to: " << filename << std::endl;
70 std::cerr <<
"Cannot save XML file: " << filename << std::endl;
78 xml.
parse(cMo_read, filename,
"cMo");
79 std::cout <<
"cMo write:\n" << cMo << std::endl;
80 std::cout <<
"cMo read:\n" << cMo_read << std::endl;
81 for (
unsigned int i = 0; i < 3; i++) {
82 for (
unsigned int j = 0; j < 3; j++) {
83 if (!
vpMath::equal(cMo[i][j], cMo_read[i][j], std::numeric_limits<double>::epsilon())) {
84 std::cerr <<
"Issue when parsing XML file: " << filename << std::endl;
int parse(vpHomogeneousMatrix &M, const std::string &filename, const std::string &name)
Implementation of an homogeneous matrix and operations on such kind of matrices.
static bool equal(double x, double y, double s=0.001)
int save(const vpHomogeneousMatrix &M, const std::string &filename, const std::string &name)
XML parser to load and save an homogeneous matrix in a file.
static double rad(double deg)
Class that consider the case of a translation vector.
Implementation of a rotation vector as axis-angle minimal representation.