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 import numpy as np
4 from gepetto.corbaserver import Client
5 
6 Red = [1, 0, 0, 0.5]
7 Green = [0, 1, 0, 0.5]
8 Blue = [0, 0, 1, 0.5]
9 
10 c = Client()
11 wid = len(c.gui.getWindowList()) - 1
12 
13 sceneName = "scene/triangles"
14 if sceneName in c.gui.getNodeList():
15  c.gui.deleteNode(sceneName, True)
16 
17 wid = c.gui.createWindow("triangles")
18 
19 c.gui.createScene(sceneName)
20 c.gui.addSceneToWindow(sceneName, wid)
21 
22 P1 = (-0.6475786872429674, -0.519875255189778, 0.5955961037406681)
23 P2 = (0.069105957031249998, -0.150722900390625, -0.42999999999999999)
24 P3 = (0.063996093749999997, -0.15320971679687501, -0.42999999999999999)
25 Q1 = (-25.655000000000001, -1.2858199462890625, 3.7249809570312502)
26 Q2 = (-10.926, -1.284259033203125, 3.7281499023437501)
27 Q3 = (-10.926, -1.2866180419921875, 3.72335400390625)
28 tf1 = (
29  -12.824601270753471,
30  -1.6840516940066426,
31  3.8914453043793844,
32  -0.26862477561450587,
33  -0.46249645019513175,
34  0.73064726592483387,
35  -0.42437287410898855,
36 )
37 tf2 = (0, 0, 0, 0, 0, 0, 1)
38 
39 c.gui.addTriangleFace("triangle1", P1, P2, P3, Red)
40 c.gui.addTriangleFace("triangle2", Q1, Q2, Q3, Green)
41 c.gui.addToGroup("triangle1", sceneName)
42 c.gui.addToGroup("triangle2", sceneName)
43 
44 c.gui.applyConfiguration("triangle1", tf1)
45 c.gui.applyConfiguration("triangle2", tf2)
46 c.gui.refresh()


hpp-fcl
Author(s):
autogenerated on Fri Jun 2 2023 02:39:01