Lab 2A Finding Position and Interpolation with Quaternions

Similar documents
Lab 1 RVIZ and PYTHON with Simple Robot Manipulator Model

The Kinematic Chain or Tree can be represented by a graph of links connected though joints between each Link and other links.

ROS-Industrial Basic Developer s Training Class. Southwest Research Institute

EECS 4330/7330 Introduction to Mechatronics and Robotic Vision, Fall Lab 5. Controlling Puma Using Leap Motion Device

CS354 Computer Graphics Rotations and Quaternions

Quaternions and Rotations

Quaternions and Rotations

IMAGE-BASED RENDERING AND ANIMATION

12.1 Quaternions and Rotations

ISE 422/ME 478/ISE 522 Robotic Systems

Quaternions and Rotations

Computer Animation Fundamentals. Animation Methods Keyframing Interpolation Kinematics Inverse Kinematics

Quaternions and Rotations

Animation. Keyframe animation. CS4620/5620: Lecture 30. Rigid motion: the simplest deformation. Controlling shape for animation

Autonomous Navigation for Flying Robots

IntroductionToRobotics-Lecture02

Orientation & Quaternions

A simple example. Assume we want to find the change in the rotation angles to get the end effector to G. Effect of changing s

Transformation. Jane Li Assistant Professor Mechanical Engineering & Robotics Engineering

Animation Curves and Splines 2

Crea%ve So*ware Project Duckietown Descrip%on. Nick Wang

Introducing MoveIt! First, start the Baxter simulator in Gazebo:

SUMMARY. CS380: Introduction to Computer Graphics Track-/Arc-ball Chapter 8. Min H. Kim KAIST School of Computing 18/04/06.

CW High School. Advanced Math A. 1.1 I can make connections between the algebraic equation or description for a function, its name, and its graph.

3D Kinematics. Consists of two parts

URDF and You ROSCON David Lu!! Ph.D. Student Washington University In St. Louis. May 19, 2012

ROS-Industrial Basic Developer s Training Class

Inverse Kinematics Analysis for Manipulator Robot With Wrist Offset Based On the Closed-Form Algorithm

Computer Animation II

Robot mechanics and kinematics

Dynamics Analysis for a 3-PRS Spatial Parallel Manipulator-Wearable Haptic Thimble

ME 597: AUTONOMOUS MOBILE ROBOTICS SECTION 2 COORDINATE TRANSFORMS. Prof. Steven Waslander

Math Section 4.2 Radians, Arc Length, and Area of a Sector

This week. CENG 732 Computer Animation. Warping an Object. Warping an Object. 2D Grid Deformation. Warping an Object.

Quaternions & Rotation in 3D Space

Construction of SCARA robot simulation platform based on ROS

WORKING WITH BAXTER MOVEIT, PILLAR AND OTHER OBJECTS

EE-565-Lab2. Dr. Ahmad Kamal Nasir

Analytical and Applied Kinematics

Robot mechanics and kinematics

Kinematics and Orientations

CS184: Using Quaternions to Represent Rotation

Game Programming. Bing-Yu Chen National Taiwan University

Basilio Bona ROBOTICA 03CFIOR 1

Rigging / Skinning. based on Taku Komura, Jehee Lee and Charles B.Own's slides

Fundamentals of Computer Animation

CS 475 / CS 675 Computer Graphics. Lecture 16 : Interpolation for Animation

Fundamentals of Computer Animation

Inertial Measurement Units II!

Kinematics. Kinematics analyzes the geometry of a manipulator, robot or machine motion. The essential concept is a position.

3D Modelling: Animation Fundamentals & Unit Quaternions

ROBOTICS 01PEEQW. Basilio Bona DAUIN Politecnico di Torino

Inverse Kinematics of 6 DOF Serial Manipulator. Robotics. Inverse Kinematics of 6 DOF Serial Manipulator

Applications of Dual Quaternions in Three Dimensional Transformation and Interpolation

3D Game Engine Programming. Understanding Quaternions. Helping you build your dream game engine. Posted on June 25, 2012 by Jeremiah van Oosten

Visual Recognition: Image Formation

Animation. Animation

Inverse Kinematics of a Rhino Robot

Lecture 22 of 41. Animation 2 of 3: Rotations, Quaternions Dynamics & Kinematics

Lecture 22 of 41. Animation 2 of 3: Rotations, Quaternions Dynamics & Kinematics

Animation and Quaternions

Chapter 3 : Computer Animation

Rotations in 3D Graphics and the Gimbal Lock

