43 #include <visp3/core/vpDebug.h> 44 #include <visp3/core/vpException.h> 45 #include <visp3/core/vpForceTwistMatrix.h> 62 for (
int i = 0; i < 6; i++) {
63 for (
int j = 0; j < 6; j++) {
76 for (
unsigned int i = 0; i < 6; i++) {
77 for (
unsigned int j = 0; j < 6; j++) {
275 for (
unsigned int i = 0; i < 6; i++) {
276 for (
unsigned int j = 0; j < 6; j++) {
278 for (
unsigned int k = 0; k < 6; k++)
298 "Cannot multiply (6x6) force/torque twist matrix by a (%dx%d) matrix", M.
getRows(), M.
getCols()));
302 for (
unsigned int i = 0; i < 6; i++) {
303 for (
unsigned int j = 0; j < M.
getCols(); j++) {
305 for (
unsigned int k = 0; k < 6; k++)
363 "Cannot multiply a (6x6) force/torque twist matrix by " 364 "a %d dimension column vector",
370 for (
unsigned int i = 0; i < 6; i++) {
371 for (
unsigned int j = 0; j < 6; j++) {
372 Hout[i] +=
rowPtrs[i][j] * H[j];
402 for (
unsigned int i = 0; i < 3; i++) {
403 for (
unsigned int j = 0; j < 3; j++) {
404 (*this)[i][j] = R[i][j];
405 (*this)[i + 3][j + 3] = R[i][j];
406 (*this)[i + 3][j] = skewaR[i][j];
431 for (
unsigned int i = 0; i < 3; i++) {
432 for (
unsigned int j = 0; j < 3; j++) {
433 (*this)[i][j] = R[i][j];
434 (*this)[i + 3][j + 3] = R[i][j];
435 (*this)[i + 3][j] = 0;
550 typedef std::string::size_type size_type;
555 std::vector<std::string> values(m * n);
556 std::ostringstream oss;
557 std::ostringstream ossFixed;
558 std::ios_base::fmtflags original_flags = oss.flags();
561 ossFixed.setf(std::ios::fixed, std::ios::floatfield);
563 size_type maxBefore = 0;
564 size_type maxAfter = 0;
566 for (
unsigned int i = 0; i < m; ++i) {
567 for (
unsigned int j = 0; j < n; ++j) {
569 oss << (*this)[i][j];
570 if (oss.str().find(
"e") != std::string::npos) {
572 ossFixed << (*this)[i][j];
573 oss.str(ossFixed.str());
576 values[i * n + j] = oss.str();
577 size_type thislen = values[i * n + j].size();
578 size_type p = values[i * n + j].find(
'.');
580 if (p == std::string::npos) {
590 size_type totalLength = length;
594 maxAfter = (std::min)(maxAfter, totalLength - maxBefore);
603 s <<
"[" << m <<
"," << n <<
"]=\n";
605 for (
unsigned int i = 0; i < m; i++) {
607 for (
unsigned int j = 0; j < n; j++) {
608 size_type p = values[i * n + j].find(
'.');
609 s.setf(std::ios::right, std::ios::adjustfield);
610 s.width((std::streamsize)maxBefore);
611 s << values[i * n + j].substr(0, p).c_str();
614 s.setf(std::ios::left, std::ios::adjustfield);
615 if (p != std::string::npos) {
616 s.width((std::streamsize)maxAfter);
617 s << values[i * n + j].substr(p, maxAfter).c_str();
619 assert(maxAfter > 1);
620 s.width((std::streamsize)maxAfter);
630 s.flags(original_flags);
632 return (
int)(maxBefore + maxAfter);
635 #if defined(VISP_BUILD_DEPRECATED_FUNCTIONS) 645 #endif //#if defined(VISP_BUILD_DEPRECATED_FUNCTIONS) vpForceTwistMatrix buildFrom(const vpTranslationVector &t, const vpRotationMatrix &R)
Implementation of a matrix and operations on matrices.
Implementation of an homogeneous matrix and operations on such kind of matrices.
vpForceTwistMatrix & operator=(const vpForceTwistMatrix &H)
error that can be emited by ViSP classes.
Implementation of a generic 2D array used as base class for matrices and vectors. ...
unsigned int getCols() const
vp_deprecated void setIdentity()
static Type maximum(const Type &a, const Type &b)
Implementation of a rotation matrix and operations on such kind of matrices.
vpRotationMatrix getRotationMatrix() const
vpTranslationVector getTranslationVector() const
vpForceTwistMatrix operator*(const vpForceTwistMatrix &F) const
unsigned int getRows() const
Implementation of column vector and the associated operations.
int print(std::ostream &s, unsigned int length, char const *intro=0) const
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.