On this page

Quaternion QML Type

Factory functions for constructing quaternion values. More...

Import Statement: import QtRos2.GeometryMsgs
Status: Experimental Extension

Methods

Detailed Description

A singleton helper (mirroring QtQuick3D's Quaternion type) that exposes the quaternion factory functions to QML. For example: Quaternion.fromEulerAngles(0, 90, 0).

Method Documentation

quaternion fromEulerAngles(vector3d eulerAngles)

Construct a quaternion from Euler angles in degrees.

Components of eulerAngles are (x = roll about X, y = pitch about Y, z = yaw about Z), ROS axis convention. An overload taking three real arguments (x, y, z) is also available.

quaternion fromQuaternion(QQuaternion q)

Construct a quaternion from a quaternion.

Takes the components of q in ROS order.

quaternion fromRpy(vector3 rpy)

Construct a quaternion from roll/pitch/yaw in radians.

Equivalent to fromEulerAngles, but rpy is in radians.

© 2026 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.