Copyright © 2006-2008 Gostai
This document is released under the Attribution-NonCommercial-NoDerivs 2.0 Creative Commons licence (http://creativecommons.org/licenses/by-nc-nd/2.0/deed.en).
Table of Contents
List of Tables
Cette documentation contient des informations à propos de l'URBI engine du Bioloid.
Vous serez intéressé de lire des informations sur le Bioloid sur www.bioloid.info si vous n'êtes pas encore familier avec lui.
Les premiers chapitres fournissent des instructions de démarage rapide et un court tutoriel pour utiliser URBI sur le Bioloid.
Le reste de la documentation contient une référence exhaustive pour le bioloid URBI engine et des exemples de scripts plus avancés.
Table of Contents
En premier, assurez vous que le module CM-5 est opérationel.
Vous aurez à flasher le firmware URBI dans le module. Cette opération est nécessaire pour la raison que le format d'envoi des data de l'URBI-engine est différent du protocole Robotis.
Vous pouvez trouver le fichier hexa ici : dans le dossier bin/firmware/ de votre dossier installation de votre bioloid ou la dernière version sur http://www.gostai.com/bioloid
Les systèmes Linux ont une dépendance avec la librairie de boost : vous devez installer la boost 1.34.1 library, elle peut se trouver sur http://www.gostai.com/bioloid .
Vous pouvez vérifier une autre erreur de dépendance en tapant ldd < INSTALLDIR >/urbi-server-bioloid
retourne les informations sur les dépendances de librairies, si une librairie est vérifiée (not found), vous aurez à l'installer. Principalement vous aurez toutes les librairies pré-installé, il manquera peut-être le package "libssl0.9.8".
(utilisez apt-get / aptitude / synaptique pour installer le package manquant sur debian/ubuntu system).
Les systèmes Windows n'ont pas de dépendances extérieures.
Utilisez le logiciel "robot terminal" de Robotis (installé avec vos logiciels installed bioloid).
Assurez vous que votre robot a ses batteries complètement chargées ou qu'il est branché sur le secteur.
Appuyez la touche '#' sur le clavier (Alt Gr + 3 sur clavier azerty, shift + 3 sur qwerty) et allumez le bioloid, vous devez voir cela:
SYSTEM O.K. (CM5 boot loader V1.xx) -#######
Appuyez la touche enter et tapez load et appuyer sur enter à nouveau:
SYSTEM O.K. (CM5 boot loader V1.xx) -####### -load Write Address: 00000000 Ready..
Dans la barre de menu sélectionnez Files (shortcut Ctrl+T) et sélectionnez le firmware du URBI bioloid (hex file),
clickez sur -> Transmit fileopen.
Après quelques secondes, le chargement se termine:
Ready..Success (and other information)
Si la procédure échoue, essayez à nouveau! Dans le cas où 'Rewriting:0x0002' est affiché: Vous avez déjà le bon firmware de flashé.
Une fois que vous avez un robot en état de marche, vous pouvez installer l'engine bioloid.
La procédure d'installation changera en fonction de votre système, mais cela vous sera familier.
Une fois fini, vous obtiendrez un répertoire bin dans lequel vous trouverez
le fichier binaire urbi-server-bioloid. D'autres fichiers importants sont localisés dans le répertoire Bioloid.data.
Avant de lancer l'engine, vous aurez à changer la valeur du port de connexion dans le fichier Bioloid.data/YourConfig.u à l'aide d'un simple éditeur de texte ou notepad, gedit,vi, etc...
Au même moment, vous pouvez vérifier que URBI.INI contient une ligne du genre load("");.
YourConfig.u peut être le fichier bioloid_scan.u (fichier par défaut) si vous venez juste de commencer avec urbi.
Ce fichier scan votre réseau bioloid et crée tous les objets nécessaires.
Vérifiez ce fichier pour voir comment le faire vous même si le résultat n'est pas approprié à votre réseau bioloid. (en particulier, l'ordre des moteurs AX-12).
Bioloid.connect(port, speed);
Connectez vous au bioloid sur le port port à la vitesse speed.
COM1 ou /dev/ttyS0" et 57600 sont de bonnes valeurs usuelles.
Cette fonction retourne 0 pour une ouverture de port avec succès.Attention:Cela ne veux pas dire que le bioloid est correctement connecté.
Exemple sous linux:
Bioloid.connect("/dev/ttyS0", 57600);
Allez au répertoire d'installation de votre bioloid, passez au répertoire bin/
et lancez urbi-server-bioloid --help. le message d'aide suivant devrait apparaitre:
usage: ./urbi-server-bioloid [OPTIONS] [PATHS...]
PATHS absolute or relative path elements searched
in order for files when 'load' is called.
Options:
-p PORT specify the tcp port URBI will listen to.
-b ADDR bind to a specific ip address.
-w FILE write port number to specified file.
-n disable networking.
-r report the time taken by URBI loop to execute
-i treat stdin as an urbi connection
-P PERIOD base URBI interval in milliseconds
-s PERIOD shell-mode (no network) with given period
-t use high priority scheduling
-f fast mode: the server will run as fast
as possible and emulate the period specified
-v, --version print version information and exit
Pour lancer rapidement l'engine du bioloid, tapez seulement:
./urbi-server-bioloid -P 40
pour les systèmes unix, ou
start /HIGH urbi-server-bioloid -P 40
dans un fichier .bat pour les utilisateurs de Windows.
L'engine affichera une en-tête et dira que c'est prêt. Si tout est juste, rien ne se produira de plus.
A ce moment, votre engine devrait fonctionner. Pour tester la connexion, utilisez ou l'outil fourni exprès par Gostai (like URBI_console, see http://www.urbiforge.com/), ou un simple client Telnet (veuillez notez que tous les ports de l'URBI engine sont 54000 par défaut).
telnet localhost 54000
Si aucune erreur n'apparait, votre client Telnet recevra le même type d'en-tête que vous voyez dans la fenêtre de l'engine. La dernière ligne vous donnera votre ID de connexion et sera de la forme :
[65000000:ident] *** ID: U135766920
Si ce n'est pas le cas, assurez vous que vous avez correctement installé l'engine et suivez les étapes précédentes. Référez vous aux disfonctionnements et FAQ si vous rencontrez des problèmes pour lancer le serveur malgré tout.
Vous êtes maintenant prêt à envoyer des commandes à votre robot par le bioloid URBI engine. Par exemple essayez :
vars; ... [00004004] *** Bioloid = OBJ ...
La première ligne demande la liste de toutes les variables connues par le serveur et celles, dont vous n'avez pas à vous intéresser, des symboles et de leurs valeurs respectives.
Il y a des fichiers spéciaux comme URBI.INI qui est lu au démarage de l'engine,
si ce fichier existe. Il y a un fichier URBI.INI dans le package standard du bioloid, vous
pouvez faire tourner l'engine avec ce fichier en entrant ceci:
./urbi-server-bioloid -P 40 ../gostai/Bioloid.data
Le dossier ../gostai/Bioloid.data/ contient un fichier URBI.INI et quelques fichiers files.u.
Note: avant d'entrer les commandes précédentes, soyez sûr que vous avez édité bioloid_scan.u
et décommenté la ligne Bioloid.connect adaptée à votre système.
Table of Contents
Ce chapitre introduira les concepts de base pour l'utilisation du bioloid URBI engine. Il peut être passé si vous êtes déjà familier avec URBI engines.
Pour de plus amples informations sur les commandes URBI, lisez les premiers chapitres du tutoriel URBI.
Avant toute autre chose, assurer vous du succès des étapes présentées dans le chapitre Quickstart.
Voici une petite liste de périphériques disponibles sur le bioloid avec lesquels vous pouvez contrôler l'engine. Ce sont les périphériques par défaut créés sans fichiers .u ou .ini
Table 3.1. Caractéristiques des périphériques
| Nom | Type | Description |
|---|---|---|
| Bioloid | Actor | Robot root |
| Motor | Actor | Motor device: parent, create one by AX-12 |
| Sensor | Actor | Sensor device: parent, create one by AX-S1 sensor |
Ces périphériques sont des périphériques parents, il est nécessaire de créer les
périphériques à partir d'eux pour utiliser votre robot bioloid:
Ceci est expliqué ensuite.
Essayez cette première commande dans votre cession Telnet :
sensor = new Sensor(100); [00000124] 0.000000
Si ce n'était déjà fait, cette ligne crée un UObject lié à votre AX-S1 dynamixiel réel avec ID 100, adaptez cette valeur à votre configuration.
sensor.irC; [00000476] 0.000000
La première ligne demande la valeur de l'émetteur IR central. La seconde
est la réponse de l'engine du bioloid.
La première valeur entière est un timestamp (marqueur de temps) pour la réponse
(en millisecondes depuis le lancement de l'engine). Il est suivi par un
tag. Référez vous au Tutoriel URBI
pour plus de détails. Ce qui est important ici, c'est le point flottant finissant la ligne.
C'est la valeur stockée dans l'émetteur d'IR central.Ici 0.000000
indique qu'il n'y a rien en face du robot.
Avec votre main droite devant le robot, vous devriez avoir une valeur aproximative de 255.000000.
Notez que les prochaines commandes seront incluses dans +end:{...};.
Ceci pour que l'engine vous prévienne de la fin de la commande.
Essayez ce qui suit :
+end:{motor__1.speed = 100; wait (2s) | motor__1.speed = 0;};
[00002622] *** end
Votre robot devrait avoir son 1er moteur qui a tourné pendant 2 secondes, puis s'est arrêté. Maintenant essayez de le faire revenir à sa position initiale avec une commande similaire.
Ensuite essayez :
+end:{motor__1.speed = -100; wait (2s) | motor__1.speed = 0;};
[00005095] *** end
Votre moteur devrait revenir à sa position initiale.
La dernière commande simple sera :
sensor on; irCDetect:at (sensor.irC > 100) echo "Front obstacle : " + sensor.irC;
Maintenant essayez de mettre votre main contre l'avant de votre bioloid AX-S1 module. Vous devriez avoir un message du genre :
[00008215] *** Front obstacle : 230
Le mot-clé at vous autorise à détecter des événements et à faire
agir votre bioloid en conséquence.
L'interface du bioloid est proche de celui spécifié dans le manuel des AX-12 et AX-S1. Tapez "myMotor; mySensor;" dans une connexion (où myMotor est un moteur instancié, et mySensor un sensor) pour obtenir la liste complète de leurs attributs.
Vous devriez maintenant être capable de vous amuser avec l'URBI engine du bioloid. Le prochain chapitre vous donnera des détails complets à propos de l'engine, mais ce que nous avons vu ici est suffisant pour utiliser le bioloid et URBI.
Cet UObject est le maître de tous les autres UObjects pour Bioloid. Il a seulement trois méthodes utilisables par l'utilisateur.
connect("device",int speed) Se connecter au réseau RS232 du Bioloid. Cette méthode nécessite d'être appelée en premier avant toute autre commande. Elle retourne 0 en cas de réussite.
Bioloid.connect("/dev/ttyS0", 57600);
[00000066] 0
connexion sous sytème unix
Bioloid.connect("COM1", 57600);
[00000076] 0
connexion sous système windows.
Veuillez noter que le firmware flashé dans le Bioloid CM-5 est programmé pour travailler à 57600 bauds pour le moment; Donnez 57600 comme paramètre dans tous les cas pour le second paramètre est une bonne pratique.
ping(int Id) Envoyez un ping sur l'ID d'un dynamixiel pour tester si un dynamixiel est present sur le réseau. Cette méthode retourne l'ID si un dynamixiel est présent, 255 s'il est absent ou l'ID introuvable.
Bioloid.ping(12); [00004993] 12 Bioloid.ping(29); [00012900] 255
Un dynamixiel avec un ID 12 était sur le réseau, mais aucun avec ID 29.
scan() Scannez l'ensemble des 253 ID disponibles (0~252, pas besoin de tester ID 254 et #253 est réservé pour la gestion du CM-5), retourne la liste de tous les dynamixiels présent sur le réseau. C'est une fonction bloquante qui peut prendre un peu de temps (2~3 seconds). Dans la plupart des cas vous avez juste à le lancer au démarage pour trouver le réseau (juste après avoir fait un Bioloid.connect).
Bioloid.scan(); scanning network, may take some time... [00099415] [12, 18, 100] Bioloid; [00109621] OBJ [listAXS1:[100],load:1,listAX12:[12, 18]]
Note: Comment fonctionne scan(): il fait un ping sur tous les ID et attends les réponses.
Après avoir appelé ces fonctions, deux listes sont disponibles dans les objets Bioloid: Bioloid.listAXS1 et Bioloid.listAX12.
Chaque liste contient tous les ID, triés, par dynamixiels AX-S1 pour le premier et dynamixiels AX-12 pour le second.
Vous pouvez utiliser ces listes pour créer tous vos objets motors et sensors. (regardez <bioloid-dir>/Bioloid.data/bioloid_scan.u dans votre dossier d'installation pour plus de détails et d'exemples).
Les motors du Bioloid sont accessibles par les objets Motor et ont les caractéristiques suivantes :
Table 4.1. caractéristiques des Motors
| Nom | Rangemin | Rangemax | Description |
|---|---|---|---|
| motor__0 | -1023 | 1023 | motor with ID #0 |
| motor__1 | -1023 | 1023 | motor with ID #1 |
| ... | -1023 | 1023 | ... |
| motor__x | -1023 | 1023 | motor with ID #x |
Si votre engine ne charge aucun filename.u au démarage (declarés dans CLIENT.INI ou dans URBI.INI),
par défaut aucun motor n'est créé à cause de la structure du Bioloid, nous ne savons pas combien de motors sont dans votre robot,
vous devez les déclarer avant de leur envoyer la moindre commande.
motor[i] = new Motor(j);
cette méthode peut être utilisée pour créer un array de 0 jusqu'au nombre de motors que vous utilisez dans l'ordre que vous voulez.
var i = 0;
for j in [10,12,16,18] {
motor[i] = new Motor(j);
i = i + 1;
};
ou pour une création automatisée de tous les motors disponibles:
var i = 0;
for j in Bioloid.listAX12 {
motor[i] = new Motor(j);
i = i + 1;
};
Cet exemple cré les 4 motors de la voiture Bioloid:
Les motors sont accessibles par le motor__X, avec X entre 0 et votre max_numbered_motor. Vous pouvez (aurez besoin d') adapter l' #ID des motors dans votre script de configuration de votre robot (c'est plus simple que de renommer chaque motor)!
Nommage Standard:
Dépendant de la forme de votre robot Bioloid (humanoïde, voiture, quadrupède, etc ...) les fichiers *.u existent pour créer des alias et des groupes pour ces motors, pour avoir un standard de nommage commun pour tous les robots. Regardez dans le dossier Bioloid.data.
Un motor a les attributs suivants:
Table 4.2. Les attributs motors de l'AX-12
| Nom | Rangemin | Rangemax | Description |
|---|---|---|---|
| Movements | |||
| load | 0 | 1 | (not 0x18) torque applied when 1 (position close-loop-control active) |
| reversedWheel | 0 | 255 | Inverse rotation way in speed mode.Usefull for opposed wheels in a car robot |
| speed | -1023 | 1023 | 0x20 Motor speed (ignored in position mode) |
| targetSpeed | -1023 | 1023 | |
| torque | 0 | 1023 | 0x28 max torque |
| torqueLimit | 0 | 1023 | 0x0E / 0x22 Motor maximum torque. Motor won't move if torque is too weak. |
| val | -1023 | 1023 | 0x24 Motor position (ignored in speed mode) |
| targetVal | -1023 | 1023 | |
| cwAngleLimit | 0 | 1023 | 0x06 Position limits. Used to switch from speed mode to position mode |
| ccwAngleLimit | 0 | 1023 | 0x08 same as above |
| moving | 0 | 1 | 0x2E Read: is 1 when motor turn, 0 when motor stopped (only in position mode) |
| Temperature | |||
| temperature | 0 | 255 | 0x2B temperature |
| temperatureLimit | 0 | 150 | 0x0B threshold of temperature to set overheating bit in status packet, if 1: set alarmLed |
| Power Supply | |||
| voltage | 0 | 255 | 0x2A read 10 x Voltage on dynamixiel (100 is 10.0V) |
| lowVoltageLimit | 50 | 250 | 0x0C set 10 x volatge threshold to set alarm |
| highVoltageLimit | 50 | 250 | 0x0D set 10 x volatge threshold to set alarm |
| punch | 0 | 1023 | 0x30 minimum current supplied to motor (32 is better as minimum) |
| LoopBack | |||
| ccwAsservMargin | 0 | 254 | 0x1B |
| cwAsservMargin | 0 | 254 | 0x1A |
| cwAsservGain | 0 | 254 | 0x1C |
| ccwAsservGain | 0 | 254 | 0x1D |
| Led | |||
| LED | 0 | 1 | 0x19 switch Off/On red led on this motor; 1 is ON |
| alarmLED | 0 | 127 | 0x11 if set bits to 1 led blink: there is a selected error |
| alarmShutdown | 0 | 127 | 0x12 if selected bit is set, torque is set to 0 on selected error(s) |
| Identifier | |||
| ID | 0 | 253 | 0x03 Read ID of AX-12 motor |
| firmwareVersion | 0 | 255 | 0x02 Read firmware version |
| modelNumber | 0 | 65535 | 0x00 Read always 12 for an AX-12 |
| baudRate | 0 | 254 | 0x04 Communication speed. refer bioloid AX-12 manual (1 is 1Mbps) |
| Other informations | |||
| downCalibration | 0 | 65535 | 0x14 ReadOnly: delta between potentiometer and position |
| upCalibration | 0 | 65535 | 0x16 ReadOnly: delta between potentiometer and position |
| registeredInstruction | 0 | 1 | 0x2C ... |
| returnDelay | 0 | 254 | 0x05 time delay for return status packet: 2us *returnDelay |
| returnStatus | 0 | 2 | 0x10 status of dynamixiel, equal 2 in normal mode |
| lock | 1 | 1 | 0x2F if set to 1 only speed and val can be written, power down to disable |
tous ces attributs sont disponibles en appellant myMotor.attribute comme:
motor__1.load; pour lire l'attribut load de motor[1] object.
motor__2.LED = 1; pour écrire l'attribut LED de motor[2] object.
motor[2].LED = 1; pour écrire l'attribut LED de motor[2] object.
Vous pouvez contrôler votre motor en deux modes, dépendant du close-loop control que vous voulez:
Position mode : with motor__X.val, le moteur tourne sur une position et s'arrête
Speed mode : with motor__X.speed, le moteur tourne sans fin à cette vitesse
Pour utiliser cette caractéristique vous aurez à régler .cwAngleLimit et .ccwAngleLimit aux valeurs adaptées:
Position mode : .cwAngleLimit et .ccwAngleLimit sont des valeurs limites de position, dans le sens des aiguilles et à contre-sens.
Speed mode : .cwAngleLimit et .ccwAngleLimit égale à 0.
Pour chaque description commencant par une adresse 0xNN le nombre correspond à l'adresse mémoire du AX-12,
voyez le manuel du dynamixiel AX-12 pour plus d'informations sur ces fonctions :
AX-12 Dynamixiel ou ici
Au démarage de l'engine Bioloid, les sensors nécessitent d'être créés en premier, puis accéder aux valeurs de leurs différents membres retourne toutes les valeurs d'un module AX-S1. Pour créer un nouvel UObject sensor (AX-S1 #ID est 100 dans cet exemple):
sensor = new Sensor (100);
Le module sensor dynamixel AX-S1 est accessible par l'objet Sensor
et a les caractéristiques suivantes :
Table 4.3. Les attributs sensor du AX-S1
| Nom | Rangemin | Rangemax | Description |
|---|---|---|---|
| IR sensors | |||
| irC | 0 | 255 | 0x1B Read Centered InfraRed sensor values. Distance from 0 to 255. |
| irL | 0 | 255 | 0x1A Read Left InfraRed sensor values. 255 is very close |
| irR | 0 | 255 | 0x1C Read Right InfraRed sensor values. 0 is nothing there |
| Light sensors | |||
| lightC | 0 | 1 | 0x1E Read Centered Light values (triggers). 0 or 1. |
| lightL | 0 | 1 | 0x1D Read Left Light values (triggers). 0 or 1. |
| lightR | 0 | 1 | 0x1F Read Right Light values (triggers). 0 or 1. |
| light | 0 | 7 | 0x21 Read, light detected (lightX value > compare value) |
| lightCompare | 0 | 255 | 0x35 RAM value of threshold compared to lightX |
| lightTheshold | 0 | 255 | 0x15 ROM value, load in RAM (0x35) at power ON |
| Obstacle sensors | |||
| obstacle | 0 | 7 | 0x20 Read, Obstacle detected (irX value > compare value) |
| obstacleCompare | 0 | 255 | 0x34 RAM value of threshold compared to irX |
| obstacleThreshold | 0 | 255 | 0x14 ROM value, load in RAM (0x34) at power ON |
| Buzzer | |||
| sound | 0 | 255 | 0x23 return max sound amplitude 0 mini <128 null <255 max |
| soundMaxHold | 0 | 255 | 0x24 low pass filter, 0 for measuring max loudness |
| soundOccurenceCount | 0 | 255 | 0x25 Sound clap counter |
| soundOccurenceTime | 0 | 65535 | 0x26 Time of last detected clap |
| buzzerIndex | 0 | 255 | 0x28 Note to play. Play note at val assignment 0=la, 1=la#,... |
| buzzerTime | 0 | 255 | 0x29 |
| Temperature | |||
| temperature | 0 | 255 | 0x2B Read temperature in celcius degrees |
| temperatureLimit | 0 | 150 | 0x0B Temperature Alerte threshold |
| Power supply | |||
| voltage | 0 | 255 | 0x2A Read 10 x voltage |
| lowVoltageLimit | 50 | 250 | 0x0C |
| highVoltageLimit | 50 | 250 | 0x0D |
| IR communication | |||
| IRRemoconRX0 | 0 | 255 | 0x30 Read first byte received |
| IRRemoconRX1 | 0 | 255 | 0x31 Read second byte received |
| IRRemoconTX0 | 0 | 255 | 0x32 first byte to transmit |
| IRRemoconTX1 | 0 | 255 | 0x33 second byte to transmit |
| IRRemoconArrived | 0 | 255 | 0x2E Read |
| Other Informations | |||
| load | 0 | 1 | .. |
| ID | 0 | 253 | 0x03 Read ID of AX-S1 |
| firmwareVersion | 0 | 255 | 0x02 Read firmware version |
| modelNumber | 0 | 65535 | 0x00 Read model number: is 13 for AX-S1 |
| returnStatus | 0 | 2 | 0x10 |
| baudRate | 0 | 254 | 0x04 baudrate |
| registeredInstruction | 0 | 1 | 0x2C |
| returnDelay | 0 | 254 | 0x05 |
| lock | 1 | 1 | 0x2F |
Ici vous pouvez trouver les AX-S1 Specifications pour plus d'information.
Table of Contents
Ce chapitre introduira quelques scripts simples. Pour les utiliser tapez
load ("NomDuFichier.u");
Dépendant de la version du bioloid URBI engine que vous avez, quelques
scripts seront disponibles dans les dossiers data, profiles ou scripts de votre répertoire d'installation.
Avant tout autre chose, assurez vous d'être familiarisé avec les parties précédentes de ce document.
Pour de plus amples instructions et informations sur les commandes URBI, veuillez lire les premiers chapitres du tutorial URBI.
Tous ces scripts simples supposent que URBI.INI est vide, aussi mettez les lignes en commentaires avec des #
ou des // au début de chaques lignes de URBI.INI pour éviter des comportements imprévisibles.
/* ----------------- Basic pour bioloid --------------------------------- */
/// Se connecter à Bioloid (si ce n'est déjà fait!)
Bioloid.connect("/dev/ttyS0", 57600);
/// Créez les moteurs
var i = 0;
//déclarez l'ID de votre moteur connecté ici
for j in [10,12,16,18] {
motor[i] = new Motor(j);
i = i + 1;
};
var NumberOfMotor = i;
t: {
for (j=0; j<3;j++) {
for (i=0; i<NumberOfMotor;i++) motor[i].speed = 100 smooth:1s;
wait(1.5s);
for (i=0; i<NumberOfMotor;i++) motor[i].speed = 0 smooth:1s;
wait(1.5s);
};
};
/* ----------------- Basic pour bioloid --------------------------------- */
Ceci fera tester chacun de ses moteurs par bioloid par un petit mouvement, 3 fois
/* -------------------- Music pour bioloid --------------------------------- */
/// Se connecter à Bioloid (si ce n'est déjà fait!)
Bioloid.connect("/dev/ttyS0", 57600);
/// Créer un sensor
sensor = new Sensor(100);
music:{
for (i=0; i<27;i++){
sensor.buzzerTime=255;
sensor.buzzerIndex=i;
wait(1.5s);
};
};
/* -------------------- Music pour bioloid --------------------------------- */
Ceci fera jouer ses 26 mélodies pré-enregistrées à votre module bioloid AX-S1.
/* ----------------- Bumper pour bioloid car --------------------------------- */
bumper:at (irC > 100) // à la détection d'un obstacle
{
wheels = 0 | wait (500ms); // s'arrête et attends un peu
wheels = -50 | wait (1s); // recule
wheels = 0 time:1s | // stop doucement
wheels = 100; // avance
};
wheels = 100; // initial start
/* ----------------- Bumper pour bioloid car --------------------------------- */
Ceci fera avancer votre bioloid, s'arrêter devant le premier obstacle,
reculer un peu et avancer à nouveau. Vous aurez à imaginer comment l'arrêter.
Vous devez charger bioloid_car.u avant d'exécuter ce script pour avoir de bons résultats.
(Il est mieux d'avoir un robot avec 4 roues pour avoir une bonne vision du comportement).
/* ----------------- Navigator pour bioloid car --------------------------------- */
var WHEEL_SLOW = 30; // vitesse d'avance
var WHEEL_FAST = 80; // vitesse de rotation
var NAV.side = 1; // sens de rotation
navigator:at (irC > 150) // à la détection d'un obstacle
{
wheels = 0 | wait (500ms); // s'arrête et attends un peu
wheels = -40 | wait (500ms); // recule
NAV.side = NAV.side * -1; // change de direction
wheelL = NAV.side * WHEEL_FAST & // tourne
wheelR = - NAV.side * WHEEL_FAST;
waituntil (irC < 50) | wheels = WHEEL_SLOW; // attends que le chemin soit libre
// et avance
};
wheels = WHEEL_SLOW; // initial start
/* ----------------- Navigator pour bioloid car --------------------------------- */
Vous devez charger bioloid_car.u avant d'exécuter ce script avec de bons résultats.
Ce script fera tourner votre robot autant vers la gauche que vers la droite de l'obstacle jusqu'à ce qu'il trouve une voie libre. Il avancera ensuite jusqu'au prochain obstacle.
Dans cette section vous apprendrez à créer votre propre engine Bioloid avec les modules dont vous avez besoin pour votre robot Bioloid
Le fichier binaire exécutable urbi-server-bioloid contient seulement des UObjects pour gérer les briques CM-5, AX-12 et AX-S1. Si vous voulez que votre robot ait d'autres amméliorations, comme une caméra, micro, etc ... vous aurez besoin d'ajouter des UObjects à votre engine (et du matériel, aussi): ils peuvent être intégrés ou à distance.
composants à distance: Ces UObjects sont auto-exécutable, ils ont besoin de se connecter à un engine en cours de fonctionnement. Ils sont compilés seuls et peuvent se connecter à tout engine.
Composants intégrés: Ces UObjects sont compilés dans l'engine, ils sont automatiquement lancés avec l'engine et lui appartiennent complètement.
Des informations plus détaillées sur ce sujet sont dans : URBI quickstart, en particulier le chapitre sur les UObjects.
En créant votre propre engine vous avez seulement un exécutable à lancer, Pas besoin de lancer l'engine et après les composants à distance. Comment obtenir ce résultat est expliqué dans la section suivante.
Si vous avez besoin d'ajouter un module à votre engine, avoir un UObject intégré est plus pratique à l'utilisation (un seul exécutable à lancer). Un désavantage est que vous avez à recompiler le moteur dans son entier quand vous faites une modification sur un UObject intégré. Pour un composant à distance, vous avez juste besoin de recompiler l'UObject modifié.
Avec votre SDK URBI Bioloid est fourni un fichier liburbiengine-bioloid.a qui est une librairie contenant l'engine Bioloid; lier ce fichier quand vous compilez votre UObject est le meilleur moyen de créer votre propre engine Bioloid.
Créez vos propre UObjects : généralement ce sont des fichiers .cc, voyez
tutorial: UObject documentation pour plus de details.
Comment compiler: créez un fichier Makefile avec ceci dedans:
#nom du binaire final PRG=myBioloidEngine #lieu ou se trouve le dossier nommé "urbiengine-bioloid" URBIENGINE_BIOLOID_DIR=/ LIBURBIENGINE_BIOLOID=\ $(URBIENGINE_BIOLOID_DIR)/usr/local/gostai/core/i686-pc-linux-gnu/\ engine/liburbiengine-bioloid.a BIN_BIOLOID=$(URBIENGINE_BIOLOID_DIR)/usr/local/bin all: $(BIN_BIOLOID)/umake-engine --prefix=../usr/local \ -o $(PRG) $(LIBURBIENGINE_BIOLOID) *.cc clean: rm -rf _ubuild-$(PRG) $(PRG)
$PRG est le nom du binaire final que vous avez généré.
$URBIENGINE_BIOLOID_DIR est le dossier d'installation ou l'on peut trouver .../gostai/core/.../liburbiengine-bioloid.a.
Pour compiler votre engine, entrez juste make dans un shell, dans votre dossier.
Vous pouvez trouver ici des UObjects comme exemples: Urbiforge .
Table of Contents
A: Ceci se produit lorsque votre module CM-5 bioloid est éteint ou quand vous êtes connecté sur le mauvais port RS232 (COMport).
Vérifiez l'alimentation du bioloid (certaines led doivent être allumées).
Vérifiez la connection physique entre le bioloid et l'ordinateur (Numéro de port et vitesse).
------------------------------------------------------------- | bad response: | - error: 8: range error | - id: 10 | - value: 0 | - raw value: [235, ] | - value length: 0 -------------------------------------------------------------
A: Ce message correspond au status packet retourné par le module CM-5 il est affiché quand une erreur se produit (status packet contient des informations sur l'erreur).
Vérifiez la documentation de l'AX-12 pour interpréter cette erreur.
Dans la majorité des cas, ceci se produit quand vous avez utilisé le mode rapide et que vous voulez passer en mode close-loop control en réglant
ccwAngleLimit et cwAngleLimit, si la position (.val) n'est pas dans les limites et que vous appelez un motor__X.val=y; cette erreur est produite à cause de la position qui est hors limites : c'est normal.
A:
Nous avons implémenté la gestion de la batterie dans le firmware. Pour commencer à charger la batterie, la procédure est la même que dans le firmware d'origine :
poussez le bouton U ("up"). la led sous tension clignotera jusqu'à la fin de la charge.
cette documentation Leds-Code-Battery-management.odt
(Format OpenOffice) explique en détail toutes les significations du comportement des leds sur CM-5 avec le firmware URBI.
A:
Au fur et à mesure que nous développons un nouveau firmware, les anciennes fonctionnalités de Robotis deviennent inactives tant que l'Urbi firmware est dans le CM-5.
Pour le moment, seul les boutons U ont une utilité (voir plus haut), le bouton Mode reset le module CM-5, les autres boutons ne servent plus (voir la documentation plus haut pour les details).
THE WORK (AS DEFINED BELOW) IS PROVIDED UNDER THE
TERMS OF THIS CREATIVE COMMONS PUBLIC LICENSE ("CCPL" OR
"LICENSE"). THE WORK IS PROTECTED BY COPYRIGHT AND/OR OTHER APPLICABLE
LAW. ANY USE OF THE WORK OTHER THAN AS AUTHORIZED UNDER THIS LICENSE
OR COPYRIGHT LAW IS PROHIBITED.
BY EXERCISING ANY RIGHTS TO THE WORK PROVIDED HERE, YOU ACCEPT AND
AGREE TO BE BOUND BY THE TERMS OF THIS LICENSE. THE LICENSOR GRANTS
YOU THE RIGHTS CONTAINED HERE IN CONSIDERATION OF YOUR ACCEPTANCE OF
SUCH TERMS AND CONDITIONS.
1. Definitions
1. "Collective Work" means a work, such as a periodical issue,
anthology or encyclopedia, in which the Work in its entirety in
unmodified form, along with a number of other contributions,
constituting separate and independent works in themselves, are
assembled into a collective whole. A work that constitutes a
Collective Work will not be considered a Derivative Work (as
defined below) for the purposes of this License. 2. "Derivative
Work" means a work based upon the Work or upon the Work and other
pre-existing works, such as a translation, musical arrangement,
dramatization, fictionalization, motion picture version, sound
recording, art reproduction, abridgment, condensation, or any other
form in which the Work may be recast, transformed, or adapted,
except that a work that constitutes a Collective Work will not be
considered a Derivative Work for the purpose of this License. For
the avoidance of doubt, where the Work is a musical composition or
sound recording, the synchronization of the Work in timed-relation
with a moving image ("synching") will be considered a Derivative
Work for the purpose of this License. 3. "Licensor" means the
individual or entity that offers the Work under the terms of this
License. 4. "Original Author" means the individual or entity who
created the Work. 5. "Work" means the copyrightable work of
authorship offered under the terms of this License. 6. "You" means
an individual or entity exercising rights under this License who
has not previously violated the terms of this License with respect
to the Work, or who has received express permission from the
Licensor to exercise rights under this License despite a previous
violation.
2. Fair Use Rights. Nothing in this license is intended to reduce,
limit, or restrict any rights arising from fair use, first sale or
other limitations on the exclusive rights of the copyright owner under
copyright law or other applicable laws.
3. License Grant. Subject to the terms and conditions of this License,
Licensor hereby grants You a worldwide, royalty-free, non-exclusive,
perpetual (for the duration of the applicable copyright) license to
exercise the rights in the Work as stated below:
1. to reproduce the Work, to incorporate the Work into one or more
Collective Works, and to reproduce the Work as incorporated in the
Collective Works; 2. to distribute copies or phonorecords of,
display publicly, perform publicly, and perform publicly by means
of a digital audio transmission the Work including as incorporated
in Collective Works;
The above rights may be exercised in all media and formats whether now
known or hereafter devised. The above rights include the right to make
such modifications as are technically necessary to exercise the rights
in other media and formats, but otherwise you have no rights to make
Derivative Works. All rights not expressly granted by Licensor are
hereby reserved, including but not limited to the rights set forth in
Sections 4(d) and 4(e).
4. Restrictions.The license granted in Section 3 above is expressly
made subject to and limited by the following restrictions:
1. You may distribute, publicly display, publicly perform, or
publicly digitally perform the Work only under the terms of this
License, and You must include a copy of, or the Uniform Resource
Identifier for, this License with every copy or phonorecord of the
Work You distribute, publicly display, publicly perform, or
publicly digitally perform. You may not offer or impose any terms
on the Work that alter or restrict the terms of this License or the
recipients' exercise of the rights granted hereunder. You may not
sublicense the Work. You must keep intact all notices that refer to
this License and to the disclaimer of warranties. You may not
distribute, publicly display, publicly perform, or publicly
digitally perform the Work with any technological measures that
control access or use of the Work in a manner inconsistent with the
terms of this License Agreement. The above applies to the Work as
incorporated in a Collective Work, but this does not require the
Collective Work apart from the Work itself to be made subject to
the terms of this License. If You create a Collective Work, upon
notice from any Licensor You must, to the extent practicable,
remove from the Collective Work any reference to such Licensor or
the Original Author, as requested. 2. You may not exercise any of
the rights granted to You in Section 3 above in any manner that is
primarily intended for or directed toward commercial advantage or
private monetary compensation. The exchange of the Work for other
copyrighted works by means of digital file-sharing or otherwise
shall not be considered to be intended for or directed toward
commercial advantage or private monetary compensation, provided
there is no payment of any monetary compensation in connection with
the exchange of copyrighted works. 3. If you distribute, publicly
display, publicly perform, or publicly digitally perform the Work,
You must keep intact all copyright notices for the Work and give
the Original Author credit reasonable to the medium or means You
are utilizing by conveying the name (or pseudonym if applicable) of
the Original Author if supplied; the title of the Work if supplied;
and to the extent reasonably practicable, the Uniform Resource
Identifier, if any, that Licensor specifies to be associated with
the Work, unless such URI does not refer to the copyright notice or
licensing information for the Work. Such credit may be implemented
in any reasonable manner; provided, however, that in the case of a
Collective Work, at a minimum such credit will appear where any
other comparable authorship credit appears and in a manner at least
as prominent as such other comparable authorship credit. 4.
For the avoidance of doubt, where the Work is a musical
composition: 1. Performance Royalties Under Blanket
Licenses. Licensor reserves the exclusive right to collect,
whether individually or via a performance rights society
(e.g. ASCAP, BMI, SESAC), royalties for the public
performance or public digital performance (e.g. webcast) of
the Work if that performance is primarily intended for or
directed toward commercial advantage or private monetary
compensation. 2. Mechanical Rights and Statutory
Royalties. Licensor reserves the exclusive right to collect,
whether individually or via a music rights agency or
designated agent (e.g. Harry Fox Agency), royalties for any
phonorecord You create from the Work ("cover version") and
distribute, subject to the compulsory license created by 17
USC Section 115 of the US Copyright Act (or the equivalent in
other jurisdictions), if Your distribution of such cover
version is primarily intended for or directed toward
commercial advantage or private monetary compensation.
5. Webcasting Rights and Statutory Royalties. For the
avoidance of doubt, where the Work is a sound recording,
Licensor reserves the exclusive right to collect, whether
individually or via a performance-rights society
(e.g. SoundExchange), royalties for the public digital
performance (e.g. webcast) of the Work, subject to the
compulsory license created by 17 USC Section 114 of the US
Copyright Act (or the equivalent in other jurisdictions), if
Your public digital performance is primarily intended for or
directed toward commercial advantage or private monetary
compensation.
5. Representations, Warranties and Disclaimer
UNLESS OTHERWISE MUTUALLY AGREED BY THE PARTIES IN WRITING, LICENSOR
OFFERS THE WORK AS-IS AND MAKES NO REPRESENTATIONS OR WARRANTIES OF
ANY KIND CONCERNING THE WORK, EXPRESS, IMPLIED, STATUTORY OR
OTHERWISE, INCLUDING, WITHOUT LIMITATION, WARRANTIES OF TITLE,
MERCHANTIBILITY, FITNESS FOR A PARTICULAR PURPOSE, NONINFRINGEMENT, OR
THE ABSENCE OF LATENT OR OTHER DEFECTS, ACCURACY, OR THE PRESENCE OF
ABSENCE OF ERRORS, WHETHER OR NOT DISCOVERABLE. SOME JURISDICTIONS DO
NOT ALLOW THE EXCLUSION OF IMPLIED WARRANTIES, SO SUCH EXCLUSION MAY
NOT APPLY TO YOU.
6. Limitation on Liability. EXCEPT TO THE EXTENT REQUIRED BY
APPLICABLE LAW, IN NO EVENT WILL LICENSOR BE LIABLE TO YOU ON ANY
LEGAL THEORY FOR ANY SPECIAL, INCIDENTAL, CONSEQUENTIAL, PUNITIVE OR
EXEMPLARY DAMAGES ARISING OUT OF THIS LICENSE OR THE USE OF THE WORK,
EVEN IF LICENSOR HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
7. Termination
1. This License and the rights granted hereunder will terminate
automatically upon any breach by You of the terms of this
License. Individuals or entities who have received Collective Works
from You under this License, however, will not have their licenses
terminated provided such individuals or entities remain in full
compliance with those licenses. Sections 1, 2, 5, 6, 7, and 8 will
survive any termination of this License. 2. Subject to the above
terms and conditions, the license granted here is perpetual (for
the duration of the applicable copyright in the
Work). Notwithstanding the above, Licensor reserves the right to
release the Work under different license terms or to stop
distributing the Work at any time; provided, however that any such
election will not serve to withdraw this License (or any other
license that has been, or is required to be, granted under the
terms of this License), and this License will continue in full
force and effect unless terminated as stated above.
8. Miscellaneous
1. Each time You distribute or publicly digitally perform the Work
or a Collective Work, the Licensor offers to the recipient a
license to the Work on the same terms and conditions as the license
granted to You under this License. 2. If any provision of this
License is invalid or unenforceable under applicable law, it shall
not affect the validity or enforceability of the remainder of the
terms of this License, and without further action by the parties to
this agreement, such provision shall be reformed to the minimum
extent necessary to make such provision valid and enforceable.
3. No term or provision of this License shall be deemed waived and
no breach consented to unless such waiver or consent shall be in
writing and signed by the party to be charged with such waiver or
consent. 4. This License constitutes the entire agreement between
the parties with respect to the Work licensed here. There are no
understandings, agreements or representations with respect to the
Work not specified here. Licensor shall not be bound by any
additional provisions that may appear in any communication from
You. This License may not be modified without the mutual written
agreement of the Licensor and You.