Differences
This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
| poppy_software [2015/12/02 14:45] – mai | poppy_software [2026/10/22 20:39] (current) – external edit 127.0.0.1 | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| ====== Poppy Software ====== | ====== Poppy Software ====== | ||
| - | {{tag> | + | {{tag> |
| Poppy uses pypot for control. It is a python library : http:// | Poppy uses pypot for control. It is a python library : http:// | ||
| Line 18: | Line 18: | ||
| A good guide can be found here: https:// | A good guide can be found here: https:// | ||
| - | < | + | ==== In detail, this is how I installed the software |
| * install pip https:// | * install pip https:// | ||
| * install the python pypot library : < | * install the python pypot library : < | ||
| Line 31: | Line 31: | ||
| </ | </ | ||
| - | </ | + | |
| If you have trouble detecting your motors, you can follow the step 2 of https:// | If you have trouble detecting your motors, you can follow the step 2 of https:// | ||
| Line 40: | Line 41: | ||
| print dxl_io_lower.scan(range(60)) | print dxl_io_lower.scan(range(60)) | ||
| </ | </ | ||
| + | |||
| + | ===== Embedded odroid ===== | ||
| + | |||
| + | The poppy humanoid has an embedded [[odroid xu 4]], where these libraries have been installed (pypot and poppy-humanoid). | ||
| + | You can log to the computer by ssh using the network labo-sid: odroid@poppy1 (mdp: odroid) | ||
| + | |||
| + | The new Poppy from february 2017 has a Rasberry Pi 3 instead of odroid xu 4. As the ethernet port is not available, the connexion to the Rasberry Pi is done using Wifi. If your wifi network is not known by the robot, you need to plug a keyboard to the Rasberry Pi and use the touchscreen to configure the new connexion. | ||
| + | Once the computer and the robot are in the same network, you can log to the robot using ssh: poppy@poppy.local (mdp: poppy). | ||
| + | Note that if you want to manage the wifi networks configurations of the robot in ssh, you need to modify the file: / | ||
| + | |||
| + | ===== First program ===== | ||
| + | |||
| + | * Simple motor command : <code python> | ||
| + | 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, | ||
| + | time.sleep(5) | ||
| + | print " | ||
| + | poppy.head_z.goto_position(40, | ||
| + | print "after moving" | ||
| + | </ | ||
| + | |||
| + | * Make it reset to its standing position : <code python> | ||
| + | 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, | ||
| + | |||
| + | time.sleep(5) | ||
| + | </ | ||
| + | * to record and replay a movement | ||
| + | ==== code ==== | ||
| + | <code Python> | ||
| + | #importer des fonctions | ||
| + | import time | ||
| + | import math | ||
| + | import json | ||
| + | import pypot.robot | ||
| + | from pypot.primitive.move import MoveRecorder, | ||
| + | |||
| + | #se connecter au robot | ||
| + | ergo = pypot.robot.from_json(' | ||
| + | |||
| + | #on met le robot debout: tous les moteurs a 0 | ||
| + | for m in ergo.motors: | ||
| + | m.compliant=False | ||
| + | m.goal_position=0.0 | ||
| + | |||
| + | #imprimer tous les noms des moteurs | ||
| + | for x in range(0, | ||
| + | print "motor ", | ||
| + | |||
| + | #indiquer quels moteurs on relache | ||
| + | indices=[10, | ||
| + | for m in [ergo.motors[x] for x in indices]: | ||
| + | | ||
| + | |||
| + | |||
| + | #commencer l' | ||
| + | move_recorder = MoveRecorder(ergo, | ||
| + | move_recorder.start() | ||
| + | print " | ||
| + | |||
| + | #duree de l' | ||
| + | time.sleep(6) | ||
| + | |||
| + | #arreter l' | ||
| + | print " | ||
| + | move_recorder.stop() | ||
| + | |||
| + | for m in range(0, | ||
| + | ergo.motors[m].compliant=False | ||
| + | |||
| + | |||
| + | # | ||
| + | with open(' | ||
| + | | ||
| + | |||
| + | |||
| + | #rejouer le mouvement sauvegarde sans le fichier | ||
| + | with open(' | ||
| + | m = Move.load(f) | ||
| + | |||
| + | ergo.compliant = False | ||
| + | |||
| + | move_player = MovePlayer(ergo, | ||
| + | move_player.start() | ||
| + | </ | ||
| + | |||
| + | Other examples can be tested from https:// | ||
| + | |||
| + | |||
| + | ===== Control the robot ===== | ||
| + | |||
| + | You have several ways to control the Poppy robot, using pre-built Pypot methods/ | ||
| + | * Setting the // | ||
| + | * Setting the // | ||
| + | * Using the // | ||
| + | * Using the higher level // | ||
| + | |||
| + | If the // | ||