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
17 props = yarp.Property()
18 props.put(
"device",
"remote_controlboard")
19 props.put(
"local",
"/client/right_arm")
20 props.put(
"remote",
"/icubSim/right_arm")
23 armDriver = yarp.PolyDriver(props)
26 iPos = armDriver.viewIPositionControl()
27 iVel = armDriver.viewIVelocityControl()
28 iEnc = armDriver.viewIEncoders()
33 print 'Controlling', jnts,
'joints'
36 encs=yarp.Vector(jnts)
37 iEnc.getEncoders(encs.data())
40 home=yarp.Vector(jnts, encs.data())
46 tmp.set(0, tmp.get(0)+10)
47 tmp.set(1, tmp.get(1)+10)
48 tmp.set(2, tmp.get(2)+10)
49 tmp.set(3, tmp.get(3)+10)
51 iPos.positionMove(tmp.data())
54 iPos.positionMove(encs.data())