2 *
@ingroup icub_tutorials
4 * \defgroup icub_python_motor_interfaces Using motor interfaces
with Python
6 * Shows how to control the robot using motor interfaces within Python.
8 * \author Lorenzo Natale
10 * CopyPolicy: Released under the terms of GPL 2.0
or later
17props = yarp.Property()
18props.put(
"device",
"remote_controlboard")
19props.put(
"local",
"/client/right_arm")
20props.put(
"remote",
"/icubSim/right_arm")
23armDriver = yarp.PolyDriver(props)
26iPos = armDriver.viewIPositionControl()
27iVel = armDriver.viewIVelocityControl()
28iEnc = armDriver.viewIEncoders()
33print 'Controlling', jnts,
'joints'
37iEnc.getEncoders(encs.data())
40home=yarp.Vector(jnts, encs.data())
46tmp.set(0, tmp.get(0)+10)
47tmp.set(1, tmp.get(1)+10)
48tmp.set(2, tmp.get(2)+10)
49tmp.set(3, tmp.get(3)+10)
51iPos.positionMove(tmp.data())
54iPos.positionMove(encs.data())