Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
P
pinocchio
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Stack Of Tasks
pinocchio
Commits
289b5df0
Commit
289b5df0
authored
6 years ago
by
Gabriele Buondonno
Browse files
Options
Downloads
Patches
Plain Diff
[bindings] [unittest] better dynamics tests
parent
dba2fb69
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
unittest/python/bindings_dynamics.py
+19
-12
19 additions, 12 deletions
unittest/python/bindings_dynamics.py
with
19 additions
and
12 deletions
unittest/python/bindings_dynamics.py
+
19
−
12
View file @
289b5df0
...
...
@@ -22,21 +22,28 @@ class TestDynamicsBindings(TestCase):
self
.
v
=
rand
(
self
.
model
.
nv
)
self
.
tau
=
rand
(
self
.
model
.
nv
)
self
.
v0
=
zero
(
self
.
model
.
nv
)
self
.
tau0
=
zero
(
self
.
model
.
nv
)
self
.
tolerance
=
1e-9
# we compute J on a different self.data
self
.
J
=
se3
.
jointJacobian
(
self
.
model
,
self
.
model
.
createData
(),
self
.
q
,
self
.
model
.
getJointId
(
'
lleg6_joint
'
),
se3
.
ReferenceFrame
.
LOCAL
,
True
)
self
.
gamma
=
zero
(
6
)
def
test_forwardDynamics7
(
self
):
ddq
=
se3
.
forwardDynamics
(
self
.
model
,
self
.
data
,
self
.
q
,
self
.
v
,
self
.
tau
,
self
.
J
,
self
.
gamma
)
self
.
assertFalse
(
np
.
isnan
(
ddq
).
any
())
self
.
model
.
gravity
=
se3
.
Motion
.
Zero
()
ddq
=
se3
.
forwardDynamics
(
self
.
model
,
self
.
data
,
self
.
q
,
self
.
v0
,
self
.
tau0
,
self
.
J
,
self
.
gamma
)
self
.
assertLess
(
np
.
linalg
.
norm
(
ddq
),
self
.
tolerance
)
def
test_forwardDynamics8
(
self
):
ddq
=
se3
.
forwardDynamics
(
self
.
model
,
self
.
data
,
self
.
q
,
self
.
v
,
self
.
tau
,
self
.
J
,
self
.
gamma
,
r_coeff
)
self
.
assertFalse
(
np
.
isnan
(
ddq
).
any
())
self
.
model
.
gravity
=
se3
.
Motion
.
Zero
()
ddq
=
se3
.
forwardDynamics
(
self
.
model
,
self
.
data
,
self
.
q
,
self
.
v0
,
self
.
tau0
,
self
.
J
,
self
.
gamma
,
r_coeff
)
self
.
assertLess
(
np
.
linalg
.
norm
(
ddq
),
self
.
tolerance
)
def
test_forwardDynamics9
(
self
):
ddq
=
se3
.
forwardDynamics
(
self
.
model
,
self
.
data
,
self
.
q
,
self
.
v
,
self
.
tau
,
self
.
J
,
self
.
gamma
,
r_coeff
,
update_kinematics
)
self
.
assertFalse
(
np
.
isnan
(
ddq
).
any
())
self
.
model
.
gravity
=
se3
.
Motion
.
Zero
()
ddq
=
se3
.
forwardDynamics
(
self
.
model
,
self
.
data
,
self
.
q
,
self
.
v0
,
self
.
tau0
,
self
.
J
,
self
.
gamma
,
r_coeff
,
update_kinematics
)
self
.
assertLess
(
np
.
linalg
.
norm
(
ddq
),
self
.
tolerance
)
def
test_forwardDynamics789
(
self
):
data7
=
self
.
data
...
...
@@ -50,16 +57,16 @@ class TestDynamicsBindings(TestCase):
self
.
assertTrue
((
ddq8
==
ddq9
).
all
())
def
test_impulseDynamics5
(
self
):
ddq
=
se3
.
impulseDynamics
(
self
.
model
,
self
.
data
,
self
.
q
,
self
.
v
,
self
.
J
)
self
.
assert
False
(
np
.
isnan
(
ddq
).
any
()
)
vnext
=
se3
.
impulseDynamics
(
self
.
model
,
self
.
data
,
self
.
q
,
self
.
v
0
,
self
.
J
)
self
.
assert
Less
(
np
.
linalg
.
norm
(
vnext
),
self
.
tolerance
)
def
test_impulseDynamics6
(
self
):
ddq
=
se3
.
impulseDynamics
(
self
.
model
,
self
.
data
,
self
.
q
,
self
.
v
,
self
.
J
,
inv_damping
)
self
.
assert
False
(
np
.
isnan
(
ddq
).
any
()
)
vnext
=
se3
.
impulseDynamics
(
self
.
model
,
self
.
data
,
self
.
q
,
self
.
v
0
,
self
.
J
,
inv_damping
)
self
.
assert
Less
(
np
.
linalg
.
norm
(
vnext
),
self
.
tolerance
)
def
test_impulseDynamics7
(
self
):
ddq
=
se3
.
impulseDynamics
(
self
.
model
,
self
.
data
,
self
.
q
,
self
.
v
,
self
.
J
,
inv_damping
,
update_kinematics
)
self
.
assert
False
(
np
.
isnan
(
ddq
).
any
()
)
vnext
=
se3
.
impulseDynamics
(
self
.
model
,
self
.
data
,
self
.
q
,
self
.
v
0
,
self
.
J
,
inv_damping
,
update_kinematics
)
self
.
assert
Less
(
np
.
linalg
.
norm
(
vnext
),
self
.
tolerance
)
def
test_impulseDynamics567
(
self
):
data5
=
self
.
data
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment