Verified Commit 0c1fd0fc authored by Justin Carpentier's avatar Justin Carpentier
Browse files

test: add Python test for joints

parent 34e63e97
......@@ -7,6 +7,7 @@ SET(${PROJECT_NAME}_PYTHON_TESTS
# Multibody
bindings_joint_composite
bindings_joints
bindings_model
bindings_data
bindings_geometry_model
......
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()
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment