Does RViz convert quaternion to euler angles and then visualize a frame?
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.
Asked by jzyyzr on 2019-05-08 14:57:57 UTC
Answers
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.
Asked by gvdhoorn on 2019-05-09 05:38:07 UTC
Comments