INSTITUTE OF AERONAUTICAL ENGINEERING

Robot Inverse Kinematics Asanga Ratnaweera Department of Mechanical Engieering

Exercise 1: Kinematics of the ABB IRB 120

Geometric transformations in 3D and coordinate frames. Computer Graphics CSE 167 Lecture 3

Kinematics of the Stewart Platform (Reality Check 1: page 67)

Introduction to Robotics

Quaternions and Euler Angles

Robotics kinematics and Dynamics

CS 4621 PPA3: Animation

3D Transformations. CS 4620 Lecture 10. Cornell CS4620 Fall 2014 Lecture Steve Marschner (with previous instructors James/Bala)

Quaternion Rotations AUI Course Denbigh Starkey

3D Transformations. CS 4620 Lecture Kavita Bala w/ prior instructor Steve Marschner. Cornell CS4620 Fall 2015 Lecture 11

Lecture 3.5: Sumary of Inverse Kinematics Solutions

ROBOTICS 01PEEQW Laboratory Project #1. Basilio Bona DAUIN Politecnico di Torino

Industrial Robots : Manipulators, Kinematics, Dynamics

CALCULATING TRANSFORMATIONS OF KINEMATIC CHAINS USING HOMOGENEOUS COORDINATES

CS283: Robotics Fall 2016: Sensors

ROBOTICS 01PEEQW Laboratory Project #1. Basilio Bona DAUIN Politecnico di Torino

Articulated Robots! Robert Stengel! Robotics and Intelligent Systems! MAE 345, Princeton University, 2017

METR Robotics Tutorial 2 Week 3: Homogeneous Coordinates SOLUTIONS & COMMENTARY

Solving the Kinematics of Planar Mechanisms. Jassim Alhor

1 Trigonometry. Copyright Cengage Learning. All rights reserved.

Animation. Computer Graphics COMP 770 (236) Spring Instructor: Brandon Lloyd 4/23/07 1

METR 4202: Advanced Control & Robotics

3. Manipulator Kinematics. Division of Electronic Engineering Prof. Jaebyung Park

T. Moulard () ROS tutorial January / 32

Inverse Kinematics. Given a desired position (p) & orientation (R) of the end-effector

Advanced Computer Graphics Transformations. Matthias Teschner

4 Kinematic Linkages. Chapter 4. Kinematic Linkages. Department of Computer Science and Engineering 4-1

Sphero Lightning Lab Cheat Sheet

Lecture 24 of 41. Collision Handling Part 1 of 2: Separating Axes, Oriented Bounding Boxes

In this section, we will study the following topics:

Math 1330 Section 4.2 Section 4.2: Radians, Arc Length, and Area of a Sector

1. Introduction 1 2. Mathematical Representation of Robots

Jane Li. Assistant Professor Mechanical Engineering Department, Robotic Engineering Program Worcester Polytechnic Institute

Robot Programming with Lisp

CS612 - Algorithms in Bioinformatics

Transcription:

Lab 2A Finding Position and Interpolation with Quaternions In this Lab we will learn how to use the RVIZ Robot Simulator, Python Programming Interpreter and ROS tf library to study Quaternion math. There are three sections to this lab: a Basic Operations b Calculating Position c Interpolation of Quaternions and SLERP For all sections of the lab a-b type the follow command into a terminal window: roslaunch urdf_tutorial display.launch model:=urdf/joint6.urdf gui:=true The above command can also be copied and pasted into the terminal window to save some typing. L2A.1 Basic Operations In the previous labs conversion of quaternions, have converted quaternions to and from Euler angles as well as quaternions to and from axis angles. We will need some additional operations to compute position from quaternions, specifically normalizing a quaternion, finding the conjugate of a quaternion and the inverse of a quaternion. Finally, another example of quaternion multiplications will be presented. Normalizing/Inverse/Conjugate To normalize a quaternion we multiply q1 through q4 by the sum of the squares to produce values that range from 0 to 1.0. 1 * [q1, q2, q3,q4] q1 +q2 + q32 +q4 2 2 2 Quaternions in the RVIZ screen shots used in this lab are already normalized so: 1= q12 +q2 2+ q32 +q42 The conjugate of a normalized quaternion is the same as the inverse or: [q1, -q2, -q3, -q4] Page 1

We only need to negate each of the three vector components to get the conjugate of the normalized quaternion. Multiplying Page 2

