api.py
Go to the documentation of this file.
1 import unittest
2 from test_case import TestCase
3 import hppfcl
4 
5 import numpy as np
6 
7 
9  def test_collision(self):
10  capsule = hppfcl.Capsule(1.0, 2.0)
11  M1 = hppfcl.Transform3f()
12  M2 = hppfcl.Transform3f(np.eye(3), np.array([3, 0, 0]))
13 
14  req = hppfcl.CollisionRequest()
15  res = hppfcl.CollisionResult()
16 
17  self.assertTrue(not hppfcl.collide(capsule, M1, capsule, M2, req, res))
18 
19  def test_distance(self):
20  capsule = hppfcl.Capsule(1.0, 2.0)
21  M1 = hppfcl.Transform3f()
22  M2 = hppfcl.Transform3f(np.eye(3), np.array([3, 0, 0]))
23 
24  req = hppfcl.DistanceRequest()
25  res = hppfcl.DistanceResult()
26 
27  self.assertTrue(hppfcl.distance(capsule, M1, capsule, M2, req, res) > 0)
28 
29 
30 if __name__ == "__main__":
31  unittest.main()
test_case.TestCase
Definition: test_case.py:5
api.TestMainAPI
Definition: api.py:8
api.TestMainAPI.test_distance
def test_distance(self)
Definition: api.py:19
api.TestMainAPI.test_collision
def test_collision(self)
Definition: api.py:9


hpp-fcl
Author(s):
autogenerated on Fri Aug 2 2024 02:45:12