Skip to content

Commit 01a9897

Browse files
committed
Merge branch 'main' of https://github.com/DojoSim/Dojo.jl into main
2 parents faffc7c + 506cd74 commit 01a9897

File tree

166 files changed

+828
-20214
lines changed

Some content is hidden

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

166 files changed

+828
-20214
lines changed

Project.toml

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,44 +8,38 @@ BenchmarkTools = "6e4b80f9-dd63-53aa-95a3-0cdb28fa8baf"
88
Colors = "5ae59095-9a9b-59fe-a467-6f913c188581"
99
DocStringExtensions = "ffbed154-4ef7-542d-bbb7-c09d3a79fcae"
1010
FFMPEG = "c87230d0-a227-11e9-1b43-d7ebe4e7570a"
11-
FiniteDiff = "6a86dc24-6348-571c-b903-95158fe2bd41"
1211
GeometryBasics = "5c1252a2-5f33-56bf-86c9-59e7332b4326"
13-
IterativeLQR = "605048dd-e178-462b-beb9-98a09398ef27"
1412
JLD2 = "033835bb-8acc-5ee8-8aae-3f567f8a3819"
1513
LaTeXStrings = "b964fa9f-0449-5b57-a5c2-d3ea65f4040f"
1614
LightGraphs = "093fc24a-ae57-5d10-9952-331d41423f4d"
1715
LightXML = "9c8b4983-aa76-5018-a973-4c85ecc9e179"
18-
LineSearches = "d3d80556-e9d4-5f37-9878-2ab0fcc64255"
1916
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
2017
MeshCat = "283c5d60-a78f-5afe-a0af-af636b173e11"
2118
Meshing = "e6723b4c-ebff-59f1-b4b7-d97aa5274f73"
22-
Optim = "429524aa-4258-5aef-a3af-852621145aeb"
23-
PGFPlots = "3b7a836e-365b-5785-a47d-02c71176b4aa"
24-
PGFPlotsX = "8314cec4-20b6-5062-9cdb-752b83310925"
2519
Parameters = "d96e819e-fc66-5662-9728-84c9c7592b0a"
2620
Pkg = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f"
27-
Plots = "91a5bcdd-55d7-5caf-9e0b-520d859cae80"
2821
Polyhedra = "67491407-f73d-577b-9b50-8179a7c68029"
29-
PyPlot = "d330b81b-6aea-500a-939a-2ce795aea3ee"
3022
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
3123
Rotations = "6038ab10-8711-5258-84ad-4b1120ba62dc"
3224
Scratch = "6c6a2e73-6563-6170-7368-637461726353"
3325
SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf"
3426
StaticArrays = "90137ffa-7385-5640-81b9-e52037218182"
3527
Statistics = "10745b16-79ce-11e8-11f9-7d13ad32a3b2"
36-
Symbolics = "0c5d862f-8b57-4792-8d23-62f2024744c7"
3728
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
3829

3930
[compat]
4031
Colors = "<0.12.6, 0.12.6"
4132
DocStringExtensions = "<0.8.3, 0.8.3"
42-
FiniteDiff = "2.7.2"
33+
FFMPEG = "0.4.1"
4334
GeometryBasics = "0.3"
44-
IterativeLQR = "0.1.1"
35+
JLD2 = "0.4.21"
36+
LaTeXStrings = "1.3.0"
37+
LightGraphs = "1.3.5"
4538
LightXML = "<0.9.0, 0.9.0"
4639
MeshCat = "0.13.0 - 0.13.0"
4740
Meshing = "0.5.7"
4841
Parameters = "0.12"
42+
Polyhedra = "0.6.18"
4943
Rotations = "1.0.2 - 1.0.2"
5044
Scratch = "1.1"
5145
StaticArrays = "0.12, 1.0"

docs/src/assets/logo.png

-17.8 KB
Loading

