Poppy v1 : Install and first program tutorial to the open source printable humanoid robot

Poppy humanoid robot is a humanoid robot that can be used with its hardware platform or with the V-rep simulator. It can be programmed with python, using the pypot library, or it can also have a web interface with snap.

The humanoid Poppy robot is part of a family of robots called Poppy, that work under the same principle and installations, but differ by the configuration of the composing motors.

Motor configuration (names) of Poppy humanoid

In November 2020, they have released a version 3 of Poppy.

Below is information related to version 1 release since 2013–2014. This tutorial walk you step by step how to set up your hardware, software, but also how to try your first programs with Poppy robot or with the simulator.

Set up the Hardware

Additional wrists

Set up the Software

Poppy uses pypot for control. It is a python library : http://poppy-project.github.io/pypot/ On the top of pypot are libraries for Poppy creatures : https://github.com/poppy-project.

The quick install consists in:

  • install pypot :
sudo pip install pypot
  • install your popppy creature. For instance for poppy humanoid :
sudo pip install poppy_humanoid
  • to check that the libraries are installed correctly, execute with python the code:
from poppy_humanoid import PoppyHumanoid 
poppy = PoppyHumanoid()

A good guide can be found here: https://github.com/HumaRobotics/poppy-examples/blob/master/doc/softwareGuide/softwareGuide.pdf. More technical details about pypot, you can look at installation of pypot.

In detail, this is how I installed the software:

sudo easy_install pypot

or

sudo pip install pypot
  • install the poppy_humanoid library: download Poppy model
git clone https://github.com/poppy-project/poppy-humanoid.git
  • then go to the where-you-downloaded-poppy-humanoid/software folder and install with the terminal command
python setup.py install
  • To check if everything is installed correctly, you can run the following code from folder where-you-downloaded-poppy-humanoid/software. If it runs without raising an error, everything is probably installed correctly:
import time 
import math
import json
import pypot.robot
poppy = pypot.robot.from_json(‘poppy_torso/configuration/poppy_torso.json’)

If you have trouble detecting your motors, you can follow the step 2 of https://forum.poppy-project.org/t/first-start-of-poppy and run in python (replace in below PORT_UPPER_BODY and PORT_LOWER_BODY with the name of the ports such as /dev/ttyACM0 )

import pypot.dynamixel
dxl_io_upper = pypot.dynamixel.DxlIO('PORT_UPPER_BODY')
dxl_io_lower = pypot.dynamixel.DxlIO('PORT_LOWER_BODY')
print dxl_io_upper.scan(range(60))
print dxl_io_lower.scan(range(60))

Another example of code is :

import pypot.dynamixel 
print pypot.dynamixel.get_available_ports()
#prints on the raspberry [‘/dev/ttyACM2’, ‘/dev/ttyACM1’, ‘/dev/ttyACM0’] ;
#prints on the macbook [‘/dev/tty.usbmodem142201’, ‘/dev/tty.usbmodem142301’, ‘/dev/tty.usbmodem142101’]
dxl_io = pypot.dynamixel.DxlIO(‘/dev/tty.usbmodem142301’)
print dxl_io.scan()

Control the robot

You have several ways to control the Poppy robot, using pre-built Pypot methods/class:

  • Setting the goal_position attribute: the joint will immediately try to go as close to the goal as possible (given the angle limits) w.r.t the maximum speed allowed on this joint (which is set via the moving_speed attribute). This will not take the present_speed attribute of the joint into account;
  • Setting the goal_speed attribute: the joint will immediately set the speed of the joint to the given value, replacing the current goal_position with the angle limit corresponding to the speed direction;
  • Using the goto_position(goal,time) method: this will actually set the goal_position to the given goal value, and also set the moving_speed of the joint to (goal-present_position)/t;
  • Using the higher level MovePlayer class: this class implements a LoopPrimitive in order to update frequently the goal_position attribute of the joint (N.B: the moving_speed attribute is not modified by the class when playing the motion and the robot will keep in mind the last moving_speed sent).

If the moving_speed attribute is set to 0, then the joint will move at full speed (N.B: If you’re unsure of the moving_speed you sent last to the robot and want to play a movement using MovePlayer, it is recommended to initially set the moving_speed of all the involved joints to 0.0).

First Program

  • Simple motor command :
