forked from adubredu/contact_sim.jl
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwalker_sim.jl
31 lines (23 loc) · 847 Bytes
/
walker_sim.jl
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
using contact_sim
function main()
q1 = 0.2; u1 = -0.25;
q2 = -0.4; u2 = 0.2;
z0 = [q1 u1 q2 u2]
steps = 4
fps = 20
#passive: no controller
#=
walker = Walker(1.0, 0.5, 0.02, 1.0, 0.5, 1.0, 0.01, false, 1.0, 100.0, 0.28564, z0[3], z0[4], 0.0)
z_init = [0.162597833780035 -0.231869638058927 -0.325195667560070 0.03797846807373]
zpert = z_init
=#
#active: use controller
walker = Walker(1.0, 0.5, 0.02, 1.0, 0.5, 1.0, 0.01, true, 1.0, 100.0, 0.28564, z0[3], z0[4], 0.0)
#fixed point initial value.
z_init = [ 0.142819999999995 -0.326813112785275 -0.285640000000000 0.068243824367047]
#adding slight perturbation
zpert = z_init + [0. 0.05 -0.1 0.2]
z, t = simulate_walking(zpert,walker,steps)
render_walking_trajectory(t,z,walker, steps, fps,true)
end
main()