38 #ifndef COAL_TRANSFORM_H
39 #define COAL_TRANSFORM_H
47 typedef Eigen::Quaternion<CoalScalar>
Quatf;
49 static inline std::ostream& operator<<(std::ostream& o,
const Quatf& q) {
50 o <<
"(" << q.w() <<
" " << q.x() <<
" " << q.y() <<
" " << q.z() <<
")";
71 template <
typename Matrixx3Like,
typename Vector3Like>
73 const Eigen::MatrixBase<Vector3Like>& T_)
77 template <
typename Vector3Like>
79 : R(q_.toRotationMatrix()), T(T_) {}
122 template <
typename Matrix3Like,
typename Vector3Like>
124 const Eigen::MatrixBase<Vector3Like>& T_) {
131 R = q_.toRotationMatrix();
136 template <
typename Derived>
142 template <
typename Derived>
151 template <
typename Derived>
157 template <
typename Derived>
159 return R.transpose() * (v - T);
164 R.transposeInPlace();
171 return Transform3s(R.transpose(), -R.transpose() * T);
176 return Transform3s(R.transpose() * other.R, R.transpose() * (other.T - T));
194 Eigen::NumTraits<CoalScalar>::dummy_precision())
const {
195 return R.isIdentity(prec) && T.isZero(prec);
212 inline void setRandom();
220 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
223 template <
typename Derived>
226 return Quatf(Eigen::AngleAxis<CoalScalar>(angle, axis));
264 basis.col(2) = vec.normalized();
265 basis.col(1) = -vec.unitOrthogonal();
266 basis.col(0) = basis.col(1).cross(vec);
#define COAL_DLLAPI
Definition: config.hh:88
#define COAL_DEPRECATED
Definition: deprecated.hh:37
Main namespace.
Definition: broadphase_bruteforce.h:44
Eigen::Matrix< CoalScalar, 3, 3 > Matrix3s
Definition: data_types.h:81
Eigen::Quaternion< CoalScalar > Quaternion3f
Definition: transform.h:46
Matrix3s constructOrthonormalBasisFromVector(const Vec3s &vec)
Construct othonormal basis from vector. The z-axis is the normalized input vector.
Definition: transform.h:262
Quatf uniformRandomQuaternion()
Uniformly random quaternion sphere. Code taken from Pinocchio (https://github.com/stack-of-tasks/pino...
Definition: transform.h:231
Quatf fromAxisAngle(const Eigen::MatrixBase< Derived > &axis, CoalScalar angle)
Definition: transform.h:224
Eigen::Quaternion< CoalScalar > Quatf
Definition: transform.h:47
Eigen::Matrix< CoalScalar, 3, 1 > Vec3s
Definition: data_types.h:77
double CoalScalar
Definition: data_types.h:76