-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathopenraveYarpPluginLoader-analogsensors.py
38 lines (27 loc) · 1.2 KB
/
openraveYarpPluginLoader-analogsensors.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#!/usr/bin/env python
import openravepy
from openravepy import *
try:
RaveInitialize()
if not RaveLoadPlugin('OpenraveYarpPluginLoader'):
raveLogError("Plugin not correctly loaded")
env=Environment()
env.SetViewer('qtcoin')
# Force "ode" physics
physics = RaveCreatePhysicsEngine(env,'ode')
env.SetPhysicsEngine(physics)
# "teo" requires [teo-openrave-models](https://github.com/roboticslab-uc3m/teo-openrave-models)
example = "default" # "default" or "teo"
if example == "teo":
env.Load('/usr/local/share/teo-openrave-models/openrave/teo/teo.robot.xml')
else:
env.Load('../../share/openrave/physicsRobot.env.xml')
OpenraveYarpPluginLoader = RaveCreateModule(env,'OpenraveYarpPluginLoader')
if example == "teo":
print OpenraveYarpPluginLoader.SendCommand('open --device multipleanalogsensorsserver --subdevice YarpOpenraveAnalogSensors --robotIndex 0 --ftSensorIndices 1 2 --period 50')
else:
print OpenraveYarpPluginLoader.SendCommand('open --device multipleanalogsensorsserver --subdevice YarpOpenraveAnalogSensors --robotIndex 0 --ftSensorIndices 0 --period 50')
while 1:
pass
finally:
RaveDestroy()