thank you for this nice code.
i have some confuse about the transform between angleaxis and eulerangle in the file of transform.h.
` static Transform exp(const Vector6& vector) {
constexpr float kEpsilon = 1e-8;
const float norm = vector.tail<3>().norm();
if (norm < kEpsilon) {
return Transform(vector.head<3>(), Rotation::Identity());
} else {
return Transform(vector.head<3>(), Rotation(Eigen::AngleAxisf(
norm, vector.tail<3>() / norm)));
}
}
it is hard for me to understand for this:
Eigen::AngleAxis(norm,vector.tail<3>()/norm),can euler angle convert to angle axis like this?
and i try it on a demo,but i can not get the right result.
my demo is like this :
`Eigen::Vector3f p(2,10,3);
float x = 30.0/180M_PI;
float y = 40.0/180M_PI;
float z = 50.0/180M_PI;
Eigen::Vector3f v = Eigen::Vector3f(x,y,z);
float norm = v.norm();
Transform::Vector6 v1;
v1 << 0,0,0,x,y,z;
Transform t = Transform::exp(v1);
cout << t.rotation()p << endl;
tf::Quaternion q = tf::createQuaternionFromRPY(x,y,z);
Eigen::Quaternionf q1(q.w(),q.x(),q.y(),q.z());
cout << q1*p << endl;`
but i get different result;
so can you tell me what is the problem about me?
thank you!
thank you for this nice code. i have some confuse about the transform between angleaxis and eulerangle in the file of transform.h. ` static Transform exp(const Vector6& vector) { constexpr float kEpsilon = 1e-8; const float norm = vector.tail<3>().norm(); if (norm < kEpsilon) { return Transform(vector.head<3>(), Rotation::Identity()); } else { return Transform(vector.head<3>(), Rotation(Eigen::AngleAxisf( norm, vector.tail<3>() / norm))); } }
Vector6 log() const { Eigen::AngleAxisf angleaxis(rotation); return (Vector6() << translation_, angle_axis.angle() * angle_axis.axis()) .finished(); }`
it is hard for me to understand for this: Eigen::AngleAxis(norm,vector.tail<3>()/norm),can euler angle convert to angle axis like this? and i try it on a demo,but i can not get the right result.
my demo is like this : `Eigen::Vector3f p(2,10,3); float x = 30.0/180M_PI; float y = 40.0/180M_PI; float z = 50.0/180M_PI; Eigen::Vector3f v = Eigen::Vector3f(x,y,z); float norm = v.norm(); Transform::Vector6 v1; v1 << 0,0,0,x,y,z; Transform t = Transform::exp(v1); cout << t.rotation()p << endl;
tf::Quaternion q = tf::createQuaternionFromRPY(x,y,z); Eigen::Quaternionf q1(q.w(),q.x(),q.y(),q.z()); cout << q1*p << endl;` but i get different result; so can you tell me what is the problem about me? thank you!