()
| 28 | |
| 29 | |
| 30 | def 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 | |
| 52 | def test_com_translation(): |
nothing calls this directly
no test coverage detected