Skip to content

Commit 8ef741e

Browse files
committed
Remove Rotations.jl dependency
1 parent 3826753 commit 8ef741e

File tree

20 files changed

+32
-34
lines changed

20 files changed

+32
-34
lines changed

Project.toml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ Pkg = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f"
2020
Polyhedra = "67491407-f73d-577b-9b50-8179a7c68029"
2121
Quaternions = "94ee1d12-ae83-5a48-8b1c-48b8ff168ae0"
2222
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
23-
Rotations = "6038ab10-8711-5258-84ad-4b1120ba62dc"
2423
Scratch = "6c6a2e73-6563-6170-7368-637461726353"
2524
SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf"
2625
StaticArrays = "90137ffa-7385-5640-81b9-e52037218182"
@@ -41,7 +40,6 @@ Meshing = "<0.5.7, 0.5.7"
4140
Parameters = "<0.12.0, 0.12.0"
4241
Polyhedra = "<0.7.1, 0.7.1"
4342
Quaternions = "<0.5.3, 0.5.3"
44-
Rotations = "1.1"
4543
Scratch = "1.1"
4644
StaticArrays = "1.2"
4745
julia = "1.6, 1.7"

environments/box2D/methods/initialize.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ function initialize_box2D!(mechanism::Mechanism{T};
7474

7575
set_maximal_configurations!(body,
7676
x=[0.0; position] + [0.0, 0.0 , z],
77-
q=Quaternion(RotX(orientation)))
77+
q=RotX(orientation))
7878
set_maximal_velocities!(body,
7979
v=[0.0; linear_velocity],
8080
ω=[angular_velocity, 0.0, 0.0])

environments/cartpole/methods/initialize.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ function get_cartpole(;
1717
# Links
1818
origin = Origin{Float64}()
1919
slider = Capsule(1.5 * radius, slider_length, slider_mass,
20-
axis_offset=Quaternion(RotX(0.5 * π)),
20+
axis_offset=RotX(0.5 * π),
2121
color=RGBA(0.7, 0.7, 0.7, 1.0))
2222
pendulum = Capsule(radius, pendulum_length, pendulum_mass,
2323
color=RGBA(0.7, 0.7, 0.7, 1.0))
@@ -56,14 +56,14 @@ function initialize_cartpole!(mech::Mechanism{T,Nn,Ne,Nb};
5656
if mode == :down
5757
set_maximal_configurations!(mech.bodies[1], mech.bodies[2],
5858
Δx=[0.0; 0.0; -0.5 * pendulum_length],
59-
Δq=Quaternion(RotX)))
59+
Δq=RotX(π))
6060
set_maximal_velocities!(mech.bodies[2],
6161
v=zeros(3),
6262
ω=zeros(3))
6363
elseif mode == :up
6464
set_maximal_configurations!(mech.bodies[1], mech.bodies[2],
6565
Δx=[0.0; 0.0; 0.5 * pendulum_length],
66-
Δq=Quaternion(RotX)))
66+
Δq=RotX(π))
6767
set_maximal_velocities!(mech.bodies[2],
6868
v=zeros(3),
6969
ω=zeros(3))

environments/dzhanibekov/methods/initialize.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ function get_dzhanibekov(;
1111
main_body = Capsule(radius, body_length, body_mass,
1212
color=color, name=:main)
1313
side_body = Capsule(0.5 * radius, 0.35 * body_length, 0.5 * body_mass,
14-
axis_offset=Quaternion(RotY(0.5 * π)),
14+
axis_offset=RotY(0.5 * π),
1515
color=color, name=:side)
1616
links = [main_body, side_body]
1717

environments/humanoid/methods/initialize.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@ function get_humanoid(;
2525

2626
aa = -0.43000 * [-0.44721, 0.00000, 0.89442]
2727
ql = axis_angle_to_quaternion(aa)
28-
qll = ql * Quaternion(RotXYZ(roll=-1.57080, pitch=1.47585, yaw=-1.47585)) # roll pitch yaw
29-
qlr = ql * Quaternion(RotXYZ(roll=+1.57080, pitch=1.47585, yaw=+1.47585)) # roll pitch yaw
28+
qll = ql * RotX(-1.57080)*RotY(1.47585)*RotZ(-1.47585) # Quaternion(RotXYZ(roll=-1.57080, pitch=1.47585, yaw=-1.47585)) # roll pitch yaw
29+
qlr = ql * RotX(+1.57080)*RotY(1.47585)*RotZ(+1.47585) # Quaternion(RotXYZ(roll=+1.57080, pitch=1.47585, yaw=+1.47585)) # roll pitch yaw
3030

3131
pfll = vector_rotate([ 0.5 * left_foot.shape.shape[1].rh[2] + 0.03500; -0.03; 0.0], qll)
3232
pbll = vector_rotate([-0.5 * left_foot.shape.shape[1].rh[2] + 0.03500; -0.03; 0.0], qll)

environments/orbital/methods/initialize.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ function initialize_orbital!(mechanism::Mechanism{T};
5555
# set position and velocities
5656
set_maximal_configurations!(mechanism.origin, pbody,
5757
child_vertex=vert11,
58-
Δq=Quaternion(RotX(0.0)))
58+
Δq=RotX(0.0))
5959

6060
set_minimal_coordinates!(mechanism, mechanism.joints[2], orientation)
6161

environments/pendulum/methods/initialize.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ function initialize_npendulum!(mechanism::Mechanism{T};
106106
# set position and velocities
107107
set_maximal_configurations!(mechanism.origin, pbody,
108108
child_vertex=vert11,
109-
Δq=Quaternion(RotX(base_angle)))
109+
Δq=RotX(base_angle))
110110
set_maximal_velocities!(pbody,
111111
ω=base_angular_velocity)
112112

environments/raiberthopper/methods/env.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ function visualize(env::Environment{RaibertHopper}, traj::Vector{Vector{T}};
142142
name=name)
143143
step = range(0.0, stop=norm(dir), length=n_leg)
144144
for i = 1:n_leg
145-
MeshCat.settransform!(env.vis["leg$i"], MeshCat.compose(MeshCat.Translation(step[i] .* dir_norm + x_foot), MeshCat.LinearMap(Rotations.RotY(0.0))))
145+
MeshCat.settransform!(env.vis["leg$i"], MeshCat.compose(MeshCat.Translation(step[i] .* dir_norm + x_foot), MeshCat.LinearMap(Dojo.RotY(0.0))))
146146
end
147147
end
148148
end

environments/raiberthopper/methods/initialize.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ function initialize_raiberthopper!(mech::Mechanism{T,Nn,Ne,Nb};
9191
# body to foot
9292
set_maximal_configurations!(pbody, cbody,
9393
Δx=[0.0; 0.0; -leg_length],
94-
Δq=Quaternion(RotX(0.0)))
94+
Δq=RotX(0.0))
9595
set_maximal_velocities!(pbody, cbody,
9696
parent_vertex=tra2.vertices[1],
9797
child_vertex=tra2.vertices[2],

environments/snake/methods/initialize.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ end
7070

7171
function initialize_snake!(mechanism::Mechanism{T};
7272
base_position=[0.0, -0.5, 0.0],
73-
base_orientation=Quaternion(RotX(0.6 * π)),
73+
base_orientation=RotX(0.6 * π),
7474
base_linear_velocity=zeros(3),
7575
base_angular_velocity=zeros(3),
7676
relative_linear_velocity=zeros(3),

0 commit comments

Comments
 (0)