Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tranimate with sequences of SE3 #8

Closed
wants to merge 2 commits into from
Closed

tranimate with sequences of SE3 #8

wants to merge 2 commits into from

Conversation

mfkenson
Copy link
Contributor

Refer to issue https://github.com/petercorke/spatialmath-python/issues/4

use case 1: quaterion interpolation

import matplotlib
matplotlib.use('TkAgg')
from spatialmath import *
from spatialmath.base import *
from roboticstoolbox.tools.trajectory import lspb, tpoly, ctraj, jtraj
import math

r1 = SE3.Rx(math.pi/2)
r2 = SE3.Rz(-math.pi/2)
q1 = UnitQuaternion(r1)
q2 = UnitQuaternion(r2)
traj = []
steps = 50
for i in range(0, steps):
    traj.append(q1.interp(1.0*i/steps, q2).SE3().A)
tranimate(traj, dims = [-1,1], repeat=True)

use case 2:

import matplotlib
matplotlib.use('TkAgg')
from spatialmath import *
from spatialmath.base import *
from roboticstoolbox.tools.trajectory import lspb, tpoly, ctraj, jtraj

T0 = SE3(0, 0, 0)
T3 = SE3(3, 3, 3)

traj = []
steps = 50
for i in range(steps):
    traj.append(ctraj(T0, T3, 1.0*i/steps).A)

tranimate(traj, dims = [0,5], repeat=True)

@codecov-io
Copy link

Codecov Report

Merging #8 (a0b8c2d) into master (4f29a45) will decrease coverage by 0.10%.
The diff coverage is 50.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master       #8      +/-   ##
==========================================
- Coverage   76.46%   76.35%   -0.11%     
==========================================
  Files          18       18              
  Lines        3174     3185      +11     
==========================================
+ Hits         2427     2432       +5     
- Misses        747      753       +6     
Impacted Files Coverage Δ
spatialmath/base/animate.py 55.13% <50.00%> (-0.38%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 4f29a45...a0b8c2d. Read the comment docs.

@mfkenson mfkenson closed this Feb 14, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants