2 import sys, traceback, Ice
16 properties.load(
"./default.generated.cfg")
17 properties.load(
"./default.cfg")
19 init_data = Ice.InitializationData()
20 init_data.properties = properties
22 ic = Ice.initialize(init_data)
24 Ice.loadSlice(
'-I%s %s -DMININTERFACE' % (Ice.getSliceDir(),
'KITProstheticHandInterface.ice'))
30 obj = ic.stringToProxy(
"IceStorm/TopicManager")
32 print(
"stringToProxy")
33 base = ic.stringToProxy(
"KITProsthesisControl -t -e 1.1:tcp -h localhost -p 10000 -t 60000")
34 print(
"base = ", base.ice_toString())
36 prosthesis = KITProsthesis.KITProstheticHandInterfacePrx.checkedCast(base)
38 raise RuntimeError(
"Invalid proxy")
44 if prosthesis
is not None:
45 def graspAndStatus(grasp, sleep = 3):
46 prosthesis.sendGrasp(grasp)
47 val = prosthesis.getSensorValues()
48 print(
"state ", val.state)
49 print(
"thumbPWM ", val.thumbPWM)
50 print(
"thumbPos ", val.thumbPos)
51 print(
"fingerPWM ", val.fingerPWM)
52 print(
"fingerPos ", val.fingerPos)