Skip to content

Commit c384906

Browse files
committed
Merge branch 'main' into benchmark_example
2 parents f59645f + e96c658 commit c384906

File tree

35 files changed

+1709
-1937
lines changed

35 files changed

+1709
-1937
lines changed

.github/workflows/CI.yml

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,15 @@ jobs:
99
test:
1010
name: Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }}
1111
runs-on: ${{ matrix.os }}
12-
# if: ${{ contains(github.event.head_commit.message, 'run_ci') }}
1312
strategy:
1413
matrix:
1514
version:
16-
- '1.7'
15+
- '1.6' # LTS
16+
- '1' # Current Stable
1717
os:
1818
- ubuntu-latest
19-
# - macOS-latest
20-
# - windows-latest
19+
- macOS-latest
20+
- windows-latest
2121
arch:
2222
- x64
2323
steps:
@@ -26,6 +26,7 @@ jobs:
2626
with:
2727
version: ${{ matrix.version }}
2828
arch: ${{ matrix.arch }}
29+
# - uses: julia-actions/julia-buildpkg@latest
2930
- uses: julia-actions/julia-runtest@latest
3031
- uses: julia-actions/julia-uploadcodecov@latest
3132
env:

.github/workflows/Documenter.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
- uses: actions/checkout@v2
1515
- uses: julia-actions/setup-julia@latest
1616
with:
17-
version: '1.6'
17+
version: '1'
1818
- name: Install dependencies
1919
run: julia --project=docs/ -e 'using Pkg; Pkg.develop(PackageSpec(path=pwd())); Pkg.instantiate()'
2020
- name: Build and deploy

.github/workflows/dailyCI.yml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,13 @@ jobs:
66
test:
77
name: Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }}
88
runs-on: ${{ matrix.os }}
9+
continue-on-error: ${{ matrix.version == 'nightly'}}
910
strategy:
1011
matrix:
1112
version:
12-
- '1.6'
13+
- '1.6' # LTS
14+
- '1' # Current Stable
15+
- 'nightly' # Upcoming
1316
os:
1417
- ubuntu-latest
1518
- macOS-latest
@@ -22,6 +25,7 @@ jobs:
2225
with:
2326
version: ${{ matrix.version }}
2427
arch: ${{ matrix.arch }}
28+
# - uses: julia-actions/julia-buildpkg@latest
2529
- uses: julia-actions/julia-runtest@latest
2630
- uses: julia-actions/julia-uploadcodecov@latest
2731
env:

Project.toml

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name = "Dojo"
22
uuid = "ac60b53e-8d92-4c83-b960-e78698fa1916"
3-
authors = ["simonlc <simonlc@stanford.edu>", "thowell <thowell@stanford.edu>", "Jan Bruedigam"]
3+
authors = ["simonlc <simonlc@stanford.edu>", "thowell <thowell@stanford.edu>", "Jan Bruedigam <jan.bruedigam@tum.de>"]
44
version = "0.1.0"
55

66
[deps]
@@ -43,3 +43,12 @@ Quaternions = "<0.5.3, 0.5.3"
4343
Scratch = "1.1"
4444
StaticArrays = "1.2"
4545
julia = "1.6, 1.7"
46+
47+
[extras]
48+
BenchmarkTools = "6e4b80f9-dd63-53aa-95a3-0cdb28fa8baf"
49+
FiniteDiff = "6a86dc24-6348-571c-b903-95158fe2bd41"
50+
Rotations = "6038ab10-8711-5258-84ad-4b1120ba62dc"
51+
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
52+
53+
[targets]
54+
test = ["BenchmarkTools", "FiniteDiff", "Rotations", "Test"]

environments/ant/methods/env.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ function ant(;
4141
nx = maximal_dimension(mechanism)
4242
end
4343
nu = 8
44-
no = nx
44+
no = nx + length(mechanism.contacts)
4545

4646
aspace = BoxSpace(nu,
4747
low=(-ones(nu)),

environments/box/methods/env.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,15 @@ function block(;
2222
opts_grad=SolverOptions(rtol=3.0e-4, btol=3.0e-4, undercut=1.5),
2323
T=Float64)
2424

25-
mechanism = get_box(
25+
mechanism = get_block(
2626
timestep=timestep,
2727
gravity=gravity,
2828
friction_coefficient=friction_coefficient,
2929
side=side,
3030
contact=contact,
3131
contact_type=contact_type)
3232

33-
initialize_box!(mechanism)
33+
initialize_block!(mechanism)
3434

3535
if representation == :minimal
3636
nx = minimal_dimension(mechanism)

environments/box/methods/initialize.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
function get_box(;
1+
function get_block(;
22
timestep=0.01,
33
gravity=[0.0; 0.0; -9.81],
44
friction_coefficient=0.8,
@@ -58,7 +58,7 @@ function get_box(;
5858
return mech
5959
end
6060

61-
function initialize_box!(mechanism::Mechanism{T};
61+
function initialize_block!(mechanism::Mechanism{T};
6262
x=[0.0, 0.0, 1.0],
6363
q=Quaternion(1.0, 0.0, 0.0, 0.0),
6464
v=[1.0, 0.3, 0.2],

environments/hopper/methods/env.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ function hopper(;
3939
nx = maximal_dimension(mechanism)
4040
end
4141
nu = 3
42-
no = nx
42+
no = nx - 1 # full_state is not being returned by default
4343

4444
# values taken from Mujoco's model, combining the control range -1, 1 and the motor gears.
4545
aspace = BoxSpace(nu,
@@ -140,7 +140,7 @@ function cost(env::Environment{Hopper}, x, u;
140140
return c
141141
end
142142

143-
function is_done(::Environment{Hopper}, x)
143+
function is_done(env::Environment{Hopper}, x)
144144
nx = minimal_dimension(env.mechanism)
145145
if env.representation == :minimal
146146
x0 = x

environments/rexhopper/methods/env.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ function Base.reset(env::Environment{RexHopper};
9393
else
9494
# initialize above the ground to make sure that with random initialization we do not violate the ground constraint.
9595
initialize!(env.mechanism, :rexhopper)
96-
x0 = get_minimal_state(env.mechanism)
96+
x = get_minimal_state(env.mechanism)
9797
nx = minimal_dimension(env.mechanism)
9898
z = minimal_to_maximal(env.mechanism, x)
9999
set_maximal_state!(env.mechanism, z)

environments/walker/methods/env.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ function walker(;
3939
nx = maximal_dimension(mechanism)
4040
end
4141
nu = 6
42-
no = nx
42+
no = nx-1 # full_state is false by default
4343

4444
# values taken from Mujoco's model, combining the control range -1, 1 and the motor gears.
4545
aspace = BoxSpace(nu,
@@ -136,7 +136,7 @@ function cost(env::Environment{Walker}, x, u;
136136
return c
137137
end
138138

139-
function is_done(::Environment{Walker}, x)
139+
function is_done(env::Environment{Walker}, x)
140140
nx = minimal_dimension(env.mechanism)
141141
if env.representation == :minimal
142142
x0 = x

0 commit comments

Comments
 (0)