50 #include <visp3/core/vpDebug.h> 51 #include <visp3/core/vpException.h> 52 #include <visp3/core/vpMath.h> 53 #include <visp3/core/vpMatrixException.h> 54 #include <visp3/core/vpPoseVector.h> 155 void vpPoseVector::set(
const double tx,
const double ty,
const double tz,
const double tux,
const double tuy,
184 const double tuy,
const double tuz)
230 for (
unsigned int i = 0; i < 3; i++) {
232 (*this)[i + 3] = tu[i];
343 for (
unsigned int i = 0; i < 6; i++)
345 std::cout << (*this)[i] <<
" ";
348 std::cout << std::endl;
384 for (
unsigned int i = 0; i < 6; i++) {
424 typedef std::string::size_type size_type;
429 std::vector<std::string> values(m * n);
430 std::ostringstream oss;
431 std::ostringstream ossFixed;
432 std::ios_base::fmtflags original_flags = oss.flags();
435 ossFixed.setf(std::ios::fixed, std::ios::floatfield);
437 size_type maxBefore = 0;
438 size_type maxAfter = 0;
440 for (
unsigned int i = 0; i < m; ++i) {
443 if (oss.str().find(
"e") != std::string::npos) {
445 ossFixed << (*this)[i];
446 oss.str(ossFixed.str());
449 values[i] = oss.str();
450 size_type thislen = values[i].size();
451 size_type p = values[i].find(
'.');
453 if (p == std::string::npos) {
462 size_type totalLength = length;
466 maxAfter = (std::min)(maxAfter, totalLength - maxBefore);
475 s <<
"[" << m <<
"," << n <<
"]=\n";
477 for (
unsigned int i = 0; i < m; i++) {
479 size_type p = values[i].find(
'.');
480 s.setf(std::ios::right, std::ios::adjustfield);
481 s.width((std::streamsize)maxBefore);
482 s << values[i].substr(0, p).c_str();
485 s.setf(std::ios::left, std::ios::adjustfield);
486 if (p != std::string::npos) {
487 s.width((std::streamsize)maxAfter);
488 s << values[i].substr(p, maxAfter).c_str();
490 assert(maxAfter > 1);
491 s.width((std::streamsize)maxAfter);
501 s.flags(original_flags);
503 return (
int)(maxBefore + maxAfter);
void load(std::ifstream &f)
Implementation of an homogeneous matrix and operations on such kind of matrices.
Implementation of row vector and the associated operations.
vpTranslationVector getTranslationVector() const
error that can be emited by ViSP classes.
Type * data
Address of the first element of the data array.
vpQuaternionVector buildFrom(const double qx, const double qy, const double qz, const double qw)
Implementation of a generic 2D array used as vase class of matrices and vectors.
vpThetaUVector buildFrom(const vpHomogeneousMatrix &M)
static Type maximum(const Type &a, const Type &b)
Implementation of a rotation matrix and operations on such kind of matrices.
void extract(vpRotationMatrix &R) const
unsigned int rowNum
Number of rows in the array.
void save(std::ofstream &f) const
void set(const double tx, const double ty, const double tz, const double tux, const double tuy, const double tuz)
vpRotationMatrix getRotationMatrix() const
vpRotationMatrix buildFrom(const vpHomogeneousMatrix &M)
void extract(vpRotationMatrix &R) const
Implementation of a rotation vector as quaternion angle minimal representation.
unsigned int getRows() const
static double deg(double rad)
Implementation of a pose vector and operations on poses.
vpPoseVector buildFrom(const double tx, const double ty, const double tz, const double tux, const double tuy, const double tuz)
vpThetaUVector getThetaUVector() const
Class that consider the case of a translation vector.
Implementation of a rotation vector as axis-angle minimal representation.