achllle / dual_quaternions Goto Github PK
View Code? Open in Web Editor NEWdual quaternions libraries
License: MIT License
dual quaternions libraries
License: MIT License
Using some properties as in e.g. http://www.roboticsproceedings.org/rss12/p13.pdf
http://build.ros.org/job/Nbin_uF64__dual_quaternions__ubuntu_focal_amd64__binary/1/console
12:16:20 CMake Error at /opt/ros/noetic/share/catkin/cmake/catkin_python_setup.cmake:56 (message):
12:16:20 catkin_python_setup() version in setup.py (0.3.0) differs from version in
12:16:20 package.xml (0.3.1)
12:16:20 Call Stack (most recent call first):
12:16:20 CMakeLists.txt:8 (catkin_python_setup)
Looks like there's an issue with the 0.3.1
tag
Line 8 in 19bee60
Hello
First thanks a lot for this nice code,
I could not find a solution to compute the axis postion of the rotations, and then I realize one should use dual quaternion and I found your code, with the nice .screw method !
this is not really an issue, but I am just seeking for advise.
how would you define a distance between 2 quaternions ?
Many thanks
We find that the interpolation algorithm fails to converge when two double quaternions are close, leading to a very outrageous result.
As shown below, the terminal feedback position T is
array([[-1.50605828e-01, 9.78038623e-01, 1.44077536e-01,
-1.28873894e+03],
[ 1.31112452e-01, 1.64213295e-01, -9.77672501e-01,
-3.56061344e+02],
[-9.79860913e-01, -1.28352817e-01, -1.52964521e-01,
-2.03949883e+02],
[ 0.00000000e+00, 0.00000000e+00, 0.00000000e+00,
1.00000000e+00]])
here is the simplified code.
from scipy.spatial.transform import Rotation
import numpy as np
from dual_quaternions import DualQuaternion
T1 = np.array([[-1.20911060e-02, -9.99300112e-01, 3.53990259e-02,
-4.36968382e+00],
[ 9.93674343e-01, -1.59607498e-02, -1.11160043e-01,
1.54711835e+01],
[ 1.11647238e-01, 3.38310559e-02, 9.93171865e-01,
9.34843861e-01],
[ 0.00000000e+00, 0.00000000e+00, 0.00000000e+00,
1.00000000e+00]])
T2 = np.array([[-3.37726903e-02, -9.99344514e-01, 1.30364371e-02,
-4.47583692e+00],
[ 9.92807002e-01, -3.50451704e-02, -1.14481845e-01,
1.54705164e+01],
[ 1.14863668e-01, 9.07630609e-03, 9.93339800e-01,
9.37977190e-01],
[ 0.00000000e+00, 0.00000000e+00, 0.00000000e+00,
1.00000000e+00]])
# Rotation matrices
R1 = T1[:3, :3]
R2 = T2[:3, :3]
# euler angles
euler1 = Rotation.from_matrix(R1).as_euler('zyx')
euler2 = Rotation.from_matrix(R2).as_euler('zyx')
print("Euler angles for T1: ", euler1)
print("Euler angles for T2: ", euler2)
dq1 = DualQuaternion.from_homogeneous_matrix(T1)
dq2 = DualQuaternion.from_homogeneous_matrix(T2)
delta = 0.5
# sclerp
dq = DualQuaternion.sclerp(dq1, dq2, delta)
T = dq.homogeneous_matrix()
# Linear interpolation is not satisfied
np.dot(np.linalg.inv(T1), T) - np.dot(T, np.linalg.inv(T2))
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.