Skip to content

Commit 5e0a54e

Browse files
committed
Add PrecompileTools.jl
1 parent f1eef10 commit 5e0a54e

File tree

4 files changed

+18
-2
lines changed

4 files changed

+18
-2
lines changed

Project.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ MeshCatMechanisms = "6ad125db-dd91-5488-b820-c1df6aab299d"
1414
NPZ = "15e1cf62-19b3-5cfa-8e77-841668bca605"
1515
Pkg = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f"
1616
Plots = "91a5bcdd-55d7-5caf-9e0b-520d859cae80"
17+
PrecompileTools = "aea7be01-6a6a-4083-8856-8a6e6704d82a"
1718
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
1819
Requires = "ae029012-a4dd-5104-9daa-d747884805df"
1920
RigidBodyDynamics = "366cf18f-59d5-5db9-a4de-86a9f6786172"
@@ -30,6 +31,7 @@ MeshCat = "0.14, 0.15, 0.16"
3031
MeshCatMechanisms = "0.8, 0.9"
3132
NPZ = "0.4"
3233
Plots = "1"
34+
PrecompileTools = "1"
3335
Requires = "1"
3436
RigidBodyDynamics = "2"
3537
SparseDiffTools = "2"

notebooks/Example.ipynb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -238,15 +238,15 @@
238238
],
239239
"metadata": {
240240
"kernelspec": {
241-
"display_name": "Julia 1.9.1",
241+
"display_name": "Julia 1.9.2",
242242
"language": "julia",
243243
"name": "julia-1.9"
244244
},
245245
"language_info": {
246246
"file_extension": ".jl",
247247
"mimetype": "application/julia",
248248
"name": "julia",
249-
"version": "1.9.1"
249+
"version": "1.9.2"
250250
}
251251
},
252252
"nbformat": 4,

src/TORA.jl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,9 @@ include("./constraints/end_effector.jl")
6161
include("./transcription/ipopt.jl")
6262
include("./plots.jl")
6363

64+
# Code to "exercise" the package - see https://julialang.github.io/PrecompileTools.jl/stable/
65+
include("./precompile.jl")
66+
6467
export solve_with_knitro
6568

6669
end # module

src/precompile.jl

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
import PrecompileTools
2+
3+
PrecompileTools.@compile_workload begin
4+
vis = Visualizer()
5+
robot = create_robot_franka("panda_arm", vis)
6+
problem = Problem(robot, 201, 1/100)
7+
fix_joint_velocities!(problem, robot, 1, zeros(robot.n_v))
8+
cpu_time, x, solver_log = solve_with_ipopt(problem, robot)
9+
play_trajectory(vis, problem, robot, x)
10+
plot_results(problem, robot, x)
11+
end

0 commit comments

Comments
 (0)