from poppy_humanoid 
import PoppyHumanoid
import time
import pypot.robot
poppy = PoppyHumanoid() # or poppy = pypot.robot.from_config(poppy_config) poppy.head_z.compliant =False
poppy.head_z.max_torque=20
poppy.head_z.goal_position=20
poppy.head_z.goto_position(-20,3)
time.sleep(5)
print “before moving”
poppy.head_z.goto_position(40,3, wait=True)
print “after moving”
  • Make it reset to its standing position :
from poppy_humanoid 
import PoppyHumanoid
import time
import pypot.robot
poppy = PoppyHumanoid() # or poppy = pypot.robot.from_config(poppy_config) for m in poppy.motors:
m.compliant = False
for m in poppy.motors:
m.goto_position(0, 5)
time.sleep(5)
#import libraries
import time
import math
import json
import pypot.robot
from pypot.primitive.move import MoveRecorder, Move, MovePlayer

#connect to the robot
poppy = pypot.robot.from_json('poppy_torso/configuration/poppy_torso_broken.json')

#standing position: all motors to joint position 0
for m in poppy.motors:
m.compliant=False
m.goal_position=0.0

#print the names of all motors
for x in range(0,14):
print "motor ",x," is ", poppy.motors[x].name

#put designed motors in compliant mode
indices=[10,11,12,13]
for m in [poppy.motors[x] for x in indices]:
m.compliant=True


#start recording
move_recorder = MoveRecorder(poppy, 50, poppy.motors)
move_recorder.start()
print "start"

#duration of the recording
time.sleep(6)

#stop recording
print "stop"
move_recorder.stop()

for m in range(0,14):
poppy.motors[m].compliant=False


#save in a file
with open('my_nice_move.txt', 'w') as f:
move_recorder.move.save(f)


#replay a saved movement in a file
with open('my_nice_move.txt') as f:
m = Move.load(f)

poppy.compliant = False

move_player = MovePlayer(poppy, m)
move_player.start()

Other examples can be tested from https://github.com/HumaRobotics/poppy-examples.

Using the Vrep/CoppeliaSim Simulator

A poppy simulator is available with vrep simulator. The installation and the control part. V-rep simulator is now called CoppeliaSim.

In details, this is what I did:

git clone https://github.com/poppy-project/poppy-humanoid.git
  • in software folder, run
sudo python setup.py install
  • To check if everything is installed correctly, you can run the following code. If it runs without raising an error, everything is probably installed correctly:
from pypot.vrep import from_vrep 
from poppy.creatures import PoppyHumanoid
  • To instantiate poppy in vrep

— Open vrep

— Run the following code in python:

from poppy.creatures import PoppyHumanoid 
poppy = PoppyHumanoid(simulator=’vrep’)

— Check the communication is fine with the following code:

poppy.motors #prints the list of all motors of the robot
poppy.l_shoulder_y #prints the properties of l_shoulder_y
poppy.head_y.present_position # print the joint angle of the motor head_y
[m.present_position for m in poppy.motors] #prints the joint positions of all motors

Test the installation :

  • To test that you can control poppy (its head):
poppy.reset_simulation() 
poppy.head_z.goto_position(-45, 2) #control the head_z motor position to -42, move in 2s.
  • Now let’s make the robot’s head move.

— In python run the control code:

import time 
import math
current, goal = [], []
amp=60
freq=0.5
t0 = time.time()

while True:
t = time.time()

# run for 5s
if t — t0 > 50:
break

poppy.head_z.goal_position = amp * math.sin(2 * 3.14 * freq * t)
current.append(poppy.head_z.present_position)
goal.append(poppy.head_z.goal_position)
time.sleep(0.04)

— then plot the goal and actual positions:

import numpy 
from matplotlib
import pyplot
t = numpy.linspace(0, 5, len(current))
pyplot.plot(t, goal)
pyplot.plot(t, current)
pyplot.legend((‘goal’, ‘current’))
pyplot.show()

Quick links

  • A start-up tutorial:

— getting started with Poppy https://forum.poppy-project.org/t/getting-started-with-poppy-project/362

— the official doc : https://github.com/poppy-project/poppy-humanoid/blob/master/doc/en/getting_started.md

— a good step to step tutorial: https://github.com/HumaRobotics/poppy-examples/tree/master/doc

— and tutorials on their forum: https://forum.poppy-project.org/tags/tutorial

— other official website (to see other institutions using Poppy) : https://www.poppystation.org

— Install pypot : http://poppy-project.github.io/pypot/intro.html#installation

— Install software for poppy : https://github.com/poppy-project/poppy-torso

  • Example programs:

— Move and replay movements: http://poppy-project.github.io/pypot/move.html

roboticist writing her geek attempts here

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store