MCPcopy Create free account
hub / github.com/Simple-Robotics/aligator / test_contact_map

Function test_contact_map

tests/python/test_centroidal.py:30–49  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

28
29
30def test_contact_map():
31 contact_names = ["c1", "c2", "c3"]
32 contact_states = [True, False, True]
33 contact_poses = [
34 np.array([0.2, 0.1, 0.0]),
35 np.array([0.2, 0.0, 0.0]),
36 np.array([0.0, 0.1, 0.0]),
37 ]
38 contact_map = aligator.ContactMap(contact_names, contact_states, contact_poses)
39 contact_map.addContact("c4", False, np.array([0.0, 0.0, 0.0]))
40
41 assert contact_map.size == 4
42
43 contact_map.removeContact(3)
44
45 assert contact_map.size == 3
46
47 contact_map.setContactPose("c2", np.array([1, 2, 3]))
48 boolvec = contact_map.contact_poses[1] == np.array([1, 2, 3])
49 assert boolvec.all()
50
51
52def test_com_translation():

Callers

nothing calls this directly

Calls 3

addContactMethod · 0.80
removeContactMethod · 0.80
setContactPoseMethod · 0.80

Tested by

no test coverage detected