Ask Your Question
0

Does RViz convert quaternion to euler angles and then visualize a frame?

asked 2019-05-08 14:57:57 -0600

jzyyzr gravatar image

I'm wondering how does RViz visualize a quaternion with a frame? Does it convert a quaternion to euler angles and then visualize the frame according to those euler angles? If yes, can someone point me to the code of this quaternion-to-euler conversion?

I'm asking because I noticed that if I use tf.transformations.euler_from_quaternion() function provided by the ROS tf library, the roll angle will drift a lot when pitch is close to ±90°. However, if I provide the same quaternion to RViz, there's no such drifting problem. The visualized frame moves smoothly with any roll/pitch/yaw angles.

edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted
0

answered 2019-05-09 05:38:07 -0600

gvdhoorn gravatar image

I'm wondering how does RViz visualize a quaternion with a frame? Does it convert a quaternion to euler angles and then visualize the frame according to those euler angles?

I don't believe so.

All "visible objects" in RViz apparently derive from rviz::Object of which instances wrap an Ogre::SceneNode. rviz::Object's pose is updated in two ways: either by "inheritance" from another object (ie: multiplying transforms) or by explicitly calling functions like setPosition(..) and setOrientation(..).

The latter accepts an argument of type Ogre::Quaternion (doc, Ogre doc), so no conversion to Euler angles is required when the orientation comes from a TF frame.

edit flag offensive delete link more

Your Answer

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

Add Answer

Question Tools

2 followers

Stats

Asked: 2019-05-08 14:57:57 -0600

Seen: 121 times

Last updated: May 09