-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d72135e
commit f59645f
Showing
5 changed files
with
80 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
name: Run benchmarks | ||
|
||
on: | ||
pull_request: | ||
|
||
jobs: | ||
Benchmark: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: julia-actions/setup-julia@latest | ||
with: | ||
version: 1 | ||
# - uses: julia-actions/julia-buildpkg@latest | ||
- name: Install dependencies | ||
run: julia -e 'using Pkg; pkg"add PkgBenchmark BenchmarkCI@0.1"' | ||
- name: Run benchmarks | ||
run: julia -e 'using BenchmarkCI; BenchmarkCI.judge(retune=true)' # retune sometimes necessary to avoid counting compile-time | ||
- name: Print judgement | ||
run: julia -e 'using BenchmarkCI; BenchmarkCI.displayjudgement()' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
[deps] | ||
BenchmarkTools = "6e4b80f9-dd63-53aa-95a3-0cdb28fa8baf" | ||
PkgBenchmark = "32113eaa-f34f-5b0d-bd6c-c81e245fc73d" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
using BenchmarkTools | ||
|
||
SUITE = BenchmarkGroup() | ||
|
||
include("example_benchmark.jl") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
############################### | ||
### Example benchmark for Atlas | ||
############################### | ||
mech = get_mechanism(:atlas, | ||
timestep=0.1, | ||
gravity=-9.81, | ||
friction_coefficient=0.5, | ||
damper=25.0, | ||
spring=1.0, | ||
contact_feet=true, | ||
contact_body=true, | ||
model_type=:simple) | ||
|
||
Dojo.initialize!(mech, :atlas_stance, | ||
body_position=[0.0, 0.0, 1.0], | ||
body_orientation=[0.0, 0.2, 0.1]) | ||
|
||
SUITE["atlas"] = @benchmarkable simulate!($mech, 2.5, opts=SolverOptions(rtol=1.0e-6, btol=1.0e-6)) samples=2 | ||
|
||
|
||
############################### | ||
### Example benchmark for Pendulum | ||
############################### | ||
mechanism = get_mechanism(:pendulum, | ||
timestep=0.01, | ||
gravity=-9.81, | ||
damper=5.0, | ||
spring=0.0) | ||
|
||
function controller!(mechanism, t) | ||
## Target state | ||
x_goal = [1.0 * π; 0.0] | ||
|
||
## Current state | ||
x = get_minimal_state(mechanism) | ||
|
||
## Gains | ||
K = [5.0 0.5] * 0.1 | ||
|
||
# Control inputs | ||
u = -K * (x - x_goal) | ||
set_input!(mechanism, u) | ||
end | ||
|
||
initialize!(mechanism, :pendulum, | ||
angle=0.0 * π, | ||
angular_velocity=0.0); | ||
|
||
SUITE["pendulum"] = @benchmarkable simulate!($mechanism, 2.0, $controller!) samples=2 |