iCub-main
|
This tutorial shows how to use Python to interface with the iCub. In particular we focus on controlling the motors using the motor control interfaces. We assume that you have already compiled or installed the Python bingings. This tutorial assume basic knowledge of how YARP works in C++. We just show how the robot C++ interface can be used in Python.
Dislaimer: this code does not do anything fancy with the robot. We let you have fun with the robot and Python once you know how the interface works.
For this tutorial we only need the yarp python bindings.
First initialize yarp.
We know initialize a remote_controlboard object connected to the right_arm.
Now we can query the motor interfaces.
We are now ready to retrive the number of joints, create vectors to store the position commands and move the arm.
Now wait some time and go back to home position:
Code can be found at python/python-motor-control.py
This file can be edited at doc/python-motor-control.dox