Skip to content

Commit 0f7101e

Browse files
committed
Merge branch 'main' of https://github.com/DojoSim/Dojo.jl into main
2 parents f7f4147 + 7d8dd00 commit 0f7101e

File tree

52 files changed

+391
-500
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+391
-500
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
[![](https://img.shields.io/badge/docs-dev-blue.svg)](https://dojo-sim.github.io/Dojo.jl/dev)
44

55
# Dojo
6-
A differentiable simulator for robotics.
6+
A differentiable simulator for robotics
77

88
# Examples (RSS 2022)
99

docs/make.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ using Documenter, Dojo
44

55
makedocs(
66
modules = [Dojo],
7-
format = Documenter.HTML(prettyurls = false),
7+
format = Documenter.HTML(prettyurls=false),
88
sitename = "Dojo",
99
pages = [
1010
##############################################

environments/atlas/methods/env.jl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@ function atlas(;
2121
name=:robot,
2222
infeasible_control=false,
2323
opts_step=SolverOptions(rtol=3.0e-4, btol=3.0e-4, undercut=1.5),
24-
opts_grad=SolverOptions(rtol=3.0e-4, btol=3.0e-4, undercut=1.5)) where T
24+
opts_grad=SolverOptions(rtol=3.0e-4, btol=3.0e-4, undercut=1.5),
25+
T=Float64)
2526

2627
mechanism = get_mechanism(:atlas,
2728
timestep=timestep,

environments/atlas/methods/initialize.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ function initialize_atlas!(mechanism::Mechanism;
223223
return nothing
224224
end
225225

226-
function initialize_atlasstance!(mechanism::Mechanism;
226+
function initialize_atlas_stance!(mechanism::Mechanism;
227227
body_position=[0.0, 0.0, 0.2],
228228
body_orientation=[0.0, 0.0, 0.0],
229229
link_linear_velocity=[zeros(3) for i=1:length(mechanism.bodies)],

environments/box/methods/env.jl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@ function block(;
1919
name::Symbol=:robot,
2020
control_scaling=Diagonal(ones(3)),
2121
opts_step=SolverOptions(rtol=3.0e-4, btol=3.0e-4, undercut=1.5),
22-
opts_grad=SolverOptions(rtol=3.0e-4, btol=3.0e-4, undercut=1.5)) where T
22+
opts_grad=SolverOptions(rtol=3.0e-4, btol=3.0e-4, undercut=1.5),
23+
T=Float64)
2324

2425
mechanism = get_box(
2526
timestep=timestep,

environments/box2d/methods/env.jl renamed to environments/box2D/methods/env.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
################################################################################
22
# Box (2D)
33
################################################################################
4-
struct Box2d end
4+
struct Box2D end
55

6-
function box2d(;
6+
function box2D(;
77
representation=:minimal,
88
timestep=0.05,
99
gravity=[0.0; 0.0; -9.81],
@@ -18,12 +18,12 @@ function box2d(;
1818
opts_grad=SolverOptions(rtol=3.0e-4, btol=3.0e-4, undercut=1.5),
1919
T=Float64)
2020

21-
mechanism = get_mechanism(:box2d,
21+
mechanism = get_mechanism(:box2D,
2222
timestep=timestep,
2323
gravity=gravity,
2424
friction_coefficient=friction_coefficient)
2525

26-
initialize!(mechanism, :box2d)
26+
initialize!(mechanism, :box2D)
2727

2828
if representation == :minimal
2929
nx = minimal_dimension(mechanism)

environments/box2d/methods/initialize.jl renamed to environments/box2D/methods/initialize.jl

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
function get_box2d(;
1+
function get_box2D(;
22
timestep=0.01,
33
gravity=[0.0; 0.0; -9.81],
44
friction_coefficient=0.8,
55
radius=0.0,
66
side=0.5,
77
contact=true,
88
contact_type=:nonlinear,
9-
mode=:box2d,
9+
mode=:box2D,
1010
T=Float64)
1111

1212
# Parameters
@@ -23,15 +23,15 @@ function get_box2d(;
2323
# Corner vectors
2424
if mode == :particle
2525
corners = [[0.0, 0.0, 0.0]]
26-
elseif mode == :box2d
26+
elseif mode == :box2D
2727
corners = [
2828
[[0.0, side / 2.0, side / 2.0]]
2929
[[0.0, side / 2.0, -side / 2.0]]
3030
[[0.0, -side / 2.0, side / 2.0]]
3131
[[0.0, -side / 2.0, -side / 2.0]]
3232
]
3333
else
34-
@error "incorrect mode specified, try :particle or :box2d"
34+
@error "incorrect mode specified, try :particle or :box2D"
3535
end
3636
n = length(corners)
3737
normal = [[0.0, 0.0, 1.0] for i = 1:n]
@@ -55,7 +55,7 @@ function get_box2d(;
5555
return mech
5656
end
5757

58-
function initialize_box2d!(mechanism::Mechanism{T};
58+
function initialize_box2D!(mechanism::Mechanism{T};
5959
position=[0.0, 1.0],
6060
linear_velocity=[0.0, 0.0],
6161
orientation=0.0,

environments/cartpole/methods/env.jl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@ function cartpole(;
1616
name=:robot,
1717
control_scaling=Diagonal(ones(1)),
1818
opts_step=SolverOptions(),
19-
opts_grad=SolverOptions()) where T
19+
opts_grad=SolverOptions(),
20+
T=Float64)
2021

2122
mechanism = get_cartpole(
2223
timestep=timestep,

environments/cartpole/methods/initialize.jl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@ function get_cartpole(;
22
timestep=0.1,
33
gravity=[0.0; 0.0; -9.81],
44
spring=0.0,
5-
damper=0.0) where T
5+
damper=0.0,
6+
T=Float64)
67

78
# Parameters
89
slider_axis = [0.0; 1.0; 0.0]

environments/dzhanibekov/methods/initialize.jl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
function get_dzhanibekov(;
22
timestep=0.01,
33
gravity=-9.81,
4-
color=RGBA(0.9,0.9,0.9,1)) where T
4+
color=RGBA(0.9,0.9,0.9,1),
5+
T=Float64)
56

67
radius = 0.1
78
body_length = 1.0

0 commit comments

Comments
 (0)