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


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