ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
1

Suppose I have an orientation as roll, pitch, yaw. How can I transform it into quaternion?

asked 2015-03-16 09:41:25 -0500

oogabooga gravatar image

updated 2015-03-16 09:42:28 -0500

I am trying to represent a point (x,y,theta) as a quaternion. What is the easiest way to do that?

edit retag flag offensive close merge delete

2 Answers

Sort by » oldest newest most voted
1

answered 2015-03-16 12:57:02 -0500

tfoote gravatar image

There are many libraries which can do that for you. Bullet, KDL, and Eigen all have methods. There's a summary of available methods here

edit flag offensive delete link more
0

answered 2015-03-17 03:59:14 -0500

oogabooga gravatar image

Thanks. I am aware of those methods. So I am doing it something like this and I hope that this does the job of transforming RPY into Quaternion. Is there any other way to do this?

tf:: Quaternion rotation_rpy;
rotation_rpy.setRPY(x,y, theta);
geometry_msgs::Quaternion rotation_quat;
tf::quaternionTFToMsg(rotation_rpy, rotation_quat);
edit flag offensive delete link more

Comments

Try this

geometry_msgs::Quaternion quat = tf::createQuaternionMsgFromRollPitchYaw(roll, pitch, yaw);
Chaos gravatar image Chaos  ( 2015-03-17 04:03:35 -0500 )edit

Question Tools

1 follower

Stats

Asked: 2015-03-16 09:41:25 -0500

Seen: 902 times

Last updated: Mar 17 '15