41 #include <visp3/core/vpVelocityTwistMatrix.h>
42 #include <visp3/core/vpException.h>
62 for (
int i=0; i<6; i++)
64 for (
int j=0; j<6; j++)
80 for (
unsigned int i=0 ; i < 6 ; i++)
81 for (
unsigned int j=0 ; j < 6; j++)
204 for (
unsigned int i=0;i<6;i++)
205 for (
unsigned int j=0;j<6;j++)
208 for (
int k=0;k<6;k++)
256 "Cannot multiply a (6x6) velocity twist matrix by a (%dx%d) matrix",
261 for (
unsigned int i=0;i<6;i++)
262 for (
unsigned int j=0;j<M.
getCols();j++)
265 for (
unsigned int k=0;k<6;k++)
290 "Cannot multiply a (6x6) velocity twist matrix by a (%d) column vector",
296 for (
unsigned int i=0;i<6;i++) {
297 for (
unsigned int j=0;j<6;j++) {
325 for (i=0 ; i < 3 ; i++)
326 for (j=0 ; j < 3 ; j++)
328 (*this)[i][j] = R[i][j] ;
329 (*this)[i+3][j+3] = R[i][j] ;
330 (*this)[i][j+3] = skewaR[i][j] ;
406 for (
unsigned int i=0 ; i < 3 ; i++)
407 for (
unsigned int j=0 ; j < 3; j++)
408 R[i][j] = (*
this)[i][j];
417 for (
unsigned int i=0 ; i < 3 ; i++)
418 for (
unsigned int j=0 ; j < 3; j++)
419 skTR[i][j] = (*
this)[i][j+3];
449 typedef std::string::size_type size_type;
454 std::vector<std::string> values(m*n);
455 std::ostringstream oss;
456 std::ostringstream ossFixed;
457 std::ios_base::fmtflags original_flags = oss.flags();
460 ossFixed.setf ( std::ios::fixed, std::ios::floatfield );
462 size_type maxBefore=0;
463 size_type maxAfter=0;
465 for (
unsigned int i=0;i<m;++i) {
466 for (
unsigned int j=0;j<n;++j){
468 oss << (*this)[i][j];
469 if (oss.str().find(
"e")!=std::string::npos){
471 ossFixed << (*this)[i][j];
472 oss.str(ossFixed.str());
475 values[i*n+j]=oss.str();
476 size_type thislen=values[i*n+j].size();
477 size_type p=values[i*n+j].find(
'.');
479 if (p==std::string::npos){
489 size_type totalLength=length;
493 maxAfter=std::min(maxAfter, totalLength-maxBefore);
494 if (maxAfter==1) maxAfter=0;
499 if (intro) s <<intro;
500 s <<
"["<<m<<
","<<n<<
"]=\n";
502 for (
unsigned int i=0;i<m;i++) {
504 for (
unsigned int j=0;j<n;j++){
505 size_type p=values[i*n+j].find(
'.');
506 s.setf(std::ios::right, std::ios::adjustfield);
507 s.width((std::streamsize)maxBefore);
508 s <<values[i*n+j].substr(0,p).c_str();
511 s.setf(std::ios::left, std::ios::adjustfield);
512 if (p!=std::string::npos){
513 s.width((std::streamsize)maxAfter);
514 s <<values[i*n+j].substr(p,maxAfter).c_str();
517 s.width((std::streamsize)maxAfter);
527 s.flags(original_flags);
529 return (
int)(maxBefore+maxAfter);
Implementation of a matrix and operations on matrices.
Implementation of an homogeneous matrix and operations on such kind of matrices.
int print(std::ostream &s, unsigned int length, char const *intro=0) const
error that can be emited by ViSP classes.
vpRotationMatrix t() const
Implementation of a generic 2D array used as vase class of matrices and vectors.
unsigned int getCols() const
Return the number of columns of the 2D array.
static Type maximum(const Type &a, const Type &b)
Implementation of a rotation matrix and operations on such kind of matrices.
vpVelocityTwistMatrix operator*(const vpVelocityTwistMatrix &V) const
vpVelocityTwistMatrix buildFrom(const vpTranslationVector &t, const vpRotationMatrix &R)
vpRotationMatrix buildFrom(const vpHomogeneousMatrix &M)
void extract(vpRotationMatrix &R) const
Implementation of a velocity twist matrix and operations on such kind of matrices.
unsigned int getRows() const
Return the number of rows of the 2D array.
vp_deprecated void setIdentity()
vpVelocityTwistMatrix inverse() const
Invert the velocity twist matrix.
Implementation of column vector and the associated operations.
vpVelocityTwistMatrix & operator=(const vpVelocityTwistMatrix &V)
Class that consider the case of a translation vector.
Implementation of a rotation vector as axis-angle minimal representation.
double ** rowPtrs
Address of the first element of each rows.
void extract(vpRotationMatrix &R) const
Extract the rotation matrix from the velocity twist matrix.