If you succeed the 5 steps of the First start of Poppy, you are free now to play with the poppytools and its primitives !
Install the poppytools
As the poppy-software is under development and is updated daily, the best way is to clone the git repository and install it in develop mode:
cd where-you-want
git clone https://github.com/poppy-project/poppy-software.git
cd poppy-software
python setup.py develop
Now the poppytools are added to your python path and you can easily use them just by using the package import poppytools.
Arms copy primitive:
This primitive allows a direct copy of the left arm motion on the right arm.
import pypot.robot
from poppytools.configuration.config import poppy_config
from poppytools.primitive.interaction import ArmsCopyMotion
poppy = pypot.robot.from_config(poppy_config)
poppy.start_sync()
for m in poppy.arms:
m.compliant = False
poppy.attach_primitive(ArmsCopyMotion(poppy, 50), 'copy')
poppy.copy.start()
poppy.copy.wait_to_stop()
Walking primitive:
This example will make the arms compliant and the legs will produce a walking gait.
import os
import time
import pypot.robot
import poppytools
from poppytools.configuration.config import poppy_config
from poppytools.primitive.walking import WalkingGaitFromMat
cpg_filename = os.path.join(os.path.dirname(poppytools.__file__), 'behavior', 'IROS_Normal_Gait.mat')
poppy = pypot.robot.from_config(poppy_config)
poppy.start_sync()
for m in poppy.motors:
m.goto_position(0,2)
m.compliant = False
for m in poppy.arms:
m.compliant = True
time.sleep(2)
poppy.attach_primitive(WalkingGaitFromMat(poppy, cpg_filename, compliant_motion=True), 'walk')
poppy.walk.start()
Is there a general way to execute the other programs?
For example the StandPosition or the SitPosition?
Does the StandPosition works with the IMU and is it possible for poppy to stand alone?