SlideShare une entreprise Scribd logo
1  sur  33
Télécharger pour lire hors ligne
BH TEAM

METTEZ UN PYTHON DANS VOTRE
MOTEUR ROBOT !
YANNICK
@yanjost
yannick (at) yjost.com
Pythonista depuis 1.4
BH Team depuis 2009
9 participations à la Coupe de France de Robotique
La Plage Digitale
ERIC
@eric_alber
eric.alber (at) gmail.com
Pythonista depuis 2.4
BH Team depuis 2010
7 participations à la Coupe de France de Robotique
BH TEAM
6 personnes
Strasbourg, Belfort, Lyon
Depuis 2007
Meilleur classement : vice-champions de France (2011)
Ouéééééé
Dernier classement : 19 / 146
www.bhteam.org / @thebhteam
LA COUPE DE FRANCE DE ROBOTIQUE
DE QUOI EST FAIT UN ROBOT ?
COMMENT CODER LA STRATÉGIE POUR
LE ROBOT ?
Multiples entrées-sorties (USB / Ethernet)
Communication asynchrone entre les composants
Tolérance aux erreurs
Pas besoin de hautes performances
Langage de haut niveau
Rapidité de modification
Utiliser des paradigmes modernes
Stacktrace
Bref "batteries included"
BREWERY !
Framework dédié à la robotique
Basé sur asyncore
Existe depuis 2010 (Lua → Python)
Evénementiel
Entrées multiplexées
ARCHITECTURE GÉNÉRALE
GESTION DES MACHINES À ÉTAT
GESTION DES MACHINES À ÉTAT
SHOW ME THE CODE !
casMi(tt)
ls anSae:
dfo_ne(ef:
e netrsl)
yedMvTGas..
il oeols(.)
yedTkGas..
il aels(.)

#Sic t saeMvTGas
wth o tt oeols
#Sic t saeTkGas
wth o tt aels

casMvtGasSae:
ls oeols(tt)
dfo_ne(ef:
e netrsl)
yedMvLn(oiin1 #Sic t saeMvLn,
il oeiepsto_)
wth o tt oeie
#mv t psto 1
oe o oiin
yedMvLn(oiin2 #Sic t saeMvLn,
il oeiepsto_)
wth o tt oeie
#mv t psto 2
oe o oiin
yedNn
il oe
#Ppbc t saeMi
o ak o tt an
casTkGasSae:
ls aels(tt)
dfo_ne(ef:
e netrsl)
yedCoerpe(.)
il lsGipr..
yedNn
il oe

#Sic t saeCoerpe
wth o tt lsGipr
#Ppbc t saeMi
o ak o tt an
STATE MACHINE PARALLÈLE
casDPrle(tt)
ls oaallSae:
dfo_ne(ef:
e netrsl)
l =Saeahn(bra" sd =SD_ET #Satprle FM
b
ttMcie"amn, ie
IELF)
tr aall S
r =Saeahn(bra" sd =SD_IH)#frec sd
b
ttMcie"amn, ie
IERGT
o ah ie
yedMvLn(.,00 #Mv t satpsto
il oeie10 .)
oe o tr oiin
yedNn
il oe

#Ppsae
o tt
LE PROTOCOLE BH TEAM
KISS
Paquet TCP 256 octets
1 octet : type
255 octets : data
Basé sur s r c
tut
Ordres
Ouverture / fermeture actionneurs
Paramétrage
Ordres de déplacement
SÉRIALISATION
API déclarative
Types de données
UInt
Float
Tableaux
Enum
Booléen
EXEMPLE
casTreDtc(aeakt:
ls urteetBsPce)
TP =3
YE
2
DFNTO =(
EIIIN
(dsac' Un8(,"eeto dsac" )
'itne, It 0 Dtcin itne) ,
(age
'nl' ,Un8(,"eeto age))
It 0 Dtcin nl" ,
(rbt
'oo' ,Unm(POETRBT OPNN_OO_AN )
Eu8OPNN_OO, POETRBTMI) ,
)

Introspection des paquets
Visualisation des logs
Génération des paquets pour l'interface web
UTILISATION
Mapping automatique de méthode basé sur le nom du
paquet
TurretDetect : on_turret_detect(packet)
GotoFinished : on_goto_finished(packet)
casMOjc:
ls ybet
dfo_urtdtc(akt:
e ntre_eetpce)
pit"eevdpce,dsac=}.omtpce.itne)
rn(Rcie akt itne{"fra(aktdsac)
m_bet=MOjc(
yojc
ybet)
p=TreDtc(
urteet)
#Ti clsm_beto_urtdtc()
hs al yojc.ntre_eetp
pdsac(yojc)
.ipthm_bet
CALCUL DE TRAJECTOIRE
Utilisation d'une "carte" du terrain
Mise à jour en fonction de l'état des capteurs
Problème de rapidité → réécriture en C
PRISE DE DÉCISION : GOAL MANAGER
Heuristique
Objectifs restants réalisés par le robot et son acolyte
Utilisation du pathfinding :
Distance des objectifs
Position de l'adversaire
Pas d'ordre défini mais pondération des objectifs
UTILISATION D'UNE CAMÉRA
C++, OpenCV
Invocation d'un subprocess
Très fiable
ONE MORE
THING...
SIMULATION
PAQUETS ÉCHANGÉS
TRAJECTOIRE DEMANDÉE & RÉELLE
VITESSE DÉPLACEMENT
VITESSE ROTATION
WHAT'S NEXT ?
Unifier appels inter-module et les évènements
Moteur physique dans le simulateur
Améliorer communication entre les robots
Traitement d'image plus complexe
Faire un package réutilisable
POUR EN SAVOIR PLUS
The source code : http://bitbucket.org/bhteam
Twitter : @thebhteam
Facebook : TheBhTeam
Site : http://www.bhteam.org
MERCI AUX SPONSORS !

{ yucmaylg }
{ oropn.oo }
CONCLUSIONS
OUI : Python et robotique font bon ménage
NON : Python ne peut pas tout faire
Gain de productivité / vitesse de dev
"Pas testé, pas validé !"
Contents de notre choix !
CRÉDIT PHOTO
http://www.mirror.co.uk/news/world-news/pythonfound-in-car-engine-16-ft-1309075
Marc Obergfell
Wat Horse : http://t.qkme.me/3ttns0.jpg
http://www.ludumdare.com/compo/wpcontent/uploads/2013/04/i-have-no-idea-what-imdoing-dog.jpg
http://madan.wordpress.com/2007/01/06/kurukshetrarobotics-at-anna-university/
le reste : (c) BH Team

Contenu connexe

Tendances

Python et la persistance de données — initiation python 1.5
Python et la persistance de données — initiation python 1.5Python et la persistance de données — initiation python 1.5
Python et la persistance de données — initiation python 1.5Abib Faye
 
Annotation Java vs. Decorator Python
Annotation Java vs. Decorator PythonAnnotation Java vs. Decorator Python
Annotation Java vs. Decorator PythonDidier Plaindoux
 
Need it help in Operating System quiz(computer language) and in some course
Need it help in Operating System quiz(computer language) and in some courseNeed it help in Operating System quiz(computer language) and in some course
Need it help in Operating System quiz(computer language) and in some courseDouria Zohbi
 
PHP & MYSQL #5 : fonctions
PHP & MYSQL #5 :  fonctionsPHP & MYSQL #5 :  fonctions
PHP & MYSQL #5 : fonctionsJean Michel
 
PHP #2 : variables, conditions & boucles
PHP #2 : variables, conditions & boucles PHP #2 : variables, conditions & boucles
PHP #2 : variables, conditions & boucles Jean Michel
 

Tendances (6)

Python et la persistance de données — initiation python 1.5
Python et la persistance de données — initiation python 1.5Python et la persistance de données — initiation python 1.5
Python et la persistance de données — initiation python 1.5
 
Annotation Java vs. Decorator Python
Annotation Java vs. Decorator PythonAnnotation Java vs. Decorator Python
Annotation Java vs. Decorator Python
 
µP
µPµP
µP
 
Need it help in Operating System quiz(computer language) and in some course
Need it help in Operating System quiz(computer language) and in some courseNeed it help in Operating System quiz(computer language) and in some course
Need it help in Operating System quiz(computer language) and in some course
 
PHP & MYSQL #5 : fonctions
PHP & MYSQL #5 :  fonctionsPHP & MYSQL #5 :  fonctions
PHP & MYSQL #5 : fonctions
 
PHP #2 : variables, conditions & boucles
PHP #2 : variables, conditions & boucles PHP #2 : variables, conditions & boucles
PHP #2 : variables, conditions & boucles
 

En vedette

Petits Princes
Petits PrincesPetits Princes
Petits Princesjulieghys
 
L'entreprise face aux pénuries des compétences ezzeddine MBAREK
L'entreprise face aux pénuries des compétences  ezzeddine MBAREKL'entreprise face aux pénuries des compétences  ezzeddine MBAREK
L'entreprise face aux pénuries des compétences ezzeddine MBAREKmbarek
 
Bh Team Présentation Ignite Strasbourg
Bh Team Présentation Ignite StrasbourgBh Team Présentation Ignite Strasbourg
Bh Team Présentation Ignite StrasbourgYannick Jost
 

En vedette (7)

Petits Princes
Petits PrincesPetits Princes
Petits Princes
 
Des Mots D’Amitié
Des Mots D’AmitiéDes Mots D’Amitié
Des Mots D’Amitié
 
Cartablenum
CartablenumCartablenum
Cartablenum
 
L'entreprise face aux pénuries des compétences ezzeddine MBAREK
L'entreprise face aux pénuries des compétences  ezzeddine MBAREKL'entreprise face aux pénuries des compétences  ezzeddine MBAREK
L'entreprise face aux pénuries des compétences ezzeddine MBAREK
 
Info relig
Info religInfo relig
Info relig
 
Joyeux NoëL à Tous
Joyeux NoëL à TousJoyeux NoëL à Tous
Joyeux NoëL à Tous
 
Bh Team Présentation Ignite Strasbourg
Bh Team Présentation Ignite StrasbourgBh Team Présentation Ignite Strasbourg
Bh Team Présentation Ignite Strasbourg
 

Similaire à BH Team - Mettez un python dans votre robot !

gRPC, ECHANGES A HAUTE FREQUENCE ! DEVOXX 2018
gRPC, ECHANGES A HAUTE FREQUENCE ! DEVOXX 2018gRPC, ECHANGES A HAUTE FREQUENCE ! DEVOXX 2018
gRPC, ECHANGES A HAUTE FREQUENCE ! DEVOXX 2018Carles Sistare
 
gRPC, échange à haute fréquence !
gRPC, échange à haute fréquence !gRPC, échange à haute fréquence !
gRPC, échange à haute fréquence !David Caramelo
 
Programmation de systèmes embarqués : Bus et périphériques de communication
Programmation de systèmes embarqués : Bus et périphériques de communicationProgrammation de systèmes embarqués : Bus et périphériques de communication
Programmation de systèmes embarqués : Bus et périphériques de communicationECAM Brussels Engineering School
 
Comment développer un serveur métier en python/C++
Comment développer un serveur métier en python/C++Comment développer un serveur métier en python/C++
Comment développer un serveur métier en python/C++cppfrug
 
Formation python
Formation pythonFormation python
Formation pythonj_lipaz
 
gRPC, ECHANGES A HAUTE FREQUENCE !
gRPC, ECHANGES A HAUTE FREQUENCE !gRPC, ECHANGES A HAUTE FREQUENCE !
gRPC, ECHANGES A HAUTE FREQUENCE !Carles Sistare
 
gRPC, échange à haute fréquence!
gRPC, échange à haute fréquence!gRPC, échange à haute fréquence!
gRPC, échange à haute fréquence!David Caramelo
 
Réseaux et protocoles - Cours + exercices
Réseaux et protocoles - Cours + exercices Réseaux et protocoles - Cours + exercices
Réseaux et protocoles - Cours + exercices sarah Benmerzouk
 
Presentation langage go_19022015
Presentation langage go_19022015Presentation langage go_19022015
Presentation langage go_19022015Stéphane Legrand
 
AlterWay SolutionsLinux Outils Industrialisation PHP
AlterWay SolutionsLinux Outils Industrialisation PHPAlterWay SolutionsLinux Outils Industrialisation PHP
AlterWay SolutionsLinux Outils Industrialisation PHPjulien pauli
 
201303 - Java8
201303 - Java8201303 - Java8
201303 - Java8lyonjug
 
Les nouveautés du Framework .NET 4.5
Les nouveautés du Framework .NET 4.5Les nouveautés du Framework .NET 4.5
Les nouveautés du Framework .NET 4.5Microsoft
 
Couche1 couche2 s4_v05
Couche1 couche2 s4_v05Couche1 couche2 s4_v05
Couche1 couche2 s4_v05LeslyOctave
 
Chapitre1: Langage Python
Chapitre1: Langage PythonChapitre1: Langage Python
Chapitre1: Langage PythonAziz Darouichi
 

Similaire à BH Team - Mettez un python dans votre robot ! (20)

gRPC, ECHANGES A HAUTE FREQUENCE ! DEVOXX 2018
gRPC, ECHANGES A HAUTE FREQUENCE ! DEVOXX 2018gRPC, ECHANGES A HAUTE FREQUENCE ! DEVOXX 2018
gRPC, ECHANGES A HAUTE FREQUENCE ! DEVOXX 2018
 
gRPC, échange à haute fréquence !
gRPC, échange à haute fréquence !gRPC, échange à haute fréquence !
gRPC, échange à haute fréquence !
 
Programmation de systèmes embarqués : Bus et périphériques de communication
Programmation de systèmes embarqués : Bus et périphériques de communicationProgrammation de systèmes embarqués : Bus et périphériques de communication
Programmation de systèmes embarqués : Bus et périphériques de communication
 
iTunes Stats
iTunes StatsiTunes Stats
iTunes Stats
 
Comment développer un serveur métier en python/C++
Comment développer un serveur métier en python/C++Comment développer un serveur métier en python/C++
Comment développer un serveur métier en python/C++
 
Formation python
Formation pythonFormation python
Formation python
 
gRPC, ECHANGES A HAUTE FREQUENCE !
gRPC, ECHANGES A HAUTE FREQUENCE !gRPC, ECHANGES A HAUTE FREQUENCE !
gRPC, ECHANGES A HAUTE FREQUENCE !
 
gRPC, échange à haute fréquence!
gRPC, échange à haute fréquence!gRPC, échange à haute fréquence!
gRPC, échange à haute fréquence!
 
Cpython
CpythonCpython
Cpython
 
Réseaux et protocoles - Cours + exercices
Réseaux et protocoles - Cours + exercices Réseaux et protocoles - Cours + exercices
Réseaux et protocoles - Cours + exercices
 
Odoo / OCA
Odoo / OCAOdoo / OCA
Odoo / OCA
 
Presentation langage go_19022015
Presentation langage go_19022015Presentation langage go_19022015
Presentation langage go_19022015
 
AlterWay SolutionsLinux Outils Industrialisation PHP
AlterWay SolutionsLinux Outils Industrialisation PHPAlterWay SolutionsLinux Outils Industrialisation PHP
AlterWay SolutionsLinux Outils Industrialisation PHP
 
201303 - Java8
201303 - Java8201303 - Java8
201303 - Java8
 
Go
GoGo
Go
 
CV touil mohamed
CV touil mohamedCV touil mohamed
CV touil mohamed
 
Les nouveautés du Framework .NET 4.5
Les nouveautés du Framework .NET 4.5Les nouveautés du Framework .NET 4.5
Les nouveautés du Framework .NET 4.5
 
Couche1 couche2 s4_v05
Couche1 couche2 s4_v05Couche1 couche2 s4_v05
Couche1 couche2 s4_v05
 
Astuces cisco
Astuces ciscoAstuces cisco
Astuces cisco
 
Chapitre1: Langage Python
Chapitre1: Langage PythonChapitre1: Langage Python
Chapitre1: Langage Python
 

BH Team - Mettez un python dans votre robot !