docs/src/index.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ The following people are involved in the development of Dojo:
2727
__Primary Development__
2828
* [Simon Le Cleac'h](https://simon-lc.github.io/) (main developement, contact modeling, interior-point solver, gradients)
2929
* [Taylor Howell](https://thowell.github.io/) (main developement, contact modeling, interior-point solver, gradients)
30-
* [Jan Bruedigam](https://github.com/janbruedigam) (main developemnt, maximal representation and graph-based solver)
30+
* [Jan Bruedigam](https://github.com/janbruedigam) (main development, maximal representation and graph-based solver)
3131

3232

3333
* [Zico Kolter](https://zicokolter.com/)

environments/atlas/methods/template.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ end
187187
################################################################################
188188
# Compute trajectory
189189
################################################################################
190-
# vis=visualizer()
190+
# vis= Visualizer()
191191
# open(vis)
192192

193193
# mech = get_mechanism(:atlas, timestep=0.05, model_type=:armless, damper=1000.0)

environments/rexhopper/methods/demo.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11

2-
vis=visualizer()
2+
vis= Visualizer()
33
open(vis)
44
include("env.jl")
55
include("initialize.jl")

examples/Project.toml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
[deps]
22
IterativeLQR = "605048dd-e178-462b-beb9-98a09398ef27"
33
Literate = "98b081ad-f1c9-55d3-8b20-4c87d4299306"
4+
PGFPlots = "3b7a836e-365b-5785-a47d-02c71176b4aa"
5+
Plots = "91a5bcdd-55d7-5caf-9e0b-520d859cae80"
46

57
[compat]
8+
IterativeLQR = "0.1.1"
69
Literate = "2.13.0"
10+
Plots = "1.25.11"
11+
PGFPlots = "3.4.1"
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
using PGFPlots
2+
const PGF = PGFPlots
3+
4+
color = ["magenta", "orange", "cyan"];
5+
p_energy = [PGF.Plots.Linear([j * timestep[i] for j = 1:length(e)], e .- e[1], legendentry="h=$(timestep[i])", mark="none",style="color="*color[i]*", line width=2pt, solid") for (i, e) in enumerate(me)]
6+
7+
a1 = Axis(vcat(p_energy...),
8+
xmin=0,
9+
xmax=10.0,
10+
hideAxis=false,
11+
ylabel="energy drift",
12+
xlabel="time (s)",
13+
legendPos="south east")
14+
dir = joinpath("/home/taylor/Downloads")
15+
PGF.save(joinpath(dir, "energy_drift.tikz"), a1)
16+
17+
##########
18+
# Visualization
19+
color = RGBA(255.0/255.0,0.0,255.0,1.0);
20+
z = get_maximal_state(storage)
21+
z = [[z[1] for t = 1:100]..., z..., [z[end] for t = 1:100]...]
22+
build_robot(mech, vis=vis, color=color)
23+
T = length(z)
24+
anim = MeshCat.Animation(convert(Int, floor(1.0 / timestep0)))
25+
for t = 1:T
26+
MeshCat.atframe(anim, t) do
27+
set_robot(vis, mech, z[t])
28+
end
29+
end
30+
MeshCat.setanimation!(vis, anim)
31+
setvisible!(vis["/Axes"], false)
32+
setvisible!(vis["/Grid"], false)
33+
34+
# Ghost
35+
t = 400 # 225, 150, 1
36+
set_robot(vis, mech, z[t])
37+
##########
Lines changed: 122 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,122 @@
1+
# PGFPlot
2+
using PGFPlotsX
3+
using LaTeXStrings
4+
5+
mj_plin_plot = @pgf PlotInc({thick, "color=orange", "mark options={orange}"}, Table(speed_mj, plin_mj))
6+
dj_plin_plot = @pgf PlotInc({thick, "color=cyan", "mark options={cyan}"}, Table(speed_dj, plin_dj))
7+
mj_pang_plot = @pgf PlotInc({thick, "color=orange", "mark options={orange}"}, Table(speed_mj, pang_mj))
8+
dj_pang_plot = @pgf PlotInc({thick, "color=cyan", "mark options={cyan}"}, Table(speed_dj, pang_dj))
9+
mj_legend = LegendEntry(raw"MuJoCo")
10+
dj_legend = LegendEntry(raw"Dojo")
11+
12+
axs1 = @pgf LogLogAxis({
13+
ymin=1e-15,
14+
ymax=1e1,
15+
title="linear momentum",
16+
xlabel=raw"$\times$ faster than real time",
17+
ylabel="N.s",
18+
},
19+
dj_plin_plot, dj_legend, mj_plin_plot, mj_legend,
20+
)
21+
22+
axs2 = @pgf LogLogAxis({
23+
ymin=1e-15,
24+
ymax=1e1,
25+
title="angular momentum",
26+
xshift=-20.0,
27+
# ticks="none",
28+
yticklabels={},
29+
xlabel=raw"$\times$ faster than real time",
30+
# ylabel="(N.s)",
31+
},
32+
dj_pang_plot, dj_legend, mj_pang_plot, mj_legend,
33+
)
34+
35+
gp = @pgf PGFPlotsX.GroupPlot(
36+
{group_style = {group_size="2 by 1"},
37+
legend_style = {nodes="{scale=0.70, transform shape}", anchor="east", at="{(0.95,0.35)}"},
38+
y_label_style={at="{(axis description cs:-0.00,.5)}", anchor="north"},
39+
# height = "6cm",
40+
# width = "6cm",
41+
# no_markers,
42+
# xlabel=raw"$\times$ faster than real time",
43+
# legend_pos="north west",
44+
},
45+
axs1, axs2)
46+
47+
filename = joinpath(@__DIR__, "figures/astronaut_momentum.tikz")
48+
pgfsave(filename, gp; include_preamble = true, dpi = 150)
49+
50+
51+
# PGFPlot
52+
using PGFPlotsX
53+
using LaTeXStrings
54+
55+
mj_ener_plot1 = @pgf PlotInc({very_thick, "color=orange", "mark options={orange}"},
56+
Table(range(0,stop=100,length=length(ener_traj_mj[1])),
57+
ener_traj_mj[1]))
58+
mj_ener_plot2 = @pgf PlotInc({very_thick, "color=orange", "mark options={orange}"},
59+
Table(range(0,stop=100,length=length(ener_traj_mj[2])),
60+
ener_traj_mj[2]))
61+
mj_ener_plot3 = @pgf PlotInc({very_thick, "color=orange", "mark options={orange}"},
62+
Table(range(0,stop=100,length=length(ener_traj_mj[3])),
63+
ener_traj_mj[3]))
64+
65+
dj_ener_plot1 = @pgf PlotInc({very_thick, "color=cyan", "mark options={orange}"},
66+
Table(range(0,stop=100,length=length(ener_traj_dj[1])),
67+
ener_traj_dj[1]))
68+
dj_ener_plot2 = @pgf PlotInc({very_thick, "color=cyan", "mark options={orange}"},
69+
Table(range(0,stop=100,length=length(ener_traj_dj[2])),
70+
ener_traj_dj[2]))
71+
dj_ener_plot3 = @pgf PlotInc({very_thick, "color=cyan", "mark options={orange}"},
72+
Table(range(0,stop=100,length=length(ener_traj_dj[3])),
73+
ener_traj_dj[3]))
74+
75+
mj_legend = LegendEntry(raw"MuJoCo")
76+
dj_legend = LegendEntry(raw"Dojo")
77+
78+
79+
axs1 = @pgf Axis({
80+
title=raw"simulation rate $10$ Hz",
81+
ylabel="energy J",
82+
xticklabels={},
83+
},
84+
dj_ener_plot1, dj_legend, mj_ener_plot1, mj_legend,
85+
)
86+
87+
axs2 = @pgf Axis({
88+
title=raw"simulation rate $100$ Hz",
89+
ylabel="energy J",
90+
yshift=13.0,
91+
xticklabels={},
92+
},
93+
dj_ener_plot2, dj_legend, mj_ener_plot2, mj_legend,
94+
)
95+
96+
axs3 = @pgf Axis({
97+
title=raw"simulation rate $1000$ Hz",
98+
xlabel="time s",
99+
ylabel="energy J",
100+
yshift=13.0,
101+
},
102+
dj_ener_plot3, dj_legend, mj_ener_plot3, mj_legend,
103+
)
104+
105+
gp = @pgf PGFPlotsX.GroupPlot(
106+
{group_style = {group_size="1 by 3"},
107+
legend_style = {nodes="{scale=0.70, transform shape}"},
108+
title_style={at="{(axis description cs:+0.5,0.95)}", anchor="south"},
109+
y_label_style={at="{(axis description cs:+0.05,0.5)}", anchor="north"},
110+
x_label_style={at="{(axis description cs:+0.5,0.15)}", anchor="north"},
111+
xmin=0,
112+
xmax=100,
113+
height = "3.5cm",
114+
width = "7.5cm",
115+
no_markers,
116+
# xlabel=raw"$\times$ faster than real time",
117+
legend_pos="north west",
118+
},
119+
axs1, axs2, axs3)
120+
121+
filename = joinpath(@__DIR__, "figures/astronaut_energy.tikz")
122+
pgfsave(filename, gp; include_preamble = true, dpi = 150)

examples/dev/2dofs_rotation.jl

Lines changed: 0 additions & 50 deletions
This file was deleted.

0 commit comments

Comments
 (0)