Skip to content

Commit 21c0289

Browse files
committed
Small fix
1 parent cc76a96 commit 21c0289

File tree

2 files changed

+7
-8
lines changed

2 files changed

+7
-8
lines changed

src/Dojo.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -257,6 +257,7 @@ export
257257
# Orientation
258258
export
259259
Quaternion,
260+
QuatRotation,
260261
RotX,
261262
RotY,
262263
RotZ,

src/orientation/quaternion.jl

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
1+
Quaternions.Quaternion(q::Rotation) = Quaternion(QuatRotation(q))
2+
# Base.rand(::Type{Quaternion}) = rand(Quaternion{Float64})
3+
MeshCat.LinearMap(q::Quaternion) = MeshCat.LinearMap(QuatRotation(q))
4+
MeshCat.js_quaternion(q::Quaternion) = [q.v1, q.v2, q.v3, q.s]
5+
16
quateltype(x) = eltype(x) # TODO not super elegant
27
quateltype(::Quaternion{T}) where T = T
38

4-
Quaternion(q::Rotation) = Quaternion(QuatRotation(q))
5-
69
vector(q::Quaternion) = SA[q.s, q.v1, q.v2, q.v3]
710
vector(q::AbstractVector) = q
811

@@ -213,9 +216,4 @@ end
213216

214217
function ∂skew∂p(λ) # 𝞉(skew(p)*λ)/∂p
215218
skew(-λ)
216-
end
217-
218-
219-
# MeshCat fixes
220-
MeshCat.LinearMap(q::Quaternion) = MeshCat.LinearMap(QuatRotation(q))
221-
MeshCat.js_quaternion(q::Quaternion) = [q.v1, q.v2, q.v3, q.s]
219+
end

0 commit comments

Comments
 (0)