test/scripts/gjk.py
Go to the documentation of this file.
1 # This script displays two triangles and two spheres in gepetto-gui
2 # It is useful to debug distance computation between two triangles.
3 from gepetto.corbaserver import Client
4 
5 Red = [1, 0, 0, 0.5]
6 Green = [0, 1, 0, 0.5]
7 Blue = [0, 0, 1, 0.5]
8 
9 c = Client()
10 wid = len(c.gui.getWindowList()) - 1
11 
12 sceneName = "scene/triangles"
13 if sceneName in c.gui.getNodeList():
14  c.gui.deleteNode(sceneName, True)
15 
16 wid = c.gui.createWindow("triangles")
17 
18 c.gui.createScene(sceneName)
19 c.gui.addSceneToWindow(sceneName, wid)
20 
21 P1 = (-0.6475786872429674, -0.519875255189778, 0.5955961037406681)
22 P2 = (0.069105957031249998, -0.150722900390625, -0.42999999999999999)
23 P3 = (0.063996093749999997, -0.15320971679687501, -0.42999999999999999)
24 Q1 = (-25.655000000000001, -1.2858199462890625, 3.7249809570312502)
25 Q2 = (-10.926, -1.284259033203125, 3.7281499023437501)
26 Q3 = (-10.926, -1.2866180419921875, 3.72335400390625)
27 tf1 = (
28  -12.824601270753471,
29  -1.6840516940066426,
30  3.8914453043793844,
31  -0.26862477561450587,
32  -0.46249645019513175,
33  0.73064726592483387,
34  -0.42437287410898855,
35 )
36 tf2 = (0, 0, 0, 0, 0, 0, 1)
37 
38 c.gui.addTriangleFace("triangle1", P1, P2, P3, Red)
39 c.gui.addTriangleFace("triangle2", Q1, Q2, Q3, Green)
40 c.gui.addToGroup("triangle1", sceneName)
41 c.gui.addToGroup("triangle2", sceneName)
42 
43 c.gui.applyConfiguration("triangle1", tf1)
44 c.gui.applyConfiguration("triangle2", tf2)
45 c.gui.refresh()


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