#include <visp3/core/vpIoTools.h>
#include <visp3/core/vpXmlParserHomogeneousMatrix.h>
int main()
{
#ifdef ENABLE_VISP_NAMESPACE
#endif
#if defined(VISP_HAVE_PUGIXML)
std::cout << "Create: " << tmp_dir << std::endl;
std::string filename = tmp_dir + "test_write_homogeneous.xml";
{
std::cout << "Write to: " << filename << std::endl;
std::cerr << "Cannot save XML file: " << filename << std::endl;
return EXIT_FAILURE;
}
}
{
xml.
parse(cMo_read, filename,
"cMo");
std::cout << "cMo write:\n" << cMo << std::endl;
std::cout << "cMo read:\n" << cMo_read << std::endl;
for (unsigned int i = 0; i < 3; i++) {
for (unsigned int j = 0; j < 3; j++) {
if (!
vpMath::equal(cMo[i][j], cMo_read[i][j], std::numeric_limits<double>::epsilon())) {
std::cerr << "Issue when parsing XML file: " << filename << std::endl;
return EXIT_FAILURE;
}
}
}
}
#endif
return EXIT_SUCCESS;
}
Implementation of an homogeneous matrix and operations on such kind of matrices.
static double rad(double deg)
static bool equal(double x, double y, double threshold=0.001)
Implementation of a rotation vector as axis-angle minimal representation.
Class that consider the case of a translation vector.
XML parser to load and save an homogeneous matrix in a file.
int parse(vpHomogeneousMatrix &M, const std::string &filename, const std::string &name)
int save(const vpHomogeneousMatrix &M, const std::string &filename, const std::string &name)