octree.py
Go to the documentation of this file.
1 # Load "env.obj" and "rob.obj" in gepetto-gui
2 
3 import csv
4 import os
5 from gepetto.corbaserver import Client
6 
7 pos = list()
8 with open("/home/florent/devel/hpp/src/hpp-fcl/build-rel/test/rob.octree", "r") as f:
9  r = csv.reader(f, delimiter=",")
10  for line in r:
11  pos.append(map(float, line))
12 
13 path = None
14 devel_hpp_dir = os.getenv("DEVEL_HPP_DIR")
15 if devel_hpp_dir:
16  path = devel_hpp_dir + "/src/hpp-fcl/test/fcl_resources"
17 else:
18  path = os.getenv("PWD") + "/fcl_resources"
19 
20 Red = [1, 0, 0, 0.5]
21 Green = [0, 1, 0, 0.5]
22 Blue = [0, 0, 1, 0.5]
23 
24 c = Client()
25 wid = 0
26 
27 sceneName = "scene"
28 wid = c.gui.createWindow("test-fcl")
29 
30 c.gui.createScene(sceneName)
31 c.gui.addSceneToWindow(sceneName, wid)
32 
33 c.gui.addMesh("env", path + "/env.obj")
34 c.gui.addMesh("rob", path + "/rob.obj")
35 c.gui.addToGroup("env", sceneName)
36 c.gui.addToGroup("rob", sceneName)
37 
38 # closest points
39 c.gui.addSphere("p1", 10, Red)
40 c.gui.addToGroup("p1", sceneName)
41 
42 
43 q1 = (-1373.283643275499, -396.2224237620831, 259.5808934420347) + (
44  0.5956794918568784,
45  -0.2147188057951074,
46  0.257436335996247,
47  0.7299234962157893,
48 )
49 q2 = (0, 0, 0, 0, 0, 0, 1)
50 
51 c.gui.applyConfiguration("rob", q1)
52 c.gui.applyConfiguration("env", q2)
53 
54 p1 = (-1990.2983245164919, -105.42114741459312, 359.74684390031132, 0, 0, 0, 1)
55 
56 c.gui.applyConfiguration("p1", p1)
57 c.gui.refresh()


hpp-fcl
Author(s):
autogenerated on Sat Nov 23 2024 03:44:58