ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | Q&A
Ask Your Question

Create quaternion from euler in arduino

asked 2019-11-09 11:02:17 -0600

mateusguilherme gravatar image


How to create a quaternion from Euler angles in arduino?

In python it is possible to use this function:

from geometry_msgs.msg import Quaternion
import tf
odom_orientation = Quaternion()
odom_orientation = tf.transformations.quaternion_from_euler(0.0, 0.0, th)


edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2019-11-09 11:47:37 -0600

parzival gravatar image

Hi, since you just want yaw and not pitch and roll, you can use the following:

geometry_msgs::Quaternion odom_quat = tf::createQuaternionMsgFromYaw(th);
edit flag offensive delete link more


Add the following includes:

#include <tf/transform_broadcaster.h>
parzival gravatar image parzival  ( 2019-11-09 11:48:40 -0600 )edit
parzival gravatar image parzival  ( 2019-11-09 11:57:03 -0600 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2019-11-09 11:02:17 -0600

Seen: 653 times

Last updated: Nov 09 '19