50 #include <visp3/core/vpPoseVector.h> 51 #include <visp3/core/vpMath.h> 52 #include <visp3/core/vpDebug.h> 53 #include <visp3/core/vpMatrixException.h> 54 #include <visp3/core/vpException.h> 172 const double tux,
const double tuy,
const double tuz)
201 const double tux,
const double tuy,
const double tuz)
248 for (
unsigned int i =0 ; i < 3 ; i++) {
250 (*this)[i+3] = tu[i] ;
315 R.
buildFrom((*
this)[3], (*
this)[4], (*
this)[5]);
371 for (
unsigned int i =0 ; i < 6 ; i++)
372 if (i<3) std::cout << (*this)[i] <<
" " ;
374 std::cout <<std::endl ;
395 "Cannot save the pose vector: ofstream not openned")) ;
414 for (
unsigned int i=0 ; i < 6 ; i++) {
420 "Cannot read pose vector: ifstream not openned")) ;
457 typedef std::string::size_type size_type;
462 std::vector<std::string> values(m*n);
463 std::ostringstream oss;
464 std::ostringstream ossFixed;
465 std::ios_base::fmtflags original_flags = oss.flags();
468 ossFixed.setf ( std::ios::fixed, std::ios::floatfield );
470 size_type maxBefore=0;
471 size_type maxAfter=0;
473 for (
unsigned int i=0;i<m;++i) {
476 if (oss.str().find(
"e")!=std::string::npos){
478 ossFixed << (*this)[i];
479 oss.str(ossFixed.str());
483 size_type thislen=values[i].size();
484 size_type p=values[i].find(
'.');
486 if (p==std::string::npos){
496 size_type totalLength=length;
500 maxAfter=std::min(maxAfter, totalLength-maxBefore);
501 if (maxAfter==1) maxAfter=0;
506 if (intro) s <<intro;
507 s <<
"["<<m<<
","<<n<<
"]=\n";
509 for (
unsigned int i=0;i<m;i++) {
511 size_type p=values[i].find(
'.');
512 s.setf(std::ios::right, std::ios::adjustfield);
513 s.width((std::streamsize)maxBefore);
514 s <<values[i].substr(0,p).c_str();
517 s.setf(std::ios::left, std::ios::adjustfield);
518 if (p!=std::string::npos){
519 s.width((std::streamsize)maxAfter);
520 s <<values[i].substr(p,maxAfter).c_str();
523 s.width((std::streamsize)maxAfter);
533 s.flags(original_flags);
535 return (
int)(maxBefore+maxAfter);
void load(std::ifstream &f)
void save(std::ofstream &f) const
void extract(vpRotationMatrix &R) const
Implementation of an homogeneous matrix and operations on such kind of matrices.
Implementation of row vector and the associated operations.
error that can be emited by ViSP classes.
unsigned int getRows() const
Return the number of rows of the 2D array.
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.
void extract(vpRotationMatrix &R) const
vpThetaUVector buildFrom(const vpHomogeneousMatrix &M)
vpTranslationVector getTranslationVector() const
static Type maximum(const Type &a, const Type &b)
Implementation of a rotation matrix and operations on such kind of matrices.
vpThetaUVector getThetaUVector() const
unsigned int rowNum
Number of rows in the array.
void set(const double tx, const double ty, const double tz, const double tux, const double tuy, const double tuz)
vpRotationMatrix buildFrom(const vpHomogeneousMatrix &M)
Implementation of a rotation vector as quaternion angle minimal representation.
static double deg(double rad)
vpRotationMatrix getRotationMatrix() const
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)
Class that consider the case of a translation vector.
Implementation of a rotation vector as axis-angle minimal representation.