Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

question about the transform between AngleAxis and EulerAngle #28

Open
Torchmm opened this issue Sep 15, 2020 · 1 comment
Open

question about the transform between AngleAxis and EulerAngle #28

Torchmm opened this issue Sep 15, 2020 · 1 comment

Comments

@Torchmm
Copy link

Torchmm commented Sep 15, 2020

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 angle_axis(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/180
M_PI;
float z = 50.0/180*M_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!

@linClubs
Copy link

RPY不是(z-y-x)么

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants