Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Stack Of Tasks
pinocchio
Commits
b2586f42
Verified
Commit
b2586f42
authored
Nov 05, 2020
by
Justin Carpentier
Browse files
example: minor fix
parent
18bb9e35
Pipeline
#11923
passed with stage
in 199 minutes and 35 seconds
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
examples/simulation-inverted-pendulum.py
View file @
b2586f42
...
...
@@ -3,8 +3,9 @@ import hppfcl as fcl
import
numpy
as
np
import
math
import
time
import
sys
N
=
2
# number of pendulums
N
=
10
# number of pendulums
model
=
pin
.
Model
()
geom_model
=
pin
.
GeometryModel
()
...
...
@@ -20,7 +21,7 @@ geom_model.addGeometryObject(geom0_obj)
for
k
in
range
(
N
):
joint_name
=
"joint_"
+
str
(
k
+
1
)
joint_id
=
model
.
addJoint
(
parent_id
,
pin
.
JointModelR
X
(),
joint_placement
,
joint_name
)
joint_id
=
model
.
addJoint
(
parent_id
,
pin
.
JointModelR
Y
(),
joint_placement
,
joint_name
)
body_inertia
=
pin
.
Inertia
.
FromSphere
(
body_mass
,
body_radius
)
body_placement
=
joint_placement
.
copy
()
...
...
@@ -84,7 +85,7 @@ t = 0.
data_sim
=
model
.
createData
()
for
k
in
range
(
N
):
tau_control
=
np
.
zeros
((
model
.
nv
))
a
=
pin
.
aba
(
model
,
data_sim
,
q
,
v
,
tau_control
)
# Forward dynamics
a
=
pin
.
aba
(
model
,
data_sim
,
q
,
v
,
tau_control
)
# Forward dynamics
v
+=
a
*
dt
#q += v*dt
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment