Skip to content
rob2b edited this page May 20, 2017 · 9 revisions

Robot Poppy link

Robot poppy-torso written in python, offering a rest api & primitives to be used by the controller (cloud server)

  1. Requirements
  2. Installation
  3. Usage
  4. vrep
  5. Notation
  6. Primitives
  7. API

Requirements

  1. Ubuntu > 14.04
  2. Python version 2.7
  3. Root access
IMPORTANT : use tabulation for a better code presentation :bowtie:

Installation

  • pip install poppy-torso --user -U
  • pip install pypot

On windows -> not fully tested

  • Before installing poppy-torso, install all basic anaconda package on an admin command prompt (also execut pip install on admin) with :
  • conda install numpy scipy notebook jupyter matplotlib

Any other depedencies (working on a cleaner way)

  • cd poppy/
$ python
>>> import cherry
  • Then install needed depedencies for cherry to import

Usage

-i is a wizard option that allow you to start the code in interactive mode => usefull for debug

CTRL+Z is the best way to kill the python process

You need both an internet connection and the robot to be plugged in your computer

Teach him !

$ sudo python -i stetup.py
>>> Cherry.exit()
>>> Cherry.learn()

Restart the robot and then Tadaaa ! Poppy learn a new move !

Local, robot only

$ sudo python -i stetup.py
>>> Cherry.exit()
>>> robot.<move_primitive>.start()
>>> robot.<say_primitive>.start(text="some text")

Local, robot and controller

Basic

$ sudo python -i startup.py
>>> Cherry.exit()

Medium

$ sudo python -i startup.py
>>> robot.<move_primitive>.start()
>>> robot.<say_primitive>.start(text="some text")
>>> Cherry.exit()

Expert

$ sudo python 
>>> from cherry import *
>>> robot=Cherry.setup()
>>> Cherry.serve()
>>> Cherry.connect()
>>> robot.<move_primitive>.start()
>>> robot.<say_primitive>.start(text="some text")
>>> Cherry.exit()

SSH mode activated

Follow this tuto !

Local

$ ./startuplocal.sh

ssh

$ ./startupssh.sh

Vrep

NEED DOC


NOTATION MOUVEMENTS ROBOTS

Usage

On definit le nom de chaque primitives explicitemanet afin qu'elles puissent etre integrer facilement a l'application:

Communication

Le serveur fait une requete sur l'api du robot /primitive/list.json puis le serveur les met a disposition sur l'URL /app/prmitives ???

Primitives

behave_

Liste des comportements simple

dance_

liste des primitives disponibles pour la chorégraphie de l'app

dance_celebration_

liste des celebrations disponibles

dance_basic_

liste des mouvements de dance de base

dance_complex_

liste des mouvements de dance plus complexes

position_

Liste des positions simple que le robot peut atteindre

say_

liste des primitives de parole du robot.

motion_

liste des primitives de mouvement perpetuel


Primitives

Behaves

├── behave_applause2
├── behave_applause
├── behave_biceps
├── behave_brice_nice
├── behave_clean
├── behave_dabhard
├── behave_dableft
├── behave_dabright
├── behave_dabsimple
├── behave_eat
├── behave_grisou
├── behave_handsdown
├── behave_hands_up
├── behave_handsup
├── behave_harden
├── behave_hello
├── behave_kiss
├── behave_love
├── behave_macarena2
├── behave_macarena
├── behave_nope
├── behave_open
├── behave_plane
├── behave_presentationl
├── behave_presentationr
├── behave_punch
├── behave_question
├── behave_round
├── behave_showlr
├── behave_shy
├── behave_sleep
├── behave_usain_left
├── behave_wave

Dance

├── dance_crazy
├── dance_handsup
├── dance_lr
├── dance_open
├── dance_point
├── dance_showlr
├── dance_snoop
├── dance_speedlr

Say

├── say_fr
├── say_en
├── say_es
├── say_de

motion

├── motion_head_idle
├── motion_upper_body_idle
├── motion_torso_idle


API

Official source

HTTP JSON Example of answer
Get the primitives list GET /primitive/list.json {"robot": {"get_primitives_list": ""}} {'primitives': ["stand_up", "sit", "head_tracking"]}
Get the running primitives list GET /primitive/running/list.json {"robot": {"get_running_primitives_list": ""}} {'primitives': ["head_tracking"]}
Start a primitive GET /primitive/<prim>/start.json {"robot": {"start_primitive": {"primitive": ""}}} {}
Stop a primitive GET /primitive/<prim>/stop.json {"robot": {"stop_primitive": {"primitive": ""}}} {}
Pause a primitive GET /primitive/<prim>/pause.json {"robot": {"pause_primitive": {"primitive": ""}}} {}
Resume a primitive GET /primitive/<prim>/resume.json {"robot": {"resume_primitive": {"primitive": ""}}} {}
Get the primitive properties list GET /primitive/<prim>/property/list.json {"robot": {"get_primitive_properties_list": {"primitive": ""}}} {"property": ["filter", "smooth"]}
Get a primitive property value GET /primitive/<prim>/property/ {"robot": {"get_primitive_property": {"primitive": "", "property": ""}}} {"sin.amp": 30.0}
Set a primitive property value POST /primitive/<prim>/property//value.json {"robot": {"set_primitive_property": {"primitive": "", "property": "", "args": {"arg1": "val1", "arg2": "val2", "...": "..."}}}} {}
Get the primitive methods list GET /primitive/<prim>/method/list.json {"robot": {"get_primitive_methods_list": {"primitive": ""}}} {"methods": ["get_tracked_faces", "start", "stop", "pause", "resume"]}
Call a method of a primitive POST /primitive/<prim>/method/<meth>/args.json {"robot": {"call_primitive_method": {"primitive": "", "method": "", "args": {"arg1": "val1", "arg2": "val2", "...": "..."}}}}