In robot in the above screen shot is more complex than robots previously introduced. The Unified Robot Description Format (URDF) defined a robot with twists in the frame about the between link 3 and link 4. The joint definition in the URDF file for the robot is shown below: <joint name="up_down_movement" type="revolute"> <parent link="link3"/> <child link="link4"/> <axis xyz="1 0 0" /> <origin rpy="-1.5708 0-0.05258" xyz="0.02 0.0 0.0"/> <limit upper="0.95" lower ="-0.35" effort="1.0" velocity="1.0"/> </joint> The origin for link 4 has a roll pitch yaw of -1.5708 radians 0-0.05258. The roll of -1.5708 radians is about the x axis using the right hand rule. The yaw of -0.05258 radians is about the z axis. The roll converts from radians to -90. The yaw converts from radians to -3. Since the up_down_movement slider for the joint is set to zero the only rotation between link3 and link 4 with respect to link 3, is due to the twist in the frame. We can use the following code similar to what we saw in Lab 2: r = -1.5708 p = 0.0 y = -0.05258 q = tf.transformations.quaternion_from_euler(r, p, y, sxyz ) [-0.70686373 0.01858773-0.01858766 0.70686113] There are some roundoff errors in the above quaternion from link 4 orientation due to roundoff errors on the slider display. Page 3

Multiplication of quaternions represent rotations in 3D space. If we multiply the orientation of Link 3 by the relative orientation of Link4 we obtain the orientation of Link 4. rel_orientation4 = [-0.50146, 0.013186, -0.02274, 0.86478] orientation3 = [0, 0, 0.15837, 0.98738] orientation4 = tf.transformations.quaternion_multiply(orientation3, rel_orientation4) [-0.49721984-0.06639663 0.11450219 0.85746781] We can get the euler angles from the quaternion: print tf.transformations.euler_from_quaternion(orientation4) (-1.0509730495220082, -4.226410320329458e-07, 0.2655000992653402) Converting from radians we get a roll of -60, pitch of 0 and yaw of 15. Page 4

L2A.2 Calculating Position In ROS position between each frame of a kinematic chain is found using the tf Library. Using the six joint robot arm in the RVIZ screen shot below we can display what the position of each link for the robot. The tf Library calculates the position taking into account the quaternion values for each revolute joint in the robot. Since joint quaternions can be generated at different data rates tf extrapolates the joint values given the time received. In the example below the joint angles were constant so the extrapolation of joint values can be ignored and the position between frames can be calculated using following equation: n = q p q* Where n is the position of the next link in the Kinematic chain, p is the position of the previous link in the chain, q is the quaternion for the revolute joint, and q* is the quaternion conjugate of q. Note that the equation multiplies a position by a quaternion. The position is a 3 dimensional vector and a quaternion is composed of a 3 dimensional vector in imaginary space and an associated scaler value. To multiply the position by the quaternion we add a zero to the position to make it a 4 vector like the quaternion (x, y,z,0). The position is not normalized in the calculation. python import tf import math p3 = [0, 0.5, 0] Page 5

q = [0.76942, 0.25, 0.18164, 0.55902] qc = tf.transformations.quaternion_conjugate(q) qp = tf.transformations.quaternion_multiply(q,p) p4 = tf.transformations.quaternion_multiply(qp,qc) print p4 [ 0.27951245-0.38471117-0.15450534 0. ] pnext = p4 + p3 print pnext [ 0.45226245-0.62247117 2.24999466 0. ] Page 6

L2A.3 Interpolation of Quaternions and SLERP We can represent a rotation with two quaternions multiplying one another. But sometimes we want to find the intermediate orientations or the quaternions along the arc of the rotation. Spherical Interpolation is one method of finding intermediate orientations along the arc of rotation. SLERP is very useful for displaying a robots motion and computer graphics in general. We obtain from the above screen shot the orientation of the aircraft for yaw of [0,0,0,1]. The next screen shot below gives us a orientation for yaw of [0,0,0.70711,0.70711]. We did a 90 rotation to get from [0,0,0,1] to [0,0,0.70711,0.70711]. But we want to find the orientations or quaternions between these two orientations. Page 7

The screen shot below shows the orientation of the aircraft at 45 degrees for half way through the 90 rotation. Page 8

To find the orientation ½ way through the 90 rotation using slerp type in the following code in a terminal window: python import tf p1 = [0,0,0,1] p3 = [0,0, 0.70711, 0.70711] p2 = tf.transformations.quaternion_slerp(p1,p3,0.5) print p2 You should then see displayed on the terminal the value you see in the above screen shot for orientation of yaw with small roundoff errors. Find the orientation at 10 and 75 for the aircraft. Page 9