ROS Answers: Open Source Q&A Forum - RSS feedhttps://answers.ros.org/questions/Open source question and answer forum written in Python and DjangoenROS Answers is licensed under Creative Commons Attribution 3.0Sat, 25 Apr 2020 17:44:13 -0500Compute quaternion from angular velocity Twisthttps://answers.ros.org/question/350618/compute-quaternion-from-angular-velocity-twist/ Hi,
I'm using ROS melodic with kitti bag file.
I'm running Ubuntu 18.04 on i7 , with kernel 5.3.0-42-generic.
I get the odometry of a Kitti bag file with viso2_ros.
I want to predict the poses of the robot. To compute the next pose I should compute the quaternion of the robot. How can I compute it from angular velocity?
ThanksSat, 25 Apr 2020 13:12:57 -0500https://answers.ros.org/question/350618/compute-quaternion-from-angular-velocity-twist/Answer by pring for <p>Hi,</p>
<p>I'm using ROS melodic with kitti bag file.
I'm running Ubuntu 18.04 on i7 , with kernel 5.3.0-42-generic.
I get the odometry of a Kitti bag file with viso2_ros.
I want to predict the poses of the robot. To compute the next pose I should compute the quaternion of the robot. How can I compute it from angular velocity? </p>
<p>Thanks</p>
https://answers.ros.org/question/350618/compute-quaternion-from-angular-velocity-twist/?answer=350621#post-id-350621Quaternions are the angular part of a non-moving pose. Angular velocity is a measurement of how fast an object is rotating about a certain point.
If you're looking for prediction, I suggest using forward Euler.
theta_t = theta_t-1 + omega_theta * dtheta/dt
Where theta is an angle and omega is the angular velocity.
You'll likely want to convert between quaternion and euler notation, in which ros has the following functions
import tf
quat = tf.transformations.quaternion_from_euler(roll, pitch, yaw)
(roll, pitch, yaw) = tf.transformations.euler_from_quaternion(quat)
Sat, 25 Apr 2020 14:14:46 -0500https://answers.ros.org/question/350618/compute-quaternion-from-angular-velocity-twist/?answer=350621#post-id-350621Comment by YounÃ¨s for <p>Quaternions are the angular part of a non-moving pose. Angular velocity is a measurement of how fast an object is rotating about a certain point.</p>
<p>If you're looking for prediction, I suggest using forward Euler.</p>
<pre><code>theta_t = theta_t-1 + omega_theta * dtheta/dt
</code></pre>
<p>Where theta is an angle and omega is the angular velocity.</p>
<p>You'll likely want to convert between quaternion and euler notation, in which ros has the following functions</p>
<pre><code>import tf
quat = tf.transformations.quaternion_from_euler(roll, pitch, yaw)
(roll, pitch, yaw) = tf.transformations.euler_from_quaternion(quat)
</code></pre>
https://answers.ros.org/question/350618/compute-quaternion-from-angular-velocity-twist/?comment=350644#post-id-350644Thank you. It works fine.Sat, 25 Apr 2020 17:44:13 -0500https://answers.ros.org/question/350618/compute-quaternion-from-angular-velocity-twist/?comment=350644#post-id-350644