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

orientation ground truth #9

Open
hosh0425 opened this issue Jul 22, 2017 · 1 comment
Open

orientation ground truth #9

hosh0425 opened this issue Jul 22, 2017 · 1 comment

Comments

@hosh0425
Copy link

I need to log ground truth of quadrotor (x,y,yaw). on topic /ground_truth_to_tf/pose robot pose are okey but to calculate robot yaw we need to use orientation. in orientation x and y are

x: -6.87593260918e-20
y: 1.25863102164e-19
approximatly zero and thus the yaw(calculate throw atan2(2*(q0q3+q1q2)),1-2*(q2q2+q3q3)) will be 0 or pi.
what's the solution?

@wilselby
Copy link
Owner

Hello,
Which launch file are you using? The topic "quad/ground_truth/pose" is of type geometry_msgs/PoseStamped. This message type provides position measurements x, y, and z. It also provides orientation as a quaternion using variables x, y, z, and w under orientation. You can convert the oreintation using the getRPY() function. See an example in the quad_controller.cpp file. A code snippet is provided below as well.

  //Convert quaternion to Euler angles
  tf:quaternionMsgToTF(current_gps.pose.pose.orientation, q);
  tf::Matrix3x3(q).getRPY(gps_roll, gps_pitch, gps_yaw);

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