Skip to content
GitLab
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
0c1fd0fc
Verified
Commit
0c1fd0fc
authored
Apr 27, 2021
by
Justin Carpentier
Browse files
test: add Python test for joints
parent
34e63e97
Changes
2
Hide whitespace changes
Inline
Side-by-side
unittest/python/CMakeLists.txt
View file @
0c1fd0fc
...
...
@@ -7,6 +7,7 @@ SET(${PROJECT_NAME}_PYTHON_TESTS
# Multibody
bindings_joint_composite
bindings_joints
bindings_model
bindings_data
bindings_geometry_model
...
...
unittest/python/bindings_joints.py
0 → 100644
View file @
0c1fd0fc
import
unittest
import
pinocchio
as
pin
import
numpy
as
np
joint_types
=
[
pin
.
JointModelRX
,
pin
.
JointModelRY
,
pin
.
JointModelRZ
,
pin
.
JointModelPX
,
pin
.
JointModelPY
,
pin
.
JointModelPZ
,
pin
.
JointModelFreeFlyer
,
pin
.
JointModelSpherical
,
pin
.
JointModelSphericalZYX
,
pin
.
JointModelPlanar
,
pin
.
JointModelTranslation
]
class
TestJoints
(
unittest
.
TestCase
):
def
test_comparison_operators
(
self
):
for
joint_type
in
joint_types
:
j
=
joint_type
()
joint_model
=
pin
.
JointModel
(
j
)
self
.
assertTrue
(
j
==
joint_type
())
self
.
assertTrue
(
j
==
joint_model
)
j
.
setIndexes
(
0
,
0
,
0
)
self
.
assertFalse
(
j
==
joint_model
)
self
.
assertTrue
(
j
!=
joint_model
)
if
__name__
==
'__main__'
:
unittest
.
main
()
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment