ogmapTest2.py
Go to the documentation of this file.
1 import rtm
2 import commands
3 
5 mgr.load("VirtualCamera")
6 mgr.load("Range2PointCloud")
7 mgr.load("OccupancyGridMap3D")
8 mgr.load("OGMap3DViewer")
9 
10 vc = mgr.create("VirtualCamera")
11 r2pc = mgr.create("Range2PointCloud")
12 ogmap = mgr.create("OccupancyGridMap3D")
13 viewer = mgr.create("OGMap3DViewer")
14 
15 openhrp_dir = commands.getoutput("pkg-config --variable=prefix openhrp3.1")
16 project = "file://"+openhrp_dir+"/share/OpenHRP-3.1/sample/project/SampleRobot_inHouse.xml"
17 vc.setProperty("project", project)
18 vc.setProperty("camera", "Robot:VISION_SENSOR1")
19 vc.setProperty("generateRange", "1")
20 vc.setProperty("rangerMaxAngle", "0.4")
21 vc.setProperty("rangerMinAngle", "-0.4")
22 
23 ogmap.setProperty("resolution", "0.05")
24 
25 viewer.setProperty("xSize", "5")
26 viewer.setProperty("ySize", "5")
27 viewer.setProperty("zSize", "2.5")
28 viewer.setProperty("xOrigin", "0")
29 viewer.setProperty("yOrigin", "-2.5")
30 viewer.setProperty("zOrigin", "-0.5")
31 
32 rtm.connectPorts(vc.port("range"), r2pc.port("range"))
33 rtm.connectPorts(r2pc.port("cloud"), ogmap.port("cloud"))
34 rtm.connectPorts(vc.port("poseSensor"), ogmap.port("pose"))
35 rtm.connectPorts(ogmap.port("OGMap3DService"), viewer.port("OGMap3DService"))
36 
37 vc.start()
38 r2pc.start()
39 ogmap.start()
40 viewer.start()
41 
42 
def findRTCmanager(hostname=None, rnc=None)
get RTCmanager
Definition: jython/rtm.py:321
def connectPorts(outP, inPs, subscription="flush", dataflow="Push", bufferlength=1, rate=1000)
connect ports
Definition: jython/rtm.py:433


hrpsys
Author(s): AIST, Fumio Kanehiro
autogenerated on Thu May 6 2021 02:41:50