-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #116 from JuliaRobotics/tk/fix-113
Work around #113.
- Loading branch information
Showing
1 changed file
with
63 additions
and
49 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 |
---|---|---|
|
@@ -16,9 +16,20 @@ | |
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": null, | ||
"execution_count": 1, | ||
"metadata": {}, | ||
"outputs": [], | ||
"outputs": [ | ||
{ | ||
"name": "stdout", | ||
"output_type": "stream", | ||
"text": [ | ||
"\u001b[32m\u001b[1mActivating\u001b[22m\u001b[39m environment at `~/.julia/dev/RigidBodySim/notebooks/Quick start guide/Project.toml`\n", | ||
"\u001b[32m\u001b[1m Updating\u001b[22m\u001b[39m registry at `~/.julia/registries/General`\n", | ||
"\u001b[32m\u001b[1m Updating\u001b[22m\u001b[39m git-repo `ssh://[email protected]/JuliaRegistries/General.git`\n", | ||
"\u001b[?25l\u001b[2K\u001b[?25h\u001b[32m\u001b[1mPrecompiling\u001b[22m\u001b[39m project...\n" | ||
] | ||
} | ||
], | ||
"source": [ | ||
"using Pkg\n", | ||
"Pkg.activate(@__DIR__);\n", | ||
|
@@ -28,7 +39,7 @@ | |
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 1, | ||
"execution_count": 2, | ||
"metadata": {}, | ||
"outputs": [ | ||
{ | ||
|
@@ -58,10 +69,10 @@ | |
{ | ||
"data": { | ||
"text/html": [ | ||
"<script class='js-collapse-script' src='/assetserver/d00ee8fccd1d3e94c11866a3589118e637f8d9e1-assets/webio/dist/bundle.js'></script>" | ||
"<script class='js-collapse-script' src='/assetserver/292f6e6efeb6819ddb313f5cc13018054e00772b-assets/webio/dist/bundle.js'></script>" | ||
], | ||
"text/plain": [ | ||
"HTML{String}(\"<script class='js-collapse-script' src='/assetserver/d00ee8fccd1d3e94c11866a3589118e637f8d9e1-assets/webio/dist/bundle.js'></script>\")" | ||
"HTML{String}(\"<script class='js-collapse-script' src='/assetserver/292f6e6efeb6819ddb313f5cc13018054e00772b-assets/webio/dist/bundle.js'></script>\")" | ||
] | ||
}, | ||
"metadata": {}, | ||
|
@@ -70,10 +81,10 @@ | |
{ | ||
"data": { | ||
"text/html": [ | ||
"<script class='js-collapse-script' src='/assetserver/d00ee8fccd1d3e94c11866a3589118e637f8d9e1-assets/providers/ijulia_setup.js'></script>" | ||
"<script class='js-collapse-script' src='/assetserver/292f6e6efeb6819ddb313f5cc13018054e00772b-assets/providers/ijulia_setup.js'></script>" | ||
], | ||
"text/plain": [ | ||
"HTML{String}(\"<script class='js-collapse-script' src='/assetserver/d00ee8fccd1d3e94c11866a3589118e637f8d9e1-assets/providers/ijulia_setup.js'></script>\")" | ||
"HTML{String}(\"<script class='js-collapse-script' src='/assetserver/292f6e6efeb6819ddb313f5cc13018054e00772b-assets/providers/ijulia_setup.js'></script>\")" | ||
] | ||
}, | ||
"metadata": {}, | ||
|
@@ -127,7 +138,7 @@ | |
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 2, | ||
"execution_count": 3, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
|
@@ -145,7 +156,7 @@ | |
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 3, | ||
"execution_count": 4, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
|
@@ -177,7 +188,7 @@ | |
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 4, | ||
"execution_count": 5, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
|
@@ -195,7 +206,7 @@ | |
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 5, | ||
"execution_count": 6, | ||
"metadata": {}, | ||
"outputs": [ | ||
{ | ||
|
@@ -206,7 +217,7 @@ | |
"u0: [0.3, 0.4, 1.0, 2.0]" | ||
] | ||
}, | ||
"execution_count": 5, | ||
"execution_count": 6, | ||
"metadata": {}, | ||
"output_type": "execute_result" | ||
} | ||
|
@@ -246,7 +257,7 @@ | |
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 6, | ||
"execution_count": 7, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
|
@@ -263,14 +274,24 @@ | |
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 7, | ||
"execution_count": 8, | ||
"metadata": {}, | ||
"outputs": [], | ||
"outputs": [ | ||
{ | ||
"name": "stderr", | ||
"output_type": "stream", | ||
"text": [ | ||
"┌ Warning: `Ext(type, data)` is deprecated, use `MsgPack.Extension(type, data)` instead.\n", | ||
"│ caller = pack(::Base.GenericIOBuffer{Array{UInt8,1}}, ::MeshCat.PackedVector{Float32}) at msgpack.jl:7\n", | ||
"└ @ MeshCat /Users/tkoolen/.julia/packages/MeshCat/J3ExE/src/msgpack.jl:7\n" | ||
] | ||
} | ||
], | ||
"source": [ | ||
"gui = GUI(mechanism, visuals)\n", | ||
"if !haskey(ENV, \"CI\") # don't try to open a GUI on a headless CI build\n", | ||
" open(gui)\n", | ||
"end" | ||
"end;" | ||
] | ||
}, | ||
{ | ||
|
@@ -282,7 +303,7 @@ | |
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 8, | ||
"execution_count": 9, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
|
@@ -299,15 +320,15 @@ | |
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 9, | ||
"execution_count": 10, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"using Blink: Window\n", | ||
"if !haskey(ENV, \"CI\") # don't try to open a GUI on a headless CI build\n", | ||
" open(gui.controls, Window())\n", | ||
" open(gui.visualizer, Window());\n", | ||
"end" | ||
" open(gui.visualizer, Window())\n", | ||
"end;" | ||
] | ||
}, | ||
{ | ||
|
@@ -328,7 +349,7 @@ | |
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 10, | ||
"execution_count": 11, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
|
@@ -346,7 +367,7 @@ | |
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 11, | ||
"execution_count": 12, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
|
@@ -369,7 +390,7 @@ | |
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 12, | ||
"execution_count": 13, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
|
@@ -397,7 +418,7 @@ | |
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 13, | ||
"execution_count": 14, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
|
@@ -449,30 +470,19 @@ | |
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 14, | ||
"execution_count": 15, | ||
"metadata": {}, | ||
"outputs": [ | ||
{ | ||
"data": { | ||
"text/plain": [ | ||
"control! (generic function with 1 method)" | ||
] | ||
}, | ||
"execution_count": 14, | ||
"metadata": {}, | ||
"output_type": "execute_result" | ||
} | ||
], | ||
"outputs": [], | ||
"source": [ | ||
"function control!(τ, t, state)\n", | ||
" view(τ, velocity_range(state, shoulder)) .= 5 * sin(t)\n", | ||
" view(τ, velocity_range(state, elbow)) .= -configuration(state, shoulder)\n", | ||
"end" | ||
"end;" | ||
] | ||
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 15, | ||
"execution_count": 16, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
|
@@ -499,7 +509,7 @@ | |
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 16, | ||
"execution_count": 17, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
|
@@ -517,7 +527,7 @@ | |
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 17, | ||
"execution_count": 18, | ||
"metadata": {}, | ||
"outputs": [ | ||
{ | ||
|
@@ -528,14 +538,14 @@ | |
"u0: [0.0, 0.0, 0.0, 0.0]" | ||
] | ||
}, | ||
"execution_count": 17, | ||
"execution_count": 18, | ||
"metadata": {}, | ||
"output_type": "execute_result" | ||
} | ||
], | ||
"source": [ | ||
"zero!(state)\n", | ||
"problem = ODEProblem(Dynamics(mechanism, controller), state, (0., 5.))" | ||
"problem = ODEProblem(Dynamics(mechanism, controller), state, (0., 5.), callback=gui_callback)" | ||
] | ||
}, | ||
{ | ||
|
@@ -547,11 +557,11 @@ | |
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 18, | ||
"execution_count": 19, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"sol = solve(problem, Tsit5(), abs_tol = 1e-10, dt = 0.05, callback = gui_callback);" | ||
"sol = solve(problem, Tsit5(), abs_tol = 1e-10, dt = 0.05);" | ||
] | ||
}, | ||
{ | ||
|
@@ -563,7 +573,7 @@ | |
}, | ||
{ | ||
"cell_type": "code", | ||
"execution_count": 19, | ||
"execution_count": 20, | ||
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
|
@@ -579,16 +589,20 @@ | |
} | ||
], | ||
"metadata": { | ||
"@webio": { | ||
"lastCommId": null, | ||
"lastKernelId": null | ||
}, | ||
"kernelspec": { | ||
"display_name": "Julia 1.0.2", | ||
"display_name": "Julia 1.2.0", | ||
"language": "julia", | ||
"name": "julia-1.0" | ||
"name": "julia-1.2" | ||
}, | ||
"language_info": { | ||
"file_extension": ".jl", | ||
"mimetype": "application/julia", | ||
"name": "julia", | ||
"version": "1.0.2" | ||
"version": "1.2.0" | ||
} | ||
}, | ||
"nbformat": 4, | ||
|