http://www.fing.edu.uy/inco/proyectos/butia/mediawiki/api.php?action=feedcontributions&user=Pbruccoleri&feedformat=atom
Proyecto Butiá - Contribuciones del usuario [es]
2024-03-28T20:43:19Z
Contribuciones del usuario
MediaWiki 1.26.2
http://www.fing.edu.uy/inco/proyectos/butia/mediawiki/index.php?title=Liceo_N%C2%B01_-_San_Jos%C3%A9&diff=543
Liceo N°1 - San José
2011-06-25T21:30:14Z
<p>Pbruccoleri: </p>
<hr />
<div>Se comenzó desde principios de año con un taller opcional para todos los alumnos del liceo (es un liceo de bachillerato).<br />
<br />
El mismo se desarrolla los Lunes de 20 a 21 Hs.<br />
<br />
En un inicio se comenzó con una descripción general de las XO y Sugar (son alumnos que no tienen XO por tanto no conocen mucho la interfaz y tienen poco conocimiento de GNU/Linux en general). Se les enseñaron también comandos básicos de bash.<br />
<br />
Luego se comenzó con la descripción de algunos bloques de TortugArteButiá y se realizaron pequeños ejercicios de prueba.<br />
<br />
Desde el 16/05 por interés de los alumnos en aprender un lenguaje de programación, se comenzó con un taller básico de Python, para después comenzar el estudio de la API Butiá para Python y realizar los "desafíos" usando ese lenguaje.<br />
<br />
Se está usando un material elaborado por el prof. Flavio Danesse, además de los manuales que hay en internet sobre el lenguaje:<br />
<br />
[http://www.reducativa.com/xo/python_0.pdf Python 0]<br />
<br />
[http://www.reducativa.com/xo/python_1.pdf Python 1]<br />
<br />
[http://www.reducativa.com/xo/python_2.pdf Python 2]<br />
<br />
[http://www.reducativa.com/xo/python_3.pdf Python 3]<br />
<br />
[http://www.reducativa.com/xo/python_4.pdf Python 4]<br />
<br />
[http://www.reducativa.com/xo/python_5.pdf Python 5]<br />
<br />
Luego con la ayuda de los alumnos se comenzó a estudiar las funciones del API, que se documentaron en esta wiki.<br />
<br />
<br />
Próximamente colocaremos algunos trabajos realizados por los alumnos</div>
Pbruccoleri
http://www.fing.edu.uy/inco/proyectos/butia/mediawiki/index.php?title=Liceo_N%C2%B01_-_San_Jos%C3%A9&diff=542
Liceo N°1 - San José
2011-06-25T21:25:14Z
<p>Pbruccoleri: Página creada con 'Se comenzó desde principios de año con un taller opcional para todos los alumnos del liceo (es un liceo de bachillerato). El mismo se desarrolla los lunes de 20 a 21 Hs. En ...'</p>
<hr />
<div>Se comenzó desde principios de año con un taller opcional para todos los alumnos del liceo (es un liceo de bachillerato).<br />
<br />
El mismo se desarrolla los lunes de 20 a 21 Hs.<br />
<br />
En un inicio se comenzó con una descripción general de las XO y Sugar (son alumnos que no tienen XO por tanto no conocen mucho la interfaz y tienen poco conocimiento de GNU/Linux en general)<br />
<br />
Luego se comenzó con la descripción de algunos bloques de TortugArteButiá y se realizaron pequeños ejercicios de prueba.<br />
<br />
Desde el 16/05 por interés de los alunnos en aprender un lenguaje de programación, se comenzó con un taller básico de Python, para después comenzar el estudio de la API Butiá para python y realizar los "desafíos" usando ese lenguaje.<br />
<br />
Se está usando un material elaborado por el prof. Flavio Danesse, además de los manuales que hay en internet sobre el lenguaje:<br />
<br />
[http://www.reducativa.com/xo/python 0 (UTU - Rafael Peraza) Python 0]</div>
Pbruccoleri
http://www.fing.edu.uy/inco/proyectos/butia/mediawiki/index.php?title=Espacio_liceos&diff=541
Espacio liceos
2011-06-25T21:15:15Z
<p>Pbruccoleri: </p>
<hr />
<div>[[Liceo Bauzá]]<br><br />
[[Liceo 10]]<br><br />
[[Liceo 65]]<br><br />
[[Liceo N°1 - San José]]<br></div>
Pbruccoleri
http://www.fing.edu.uy/inco/proyectos/butia/mediawiki/index.php?title=API&diff=517
API
2011-06-21T23:53:23Z
<p>Pbruccoleri: /* Carga de batería */</p>
<hr />
<div>== API del Butiá ==<br />
<br />
Descripción de las funciones y algunos ejemplos.<br />
<br />
<br />
'''Instanciar la clase:'''<br />
<br />
<syntaxhighlight lang="python"><br />
robot = butiaAPI.robot()<br />
</syntaxhighlight><br />
<br />
<br />
'''Apertura:'''<br />
<br />
abrirButia<br />
<br />
<br />
<syntaxhighlight lang="python"><br />
robot.abrirButia()<br />
</syntaxhighlight><br />
<br />
<br />
'''Versión:'''<br />
<br />
getVersion<br />
Devuelve la versión del firmware de la placa con el que estamos trabajando <br />
<br />
<syntaxhighlight lang="python"><br />
ver = robot.getVersion()<br />
print ver<br />
</syntaxhighlight><br />
<br />
<br />
'''Cerrar:'''<br />
<br />
cerrar<br />
Cierra la comunicación con el servidor bobot<br />
<br />
<br />
<syntaxhighlight lang="python"><br />
robot.cerrar()<br />
</syntaxhighlight><br />
<br />
<br />
'''Conexión/Desconexión con el servidor:'''<br />
<br />
reconnect<br />
Conecta o Reconecta al bobot en address:port<br />
<br />
<br />
<syntaxhighlight lang="python"><br />
robot.reconnect (address, port)<br />
</syntaxhighlight><br />
<br />
<br />
== Módulos == <br />
<br />
'''listarModulos:'''<br />
<br />
devuelve la lista de los modulos disponibles en el firmware de la placa<br />
<br />
<br />
<syntaxhighlight lang="python"><br />
modulos = robot.listarModulos()<br />
print modulos<br />
</syntaxhighlight><br />
<br />
<br />
'''abrirModulo:'''<br />
<br />
Apertura de modulos, abre el modulo "moduloname"<br />
<br />
<br />
<syntaxhighlight lang="python"><br />
robot.abrirModulo (moduloname)<br />
</syntaxhighlight><br />
<br />
<br />
'''llamarModulo:'''<br />
<br />
Operacion de llamada de una funcion de un modulo (CALL)<br />
<br />
<br />
<syntaxhighlight lang="python"><br />
robot.llamarModulo(modulename, function , params = "")<br />
</syntaxhighlight><br />
<br />
<br />
Para conocer la lista de funciones de un módulo y sus parametros puede ejecutarse en un terminal:<br><br />
<br><br />
<syntaxhighlight lang="text"><br />
telnet localhost 2009 <br />
DESCRIBE nombre_de_modulo<br />
</syntaxhighlight><br />
A futuro hay que exportar este servicio en la API<br><br />
<br />
<br />
== Funciones Varias ==<br />
<br />
'''isPresent'''<br />
<br />
Retorna si esta presente el modulo<br><br />
<br />
<br />
<syntaxhighlight lang="python"><br />
robot.isPresent (moduloname)<br />
</syntaxhighlight><br />
<br />
<br />
'''abrirLback'''<br />
<br />
Abrir módulo loopBack: modulo de ayuda presente en el butia (open)<br />
<br />
<br />
<syntaxhighlight lang="python"><br />
robot.abrirLback()<br />
datoRet = butiabot.loopBack("hola")<br />
</syntaxhighlight><br />
<br />
<br />
'''loopBack:'''<br />
<br />
envia un mensaje a la placa y espera recibir exactamente lo que fue enviado<br />
<br />
<br />
<syntaxhighlight lang="python"><br />
robot.loopBack(data)<br />
</syntaxhighlight><br />
<br />
<br />
== Motores ==<br />
<br />
Operaciones solicidatas al driver motores.lua <br />
<br />
<br />
'''abrirMotores:'''<br />
<br />
<syntaxhighlight lang="python"><br />
robot.abrirMotores()<br />
</syntaxhighlight><br />
<br />
<br />
'''setVelocidadMotores'''<br />
<br />
robot.setVelocidadMotores(self, sentidoIzq = "0", velIzq = "0", sentidoDer = "0", velDer = "0")<br />
<br />
<br />
sentido: 0: adelante, 1: atras<br />
velocidad: 0..1023 <br />
<br />
<br />
Detiene los 2 motores:<br />
<br />
<syntaxhighlight lang="python"><br />
robot.setVelocidadMotores("0", "0", "0", "0")<br />
</syntaxhighlight><br />
<br />
<br />
robot.setVelocidadMotores("0", "500", "1", "500") - gira a la izquierda<br />
<br />
robot.setVelocidadMotores("1", "500", "1", "500") - va hacia atrás<br />
<br />
robot.setVelocidadMotores("0", "500", "0", "500") - va hacia adelante<br />
<br />
robot.setVelocidadMotores("1", "500", "0", "500") - gira a la derecha<br />
<br />
<br />
<br />
<br />
<br />
'''setVelMotor'''<br />
<br />
robot.setVelMotor(self, idMotor = "0", sentido = "0", vel = "0")<br />
<br />
<br />
idMotor: 0: motor derecho, 1: motor izquierdo<br />
<br />
<br />
Va hacia adelante:<br />
<syntaxhighlight lang="python"><br />
robot.setVelMotor("1","1","500") <br />
robot.setVelMotor("0","1","500") <br />
</syntaxhighlight><br />
<br />
<br />
Va hacia atrás:<br />
<syntaxhighlight lang="python"><br />
robot.setVelMotor("1","0","500") <br />
robot.setVelMotor("0","0","500") <br />
</syntaxhighlight><br />
<br />
<br />
== Sensores ==<br />
<br />
Operaciones solicitadas al driver de los sensores<br />
<br />
<br />
'''abrirSensor()'''<br />
<br />
'''getValSenAnalog(pinAnalog = "0")'''<br />
<br />
'''getValSenDigital(pinDig = "0")'''<br />
<br />
<br />
<syntaxhighlight lang="python"><br />
butiabot.abrirSensor()<br />
sen1 = robot.getValSenAnalog("2")<br />
print sen1<br />
sen2 = robot.getValSenAnalog("4")<br />
print sen2<br />
sen3 = robot.getValSenDigital("5")<br />
print sen3<br />
</syntaxhighlight><br />
<br />
<br />
<br />
Operaciones solicitadas al driver boton<br />
<br />
abrirBoton(self)<br />
<br />
getBoton(self)<br />
<br />
getLuzAmbiente(self)<br />
<br />
getDistancia(self)<br />
<br />
getEscalaGris(self)<br />
<br />
getTemperature(self)<br />
<br />
getVibration(self)<br />
<br />
getTilt(self)<br />
<br />
getContactoCapacitivo(self)<br />
<br />
getInduccionMagnetica(self)<br />
<br />
setLed(self, nivel = 255)<br />
<br />
<br />
<br />
<br />
Operaciones solicitadas al modulo de la placa, driver butia.lua<br />
<br />
abrirButia()<br />
ping()<br />
<br />
<br />
== Carga de batería ==<br />
<br />
Esta operacion nos devuelve la carga aproximada del pack de pilas del robot con un error de 1 volt. <br />
<br />
'''getCargaBateria()'''<br />
<br />
<br />
<syntaxhighlight lang="python"><br />
carga = robot.getCargaBateria()<br />
print carga<br />
</syntaxhighlight></div>
Pbruccoleri
http://www.fing.edu.uy/inco/proyectos/butia/mediawiki/index.php?title=API&diff=516
API
2011-06-21T23:52:36Z
<p>Pbruccoleri: </p>
<hr />
<div>== API del Butiá ==<br />
<br />
Descripción de las funciones y algunos ejemplos.<br />
<br />
<br />
'''Instanciar la clase:'''<br />
<br />
<syntaxhighlight lang="python"><br />
robot = butiaAPI.robot()<br />
</syntaxhighlight><br />
<br />
<br />
'''Apertura:'''<br />
<br />
abrirButia<br />
<br />
<br />
<syntaxhighlight lang="python"><br />
robot.abrirButia()<br />
</syntaxhighlight><br />
<br />
<br />
'''Versión:'''<br />
<br />
getVersion<br />
Devuelve la versión del firmware de la placa con el que estamos trabajando <br />
<br />
<syntaxhighlight lang="python"><br />
ver = robot.getVersion()<br />
print ver<br />
</syntaxhighlight><br />
<br />
<br />
'''Cerrar:'''<br />
<br />
cerrar<br />
Cierra la comunicación con el servidor bobot<br />
<br />
<br />
<syntaxhighlight lang="python"><br />
robot.cerrar()<br />
</syntaxhighlight><br />
<br />
<br />
'''Conexión/Desconexión con el servidor:'''<br />
<br />
reconnect<br />
Conecta o Reconecta al bobot en address:port<br />
<br />
<br />
<syntaxhighlight lang="python"><br />
robot.reconnect (address, port)<br />
</syntaxhighlight><br />
<br />
<br />
== Módulos == <br />
<br />
'''listarModulos:'''<br />
<br />
devuelve la lista de los modulos disponibles en el firmware de la placa<br />
<br />
<br />
<syntaxhighlight lang="python"><br />
modulos = robot.listarModulos()<br />
print modulos<br />
</syntaxhighlight><br />
<br />
<br />
'''abrirModulo:'''<br />
<br />
Apertura de modulos, abre el modulo "moduloname"<br />
<br />
<br />
<syntaxhighlight lang="python"><br />
robot.abrirModulo (moduloname)<br />
</syntaxhighlight><br />
<br />
<br />
'''llamarModulo:'''<br />
<br />
Operacion de llamada de una funcion de un modulo (CALL)<br />
<br />
<br />
<syntaxhighlight lang="python"><br />
robot.llamarModulo(modulename, function , params = "")<br />
</syntaxhighlight><br />
<br />
<br />
Para conocer la lista de funciones de un módulo y sus parametros puede ejecutarse en un terminal:<br><br />
<br><br />
<syntaxhighlight lang="text"><br />
telnet localhost 2009 <br />
DESCRIBE nombre_de_modulo<br />
</syntaxhighlight><br />
A futuro hay que exportar este servicio en la API<br><br />
<br />
<br />
== Funciones Varias ==<br />
<br />
'''isPresent'''<br />
<br />
Retorna si esta presente el modulo<br><br />
<br />
<br />
<syntaxhighlight lang="python"><br />
robot.isPresent (moduloname)<br />
</syntaxhighlight><br />
<br />
<br />
'''abrirLback'''<br />
<br />
Abrir módulo loopBack: modulo de ayuda presente en el butia (open)<br />
<br />
<br />
<syntaxhighlight lang="python"><br />
robot.abrirLback()<br />
datoRet = butiabot.loopBack("hola")<br />
</syntaxhighlight><br />
<br />
<br />
'''loopBack:'''<br />
<br />
envia un mensaje a la placa y espera recibir exactamente lo que fue enviado<br />
<br />
<br />
<syntaxhighlight lang="python"><br />
robot.loopBack(data)<br />
</syntaxhighlight><br />
<br />
<br />
== Motores ==<br />
<br />
Operaciones solicidatas al driver motores.lua <br />
<br />
<br />
'''abrirMotores:'''<br />
<br />
<syntaxhighlight lang="python"><br />
robot.abrirMotores()<br />
</syntaxhighlight><br />
<br />
<br />
'''setVelocidadMotores'''<br />
<br />
robot.setVelocidadMotores(self, sentidoIzq = "0", velIzq = "0", sentidoDer = "0", velDer = "0")<br />
<br />
<br />
sentido: 0: adelante, 1: atras<br />
velocidad: 0..1023 <br />
<br />
<br />
Detiene los 2 motores:<br />
<br />
<syntaxhighlight lang="python"><br />
robot.setVelocidadMotores("0", "0", "0", "0")<br />
</syntaxhighlight><br />
<br />
<br />
robot.setVelocidadMotores("0", "500", "1", "500") - gira a la izquierda<br />
<br />
robot.setVelocidadMotores("1", "500", "1", "500") - va hacia atrás<br />
<br />
robot.setVelocidadMotores("0", "500", "0", "500") - va hacia adelante<br />
<br />
robot.setVelocidadMotores("1", "500", "0", "500") - gira a la derecha<br />
<br />
<br />
<br />
<br />
<br />
'''setVelMotor'''<br />
<br />
robot.setVelMotor(self, idMotor = "0", sentido = "0", vel = "0")<br />
<br />
<br />
idMotor: 0: motor derecho, 1: motor izquierdo<br />
<br />
<br />
Va hacia adelante:<br />
<syntaxhighlight lang="python"><br />
robot.setVelMotor("1","1","500") <br />
robot.setVelMotor("0","1","500") <br />
</syntaxhighlight><br />
<br />
<br />
Va hacia atrás:<br />
<syntaxhighlight lang="python"><br />
robot.setVelMotor("1","0","500") <br />
robot.setVelMotor("0","0","500") <br />
</syntaxhighlight><br />
<br />
<br />
== Sensores ==<br />
<br />
Operaciones solicitadas al driver de los sensores<br />
<br />
<br />
'''abrirSensor()'''<br />
<br />
'''getValSenAnalog(pinAnalog = "0")'''<br />
<br />
'''getValSenDigital(pinDig = "0")'''<br />
<br />
<br />
<syntaxhighlight lang="python"><br />
butiabot.abrirSensor()<br />
sen1 = robot.getValSenAnalog("2")<br />
print sen1<br />
sen2 = robot.getValSenAnalog("4")<br />
print sen2<br />
sen3 = robot.getValSenDigital("5")<br />
print sen3<br />
</syntaxhighlight><br />
<br />
<br />
<br />
Operaciones solicitadas al driver boton<br />
<br />
abrirBoton(self)<br />
<br />
getBoton(self)<br />
<br />
getLuzAmbiente(self)<br />
<br />
getDistancia(self)<br />
<br />
getEscalaGris(self)<br />
<br />
getTemperature(self)<br />
<br />
getVibration(self)<br />
<br />
getTilt(self)<br />
<br />
getContactoCapacitivo(self)<br />
<br />
getInduccionMagnetica(self)<br />
<br />
setLed(self, nivel = 255)<br />
<br />
<br />
<br />
<br />
Operaciones solicitadas al modulo de la placa, driver butia.lua<br />
<br />
abrirButia()<br />
ping()<br />
<br />
<br />
== Carga de batería ==<br />
<br />
Esta operacion nos devuelve la carga aproximada del pack de pilas del robot con un error de 1 volt. <br />
<br />
'''getCargaBateria()'''<br />
<br />
<br />
<syntaxhighlight lang="python"><br />
carga = robot.getCargaBateria()<br />
print carga<br />
</syntaxhighlight><br />
<br />
<br />
<br />
setVelocidad3(velIzq = 0, velDer = 0)<br />
<br />
setPosicion(idMotor = 0, angulo = 0)</div>
Pbruccoleri
http://www.fing.edu.uy/inco/proyectos/butia/mediawiki/index.php?title=API&diff=515
API
2011-06-21T23:51:11Z
<p>Pbruccoleri: /* Motores */</p>
<hr />
<div>== API del Butiá ==<br />
<br />
Descripción de las funciones y algunos ejemplos.<br />
<br />
<br />
'''Instanciar la clase:'''<br />
<br />
<syntaxhighlight lang="python"><br />
robot = butiaAPI.robot()<br />
</syntaxhighlight><br />
<br />
<br />
'''Apertura:'''<br />
<br />
abrirButia<br />
<br />
<br />
<syntaxhighlight lang="python"><br />
robot.abrirButia()<br />
</syntaxhighlight><br />
<br />
<br />
'''Versión:'''<br />
<br />
getVersion<br />
Devuelve la versión del firmware de la placa con el que estamos trabajando <br />
<br />
<syntaxhighlight lang="python"><br />
ver = robot.getVersion()<br />
print ver<br />
</syntaxhighlight><br />
<br />
<br />
'''Cerrar:'''<br />
<br />
cerrar<br />
Cierra la comunicación con el servidor bobot<br />
<br />
<br />
<syntaxhighlight lang="python"><br />
robot.cerrar()<br />
</syntaxhighlight><br />
<br />
<br />
'''Conexión/Desconexión con el servidor:'''<br />
<br />
reconnect<br />
Conecta o Reconecta al bobot en address:port<br />
<br />
<br />
<syntaxhighlight lang="python"><br />
robot.reconnect (address, port)<br />
</syntaxhighlight><br />
<br />
<br />
== Módulos == <br />
<br />
'''listarModulos:'''<br />
<br />
devuelve la lista de los modulos disponibles en el firmware de la placa<br />
<br />
<br />
<syntaxhighlight lang="python"><br />
modulos = robot.listarModulos()<br />
print modulos<br />
</syntaxhighlight><br />
<br />
<br />
'''abrirModulo:'''<br />
<br />
Apertura de modulos, abre el modulo "moduloname"<br />
<br />
<br />
<syntaxhighlight lang="python"><br />
robot.abrirModulo (moduloname)<br />
</syntaxhighlight><br />
<br />
<br />
'''llamarModulo:'''<br />
<br />
Operacion de llamada de una funcion de un modulo (CALL)<br />
<br />
<br />
<syntaxhighlight lang="python"><br />
robot.llamarModulo(modulename, function , params = "")<br />
</syntaxhighlight><br />
<br />
<br />
Para conocer la lista de funciones de un módulo y sus parametros puede ejecutarse en un terminal:<br><br />
<br><br />
<syntaxhighlight lang="text"><br />
telnet localhost 2009 <br />
DESCRIBE nombre_de_modulo<br />
</syntaxhighlight><br />
A futuro hay que exportar este servicio en la API<br><br />
<br />
<br />
== Funciones Varias ==<br />
<br />
'''isPresent'''<br />
<br />
Retorna si esta presente el modulo<br><br />
<br />
<br />
<syntaxhighlight lang="python"><br />
robot.isPresent (moduloname)<br />
</syntaxhighlight><br />
<br />
<br />
'''abrirLback'''<br />
<br />
Abrir módulo loopBack: modulo de ayuda presente en el butia (open)<br />
<br />
<br />
<syntaxhighlight lang="python"><br />
robot.abrirLback()<br />
datoRet = butiabot.loopBack("hola")<br />
</syntaxhighlight><br />
<br />
<br />
'''loopBack:'''<br />
<br />
envia un mensaje a la placa y espera recibir exactamente lo que fue enviado<br />
<br />
<br />
<syntaxhighlight lang="python"><br />
robot.loopBack(data)<br />
</syntaxhighlight><br />
<br />
<br />
== Motores ==<br />
<br />
Operaciones solicidatas al driver motores.lua <br />
<br />
<br />
'''abrirMotores:'''<br />
<br />
<syntaxhighlight lang="python"><br />
robot.abrirMotores()<br />
</syntaxhighlight><br />
<br />
<br />
'''setVelocidadMotores'''<br />
<br />
robot.setVelocidadMotores(self, sentidoIzq = "0", velIzq = "0", sentidoDer = "0", velDer = "0")<br />
<br />
<br />
sentido: 0: adelante, 1: atras<br />
velocidad: 0..1023 <br />
<br />
<br />
Detiene los 2 motores:<br />
<br />
<syntaxhighlight lang="python"><br />
robot.setVelocidadMotores("0", "0", "0", "0")<br />
</syntaxhighlight><br />
<br />
<br />
robot.setVelocidadMotores("0", "500", "1", "500") - gira a la izquierda<br />
<br />
robot.setVelocidadMotores("1", "500", "1", "500") - va hacia atrás<br />
<br />
robot.setVelocidadMotores("0", "500", "0", "500") - va hacia adelante<br />
<br />
robot.setVelocidadMotores("1", "500", "0", "500") - gira a la derecha<br />
<br />
<br />
<br />
<br />
<br />
'''setVelMotor'''<br />
<br />
robot.setVelMotor(self, idMotor = "0", sentido = "0", vel = "0")<br />
<br />
<br />
idMotor: 0: motor derecho, 1: motor izquierdo<br />
<br />
<br />
Va hacia adelante:<br />
<syntaxhighlight lang="python"><br />
robot.setVelMotor("1","1","500") <br />
robot.setVelMotor("0","1","500") <br />
</syntaxhighlight><br />
<br />
<br />
Va hacia atrás:<br />
<syntaxhighlight lang="python"><br />
robot.setVelMotor("1","0","500") <br />
robot.setVelMotor("0","0","500") <br />
</syntaxhighlight><br />
<br />
== Sensores ==<br />
<br />
Operaciones solicitadas al driver de los sensores<br />
<br />
<br />
'''abrirSensor()'''<br />
<br />
'''getValSenAnalog(pinAnalog = "0")'''<br />
<br />
'''getValSenDigital(pinDig = "0")'''<br />
<br />
<br />
<syntaxhighlight lang="python"><br />
butiabot.abrirSensor()<br />
sen1 = robot.getValSenAnalog("2")<br />
print sen1<br />
sen2 = robot.getValSenAnalog("4")<br />
print sen2<br />
sen3 = robot.getValSenDigital("5")<br />
print sen3<br />
</syntaxhighlight><br />
<br />
<br />
Operaciones solicitadas al modulo de la placa, driver butia.lua<br />
<br />
abrirButia()<br />
ping()<br />
<br />
<br />
== Carga de batería ==<br />
<br />
Esta operacion nos devuelve la carga aproximada del pack de pilas del robot con un error de 1 volt. <br />
<br />
'''getCargaBateria()'''<br />
<br />
<br />
<syntaxhighlight lang="python"><br />
carga = robot.getCargaBateria()<br />
print carga<br />
</syntaxhighlight><br />
<br />
<br />
<br />
setVelocidad3(velIzq = 0, velDer = 0)<br />
<br />
setPosicion(idMotor = 0, angulo = 0)<br />
<br />
<br />
<br />
<br />
Operaciones solicitadas al driver boton<br />
<br />
abrirBoton(self)<br />
<br />
getBoton(self)<br />
<br />
getLuzAmbiente(self)<br />
<br />
getDistancia(self)<br />
<br />
getEscalaGris(self)<br />
<br />
getTemperature(self)<br />
<br />
getVibration(self)<br />
<br />
getTilt(self)<br />
<br />
getContactoCapacitivo(self)<br />
<br />
getInduccionMagnetica(self)<br />
<br />
setLed(self, nivel = 255)</div>
Pbruccoleri
http://www.fing.edu.uy/inco/proyectos/butia/mediawiki/index.php?title=API&diff=514
API
2011-06-21T23:50:18Z
<p>Pbruccoleri: /* Motores */</p>
<hr />
<div>== API del Butiá ==<br />
<br />
Descripción de las funciones y algunos ejemplos.<br />
<br />
<br />
'''Instanciar la clase:'''<br />
<br />
<syntaxhighlight lang="python"><br />
robot = butiaAPI.robot()<br />
</syntaxhighlight><br />
<br />
<br />
'''Apertura:'''<br />
<br />
abrirButia<br />
<br />
<br />
<syntaxhighlight lang="python"><br />
robot.abrirButia()<br />
</syntaxhighlight><br />
<br />
<br />
'''Versión:'''<br />
<br />
getVersion<br />
Devuelve la versión del firmware de la placa con el que estamos trabajando <br />
<br />
<syntaxhighlight lang="python"><br />
ver = robot.getVersion()<br />
print ver<br />
</syntaxhighlight><br />
<br />
<br />
'''Cerrar:'''<br />
<br />
cerrar<br />
Cierra la comunicación con el servidor bobot<br />
<br />
<br />
<syntaxhighlight lang="python"><br />
robot.cerrar()<br />
</syntaxhighlight><br />
<br />
<br />
'''Conexión/Desconexión con el servidor:'''<br />
<br />
reconnect<br />
Conecta o Reconecta al bobot en address:port<br />
<br />
<br />
<syntaxhighlight lang="python"><br />
robot.reconnect (address, port)<br />
</syntaxhighlight><br />
<br />
<br />
== Módulos == <br />
<br />
'''listarModulos:'''<br />
<br />
devuelve la lista de los modulos disponibles en el firmware de la placa<br />
<br />
<br />
<syntaxhighlight lang="python"><br />
modulos = robot.listarModulos()<br />
print modulos<br />
</syntaxhighlight><br />
<br />
<br />
'''abrirModulo:'''<br />
<br />
Apertura de modulos, abre el modulo "moduloname"<br />
<br />
<br />
<syntaxhighlight lang="python"><br />
robot.abrirModulo (moduloname)<br />
</syntaxhighlight><br />
<br />
<br />
'''llamarModulo:'''<br />
<br />
Operacion de llamada de una funcion de un modulo (CALL)<br />
<br />
<br />
<syntaxhighlight lang="python"><br />
robot.llamarModulo(modulename, function , params = "")<br />
</syntaxhighlight><br />
<br />
<br />
Para conocer la lista de funciones de un módulo y sus parametros puede ejecutarse en un terminal:<br><br />
<br><br />
<syntaxhighlight lang="text"><br />
telnet localhost 2009 <br />
DESCRIBE nombre_de_modulo<br />
</syntaxhighlight><br />
A futuro hay que exportar este servicio en la API<br><br />
<br />
<br />
== Funciones Varias ==<br />
<br />
'''isPresent'''<br />
<br />
Retorna si esta presente el modulo<br><br />
<br />
<br />
<syntaxhighlight lang="python"><br />
robot.isPresent (moduloname)<br />
</syntaxhighlight><br />
<br />
<br />
'''abrirLback'''<br />
<br />
Abrir módulo loopBack: modulo de ayuda presente en el butia (open)<br />
<br />
<br />
<syntaxhighlight lang="python"><br />
robot.abrirLback()<br />
datoRet = butiabot.loopBack("hola")<br />
</syntaxhighlight><br />
<br />
<br />
'''loopBack:'''<br />
<br />
envia un mensaje a la placa y espera recibir exactamente lo que fue enviado<br />
<br />
<br />
<syntaxhighlight lang="python"><br />
robot.loopBack(data)<br />
</syntaxhighlight><br />
<br />
<br />
== Motores ==<br />
<br />
Operaciones solicidatas al driver motores.lua <br />
<br />
<br />
'''abrirMotores:'''<br />
<br />
<syntaxhighlight lang="python"><br />
robot.abrirMotores()<br />
</syntaxhighlight><br />
<br />
<br />
'''setVelocidadMotores'''<br />
<br />
robot.setVelocidadMotores(self, sentidoIzq = "0", velIzq = "0", sentidoDer = "0", velDer = "0")<br />
<br />
<br />
sentido: 0: adelante, 1: atras<br />
velocidad: 0..1023 <br />
<br />
<br />
Detiene los 2 motores:<br />
<br />
<syntaxhighlight lang="python"><br />
robot.setVelocidadMotores("0", "0", "0", "0")<br />
</syntaxhighlight><br />
<br />
<br />
robot.setVelocidadMotores("0", "500", "1", "500") - gira a la izquierda<br />
<br />
robot.setVelocidadMotores("1", "500", "1", "500") - va hacia atrás<br />
<br />
robot.setVelocidadMotores("0", "500", "0", "500") - va hacia adelante<br />
<br />
robot.setVelocidadMotores("1", "500", "0", "500") - gira a la derecha<br />
<br />
<br />
<br />
<br />
<br />
'''setVelMotor'''<br />
<br />
robot.setVelMotor(self, idMotor = "0", sentido = "0", vel = "0")<br />
<br />
<br />
idMotor: 0: motor derecho, 1: motor izquierdo<br />
<br />
Va hacia adelante:<br />
<syntaxhighlight lang="python"><br />
robot.setVelMotor("1","1","500") <br />
robot.setVelMotor("0","1","500") <br />
</syntaxhighlight><br />
<br />
== Sensores ==<br />
<br />
Operaciones solicitadas al driver de los sensores<br />
<br />
<br />
'''abrirSensor()'''<br />
<br />
'''getValSenAnalog(pinAnalog = "0")'''<br />
<br />
'''getValSenDigital(pinDig = "0")'''<br />
<br />
<br />
<syntaxhighlight lang="python"><br />
butiabot.abrirSensor()<br />
sen1 = robot.getValSenAnalog("2")<br />
print sen1<br />
sen2 = robot.getValSenAnalog("4")<br />
print sen2<br />
sen3 = robot.getValSenDigital("5")<br />
print sen3<br />
</syntaxhighlight><br />
<br />
<br />
Operaciones solicitadas al modulo de la placa, driver butia.lua<br />
<br />
abrirButia()<br />
ping()<br />
<br />
<br />
== Carga de batería ==<br />
<br />
Esta operacion nos devuelve la carga aproximada del pack de pilas del robot con un error de 1 volt. <br />
<br />
'''getCargaBateria()'''<br />
<br />
<br />
<syntaxhighlight lang="python"><br />
carga = robot.getCargaBateria()<br />
print carga<br />
</syntaxhighlight><br />
<br />
<br />
<br />
setVelocidad3(velIzq = 0, velDer = 0)<br />
<br />
setPosicion(idMotor = 0, angulo = 0)<br />
<br />
<br />
<br />
<br />
Operaciones solicitadas al driver boton<br />
<br />
abrirBoton(self)<br />
<br />
getBoton(self)<br />
<br />
getLuzAmbiente(self)<br />
<br />
getDistancia(self)<br />
<br />
getEscalaGris(self)<br />
<br />
getTemperature(self)<br />
<br />
getVibration(self)<br />
<br />
getTilt(self)<br />
<br />
getContactoCapacitivo(self)<br />
<br />
getInduccionMagnetica(self)<br />
<br />
setLed(self, nivel = 255)</div>
Pbruccoleri
http://www.fing.edu.uy/inco/proyectos/butia/mediawiki/index.php?title=API&diff=513
API
2011-06-21T23:45:45Z
<p>Pbruccoleri: </p>
<hr />
<div>== API del Butiá ==<br />
<br />
Descripción de las funciones y algunos ejemplos.<br />
<br />
<br />
'''Instanciar la clase:'''<br />
<br />
<syntaxhighlight lang="python"><br />
robot = butiaAPI.robot()<br />
</syntaxhighlight><br />
<br />
<br />
'''Apertura:'''<br />
<br />
abrirButia<br />
<br />
<br />
<syntaxhighlight lang="python"><br />
robot.abrirButia()<br />
</syntaxhighlight><br />
<br />
<br />
'''Versión:'''<br />
<br />
getVersion<br />
Devuelve la versión del firmware de la placa con el que estamos trabajando <br />
<br />
<syntaxhighlight lang="python"><br />
ver = robot.getVersion()<br />
print ver<br />
</syntaxhighlight><br />
<br />
<br />
'''Cerrar:'''<br />
<br />
cerrar<br />
Cierra la comunicación con el servidor bobot<br />
<br />
<br />
<syntaxhighlight lang="python"><br />
robot.cerrar()<br />
</syntaxhighlight><br />
<br />
<br />
'''Conexión/Desconexión con el servidor:'''<br />
<br />
reconnect<br />
Conecta o Reconecta al bobot en address:port<br />
<br />
<br />
<syntaxhighlight lang="python"><br />
robot.reconnect (address, port)<br />
</syntaxhighlight><br />
<br />
<br />
== Módulos == <br />
<br />
'''listarModulos:'''<br />
<br />
devuelve la lista de los modulos disponibles en el firmware de la placa<br />
<br />
<br />
<syntaxhighlight lang="python"><br />
modulos = robot.listarModulos()<br />
print modulos<br />
</syntaxhighlight><br />
<br />
<br />
'''abrirModulo:'''<br />
<br />
Apertura de modulos, abre el modulo "moduloname"<br />
<br />
<br />
<syntaxhighlight lang="python"><br />
robot.abrirModulo (moduloname)<br />
</syntaxhighlight><br />
<br />
<br />
'''llamarModulo:'''<br />
<br />
Operacion de llamada de una funcion de un modulo (CALL)<br />
<br />
<br />
<syntaxhighlight lang="python"><br />
robot.llamarModulo(modulename, function , params = "")<br />
</syntaxhighlight><br />
<br />
<br />
Para conocer la lista de funciones de un módulo y sus parametros puede ejecutarse en un terminal:<br><br />
<br><br />
<syntaxhighlight lang="text"><br />
telnet localhost 2009 <br />
DESCRIBE nombre_de_modulo<br />
</syntaxhighlight><br />
A futuro hay que exportar este servicio en la API<br><br />
<br />
<br />
== Funciones Varias ==<br />
<br />
'''isPresent'''<br />
<br />
Retorna si esta presente el modulo<br><br />
<br />
<br />
<syntaxhighlight lang="python"><br />
robot.isPresent (moduloname)<br />
</syntaxhighlight><br />
<br />
<br />
'''abrirLback'''<br />
<br />
Abrir módulo loopBack: modulo de ayuda presente en el butia (open)<br />
<br />
<br />
<syntaxhighlight lang="python"><br />
robot.abrirLback()<br />
datoRet = butiabot.loopBack("hola")<br />
</syntaxhighlight><br />
<br />
<br />
'''loopBack:'''<br />
<br />
envia un mensaje a la placa y espera recibir exactamente lo que fue enviado<br />
<br />
<br />
<syntaxhighlight lang="python"><br />
robot.loopBack(data)<br />
</syntaxhighlight><br />
<br />
<br />
== Motores ==<br />
<br />
Operaciones solicidatas al driver motores.lua <br />
<br />
<br />
'''abrirMotores:'''<br />
<br />
<syntaxhighlight lang="python"><br />
robot.abrirMotores()<br />
</syntaxhighlight><br />
<br />
<br />
'''setVelocidadMotores'''<br />
<br />
robot.setVelocidadMotores(self, sentidoIzq = "0", velIzq = "0", sentidoDer = "0", velDer = "0")<br />
<br />
sentido: 0: adelante, 1: atras<br />
velocidad: 0..1023 <br />
<br />
Detiene los 2 motores:<br />
<br />
<syntaxhighlight lang="python"><br />
robot.setVelocidadMotores("0", "0", "0", "0")<br />
</syntaxhighlight><br />
<br />
<br />
robot.setVelocidadMotores("0", "500", "1", "500") - gira a la izquierda<br />
<br />
robot.setVelocidadMotores("1", "500", "1", "500") - va hacia atrás<br />
<br />
robot.setVelocidadMotores("0", "500", "0", "500") - va hacia adelante<br />
<br />
robot.setVelocidadMotores("1", "500", "0", "500") - gira a la derecha<br />
<br />
<br />
<br />
<br />
<br />
'''setVelMotor'''<br />
<br />
robot.setVelMotor(self, idMotor = "0", sentido = "0", vel = "0")<br />
<br />
<br />
<br />
<br />
<br />
== Sensores ==<br />
<br />
Operaciones solicitadas al driver de los sensores<br />
<br />
<br />
'''abrirSensor()'''<br />
<br />
'''getValSenAnalog(pinAnalog = "0")'''<br />
<br />
'''getValSenDigital(pinDig = "0")'''<br />
<br />
<br />
<syntaxhighlight lang="python"><br />
butiabot.abrirSensor()<br />
sen1 = robot.getValSenAnalog("2")<br />
print sen1<br />
sen2 = robot.getValSenAnalog("4")<br />
print sen2<br />
sen3 = robot.getValSenDigital("5")<br />
print sen3<br />
</syntaxhighlight><br />
<br />
<br />
Operaciones solicitadas al modulo de la placa, driver butia.lua<br />
<br />
abrirButia()<br />
ping()<br />
<br />
<br />
== Carga de batería ==<br />
<br />
Esta operacion nos devuelve la carga aproximada del pack de pilas del robot con un error de 1 volt. <br />
<br />
'''getCargaBateria()'''<br />
<br />
<br />
<syntaxhighlight lang="python"><br />
carga = robot.getCargaBateria()<br />
print carga<br />
</syntaxhighlight><br />
<br />
<br />
<br />
setVelocidad3(velIzq = 0, velDer = 0)<br />
<br />
setPosicion(idMotor = 0, angulo = 0)<br />
<br />
<br />
<br />
<br />
Operaciones solicitadas al driver boton<br />
<br />
abrirBoton(self)<br />
<br />
getBoton(self)<br />
<br />
getLuzAmbiente(self)<br />
<br />
getDistancia(self)<br />
<br />
getEscalaGris(self)<br />
<br />
getTemperature(self)<br />
<br />
getVibration(self)<br />
<br />
getTilt(self)<br />
<br />
getContactoCapacitivo(self)<br />
<br />
getInduccionMagnetica(self)<br />
<br />
setLed(self, nivel = 255)</div>
Pbruccoleri
http://www.fing.edu.uy/inco/proyectos/butia/mediawiki/index.php?title=API&diff=512
API
2011-06-21T23:36:06Z
<p>Pbruccoleri: /* Módulos */</p>
<hr />
<div>== API del Butiá ==<br />
<br />
Descripción de las funciones y algunos ejemplos.<br />
<br />
<br />
'''Instanciar la clase:'''<br />
<br />
<syntaxhighlight lang="python"><br />
robot = butiaAPI.robot()<br />
</syntaxhighlight><br />
<br />
<br />
'''Apertura:'''<br />
<br />
abrirButia<br />
<br />
<br />
<syntaxhighlight lang="python"><br />
robot.abrirButia()<br />
</syntaxhighlight><br />
<br />
<br />
'''Versión:'''<br />
<br />
getVersion<br />
Devuelve la versión del firmware de la placa con el que estamos trabajando <br />
<br />
<syntaxhighlight lang="python"><br />
ver = robot.getVersion()<br />
print ver<br />
</syntaxhighlight><br />
<br />
<br />
'''Cerrar:'''<br />
<br />
cerrar<br />
Cierra la comunicación con el servidor bobot<br />
<br />
<br />
<syntaxhighlight lang="python"><br />
robot.cerrar()<br />
</syntaxhighlight><br />
<br />
<br />
'''Conexión/Desconexión con el servidor:'''<br />
<br />
reconnect<br />
Conecta o Reconecta al bobot en address:port<br />
<br />
<br />
<syntaxhighlight lang="python"><br />
robot.reconnect (address, port)<br />
</syntaxhighlight><br />
<br />
<br />
== Módulos == <br />
<br />
'''listarModulos:'''<br />
<br />
devuelve la lista de los modulos disponibles en el firmware de la placa<br />
<br />
<br />
<syntaxhighlight lang="python"><br />
modulos = robot.listarModulos()<br />
print modulos<br />
</syntaxhighlight><br />
<br />
<br />
'''abrirModulo:'''<br />
<br />
Apertura de modulos, abre el modulo "moduloname"<br />
<br />
<br />
<syntaxhighlight lang="python"><br />
robot.abrirModulo (moduloname)<br />
</syntaxhighlight><br />
<br />
<br />
'''llamarModulo:'''<br />
<br />
Operacion de llamada de una funcion de un modulo (CALL)<br />
<br />
<br />
<syntaxhighlight lang="python"><br />
robot.llamarModulo(modulename, function , params = "")<br />
</syntaxhighlight><br />
<br />
<br />
Para conocer la lista de funciones de un módulo y sus parametros puede ejecutarse en un terminal:<br><br />
<br><br />
<syntaxhighlight lang="text"><br />
telnet localhost 2009 <br />
DESCRIBE nombre_de_modulo<br />
</syntaxhighlight><br />
A futuro hay que exportar este servicio en la API<br><br />
<br />
== Funciones Varias ==<br />
<br />
'''isPresent'''<br />
<br />
Retorna si esta presente el modulo<br><br />
<br />
<br />
<syntaxhighlight lang="python"><br />
robot.isPresent (moduloname)<br />
</syntaxhighlight><br />
<br />
<br />
'''abrirLback'''<br />
<br />
Abrir módulo loopBack: modulo de ayuda presente en el butia (open)<br />
<br />
<br />
<syntaxhighlight lang="python"><br />
robot.abrirLback()<br />
datoRet = butiabot.loopBack("hola")<br />
</syntaxhighlight><br />
<br />
<br />
'''loopBack:'''<br />
<br />
envia un mensaje a la placa y espera recibir exactamente lo que fue enviado<br />
<br />
<br />
<syntaxhighlight lang="python"><br />
robot.loopBack(data)<br />
</syntaxhighlight><br />
<br />
<br />
== Motores ==<br />
<br />
Operaciones solicidatas al driver motores.lua <br />
<br />
<br />
'''abrirMotores:'''<br />
<br />
<syntaxhighlight lang="python"><br />
robot.abrirMotores()<br />
robot.setVelocidadMotores(self, sentidoIzq = "0", velIzq = "0", sentidoDer = "0", velDer = "0")<br />
robot.setVelMotor(self, idMotor = "0", sentido = "0", vel = "0")<br />
<br />
<br />
<br />
<br />
== Sensores ==<br />
<br />
Operaciones solicitadas al driver de los sensores<br />
<br />
<br />
'''abrirSensor()'''<br />
<br />
'''getValSenAnalog(pinAnalog = "0")'''<br />
<br />
'''getValSenDigital(pinDig = "0")'''<br />
<br />
<br />
<syntaxhighlight lang="python"><br />
butiabot.abrirSensor()<br />
sen1 = robot.getValSenAnalog("2")<br />
print sen1<br />
sen2 = robot.getValSenAnalog("4")<br />
print sen2<br />
sen3 = robot.getValSenDigital("5")<br />
print sen3<br />
</syntaxhighlight><br />
<br />
<br />
Operaciones solicitadas al modulo de la placa, driver butia.lua<br />
<br />
abrirButia()<br />
ping()<br />
<br />
<br />
== Carga de batería ==<br />
<br />
Esta operacion nos devuelve la carga aproximada del pack de pilas del robot con un error de 1 volt. <br />
<br />
'''getCargaBateria()'''<br />
<br />
<br />
<syntaxhighlight lang="python"><br />
carga = robot.getCargaBateria()<br />
print carga<br />
</syntaxhighlight><br />
<br />
<br />
<br />
setVelocidad3(velIzq = 0, velDer = 0)<br />
<br />
setPosicion(idMotor = 0, angulo = 0)<br />
<br />
<br />
<br />
<br />
Operaciones solicitadas al driver boton<br />
<br />
abrirBoton(self)<br />
<br />
getBoton(self)<br />
<br />
getLuzAmbiente(self)<br />
<br />
getDistancia(self)<br />
<br />
getEscalaGris(self)<br />
<br />
getTemperature(self)<br />
<br />
getVibration(self)<br />
<br />
getTilt(self)<br />
<br />
getContactoCapacitivo(self)<br />
<br />
getInduccionMagnetica(self)<br />
<br />
setLed(self, nivel = 255)</div>
Pbruccoleri
http://www.fing.edu.uy/inco/proyectos/butia/mediawiki/index.php?title=API&diff=511
API
2011-06-21T23:35:09Z
<p>Pbruccoleri: </p>
<hr />
<div>== API del Butiá ==<br />
<br />
Descripción de las funciones y algunos ejemplos.<br />
<br />
<br />
'''Instanciar la clase:'''<br />
<br />
<syntaxhighlight lang="python"><br />
robot = butiaAPI.robot()<br />
</syntaxhighlight><br />
<br />
<br />
'''Apertura:'''<br />
<br />
abrirButia<br />
<br />
<br />
<syntaxhighlight lang="python"><br />
robot.abrirButia()<br />
</syntaxhighlight><br />
<br />
<br />
'''Versión:'''<br />
<br />
getVersion<br />
Devuelve la versión del firmware de la placa con el que estamos trabajando <br />
<br />
<syntaxhighlight lang="python"><br />
ver = robot.getVersion()<br />
print ver<br />
</syntaxhighlight><br />
<br />
<br />
'''Cerrar:'''<br />
<br />
cerrar<br />
Cierra la comunicación con el servidor bobot<br />
<br />
<br />
<syntaxhighlight lang="python"><br />
robot.cerrar()<br />
</syntaxhighlight><br />
<br />
<br />
'''Conexión/Desconexión con el servidor:'''<br />
<br />
reconnect<br />
Conecta o Reconecta al bobot en address:port<br />
<br />
<br />
<syntaxhighlight lang="python"><br />
robot.reconnect (address, port)<br />
</syntaxhighlight><br />
<br />
<br />
== Módulos == <br />
<br />
'''listarModulos:'''<br />
<br />
devuelve la lista de los modulos disponibles en el firmware de la placa<br />
<br />
<br />
<syntaxhighlight lang="python"><br />
modulos = robot.listarModulos()<br />
print modulos<br />
</syntaxhighlight><br />
<br />
<br />
'''abrirModulo:'''<br />
<br />
Apertura de modulos, abre el modulo "moduloname"<br />
<br />
<syntaxhighlight lang="python"><br />
robot.abrirModulo (moduloname)<br />
</syntaxhighlight><br />
<br />
<br />
'''llamarModulo:'''<br />
<br />
Operacion de llamada de una funcion de un modulo (CALL)<br />
<br />
<syntaxhighlight lang="python"><br />
robot.llamarModulo(modulename, function , params = "")<br />
</syntaxhighlight><br />
<br />
<br />
Para conocer la lista de funciones de un módulo y sus parametros puede ejecutarse en un terminal:<br><br />
<br><br />
<syntaxhighlight lang="text"><br />
telnet localhost 2009 <br />
DESCRIBE nombre_de_modulo<br />
</syntaxhighlight><br />
A futuro hay que exportar este servicio en la API<br><br />
<br />
<br />
== Funciones Varias ==<br />
<br />
'''isPresent'''<br />
<br />
Retorna si esta presente el modulo<br><br />
<br />
<br />
<syntaxhighlight lang="python"><br />
robot.isPresent (moduloname)<br />
</syntaxhighlight><br />
<br />
<br />
'''abrirLback'''<br />
<br />
Abrir módulo loopBack: modulo de ayuda presente en el butia (open)<br />
<br />
<br />
<syntaxhighlight lang="python"><br />
robot.abrirLback()<br />
datoRet = butiabot.loopBack("hola")<br />
</syntaxhighlight><br />
<br />
<br />
'''loopBack:'''<br />
<br />
envia un mensaje a la placa y espera recibir exactamente lo que fue enviado<br />
<br />
<br />
<syntaxhighlight lang="python"><br />
robot.loopBack(data)<br />
</syntaxhighlight><br />
<br />
<br />
== Motores ==<br />
<br />
Operaciones solicidatas al driver motores.lua <br />
<br />
<br />
'''abrirMotores:'''<br />
<br />
<syntaxhighlight lang="python"><br />
robot.abrirMotores()<br />
robot.setVelocidadMotores(self, sentidoIzq = "0", velIzq = "0", sentidoDer = "0", velDer = "0")<br />
robot.setVelMotor(self, idMotor = "0", sentido = "0", vel = "0")<br />
<br />
<br />
<br />
<br />
== Sensores ==<br />
<br />
Operaciones solicitadas al driver de los sensores<br />
<br />
<br />
'''abrirSensor()'''<br />
<br />
'''getValSenAnalog(pinAnalog = "0")'''<br />
<br />
'''getValSenDigital(pinDig = "0")'''<br />
<br />
<br />
<syntaxhighlight lang="python"><br />
butiabot.abrirSensor()<br />
sen1 = robot.getValSenAnalog("2")<br />
print sen1<br />
sen2 = robot.getValSenAnalog("4")<br />
print sen2<br />
sen3 = robot.getValSenDigital("5")<br />
print sen3<br />
</syntaxhighlight><br />
<br />
<br />
Operaciones solicitadas al modulo de la placa, driver butia.lua<br />
<br />
abrirButia()<br />
ping()<br />
<br />
<br />
== Carga de batería ==<br />
<br />
Esta operacion nos devuelve la carga aproximada del pack de pilas del robot con un error de 1 volt. <br />
<br />
'''getCargaBateria()'''<br />
<br />
<br />
<syntaxhighlight lang="python"><br />
carga = robot.getCargaBateria()<br />
print carga<br />
</syntaxhighlight><br />
<br />
<br />
<br />
setVelocidad3(velIzq = 0, velDer = 0)<br />
<br />
setPosicion(idMotor = 0, angulo = 0)<br />
<br />
<br />
<br />
<br />
Operaciones solicitadas al driver boton<br />
<br />
abrirBoton(self)<br />
<br />
getBoton(self)<br />
<br />
getLuzAmbiente(self)<br />
<br />
getDistancia(self)<br />
<br />
getEscalaGris(self)<br />
<br />
getTemperature(self)<br />
<br />
getVibration(self)<br />
<br />
getTilt(self)<br />
<br />
getContactoCapacitivo(self)<br />
<br />
getInduccionMagnetica(self)<br />
<br />
setLed(self, nivel = 255)</div>
Pbruccoleri
http://www.fing.edu.uy/inco/proyectos/butia/mediawiki/index.php?title=API&diff=510
API
2011-06-21T23:34:09Z
<p>Pbruccoleri: </p>
<hr />
<div>== API del Butiá ==<br />
<br />
Descripción de las funciones y algunos ejemplos.<br />
<br />
<br />
'''Instanciar la clase:'''<br />
<br />
<syntaxhighlight lang="python"><br />
robot = butiaAPI.robot()<br />
</syntaxhighlight><br />
<br />
'''Apertura:'''<br />
<br />
abrirButia<br />
<br />
<br />
<syntaxhighlight lang="python"><br />
robot.abrirButia()<br />
</syntaxhighlight><br />
<br />
<br />
'''Versión:'''<br />
<br />
getVersion<br />
Devuelve la versión del firmware de la placa con el que estamos trabajando <br />
<br />
<syntaxhighlight lang="python"><br />
ver = robot.getVersion()<br />
print ver<br />
</syntaxhighlight><br />
<br />
<br />
'''Cerrar:'''<br />
<br />
cerrar<br />
Cierra la comunicación con el servidor bobot<br />
<br />
<br />
<syntaxhighlight lang="python"><br />
robot.cerrar()<br />
</syntaxhighlight><br />
<br />
<br />
'''Conexión/Desconexión con el servidor:'''<br />
<br />
reconnect<br />
Conecta o Reconecta al bobot en address:port<br />
<br />
<br />
<syntaxhighlight lang="python"><br />
robot.reconnect (address, port)<br />
</syntaxhighlight><br />
<br />
<br />
== Módulos == <br />
<br />
'''listarModulos:'''<br />
<br />
devuelve la lista de los modulos disponibles en el firmware de la placa<br />
<br />
<br />
<syntaxhighlight lang="python"><br />
modulos = robot.listarModulos()<br />
print modulos<br />
</syntaxhighlight><br />
<br />
<br />
'''abrirModulo:'''<br />
<br />
Apertura de modulos, abre el modulo "moduloname"<br />
<br />
<syntaxhighlight lang="python"><br />
robot.abrirModulo (moduloname)<br />
</syntaxhighlight><br />
<br />
<br />
'''llamarModulo:'''<br />
<br />
Operacion de llamada de una funcion de un modulo (CALL)<br />
<br />
<syntaxhighlight lang="python"><br />
robot.llamarModulo(modulename, function , params = "")<br />
</syntaxhighlight><br />
<br />
<br />
Para conocer la lista de funciones de un módulo y sus parametros puede ejecutarse en un terminal:<br><br />
<br><br />
<syntaxhighlight lang="text"><br />
telnet localhost 2009 <br />
DESCRIBE nombre_de_modulo<br />
</syntaxhighlight><br />
A futuro hay que exportar este servicio en la API<br><br />
<br />
<br />
== Funciones Varias ==<br />
<br />
'''isPresent'''<br />
<br />
Retorna si esta presente el modulo<br><br />
<br />
<br />
<syntaxhighlight lang="python"><br />
robot.isPresent (moduloname)<br />
</syntaxhighlight><br />
<br />
<br />
'''abrirLback'''<br />
<br />
Abrir módulo loopBack: modulo de ayuda presente en el butia (open)<br />
<br />
<br />
<syntaxhighlight lang="python"><br />
robot.abrirLback()<br />
datoRet = butiabot.loopBack("hola")<br />
</syntaxhighlight><br />
<br />
<br />
'''loopBack:'''<br />
<br />
envia un mensaje a la placa y espera recibir exactamente lo que fue enviado<br />
<br />
<br />
<syntaxhighlight lang="python"><br />
robot.loopBack(data)<br />
</syntaxhighlight><br />
<br />
<br />
== Motores ==<br />
<br />
Operaciones solicidatas al driver motores.lua <br />
<br />
<br />
'''abrirMotores:'''<br />
<br />
<syntaxhighlight lang="python"><br />
robot.abrirMotores()<br />
robot.setVelocidadMotores(self, sentidoIzq = "0", velIzq = "0", sentidoDer = "0", velDer = "0")<br />
robot.setVelMotor(self, idMotor = "0", sentido = "0", vel = "0")<br />
<br />
<br />
<br />
<br />
== Sensores ==<br />
<br />
Operaciones solicitadas al driver de los sensores<br />
<br />
<br />
'''abrirSensor()'''<br />
<br />
'''getValSenAnalog(pinAnalog = "0")'''<br />
<br />
'''getValSenDigital(pinDig = "0")'''<br />
<br />
<br />
<syntaxhighlight lang="python"><br />
butiabot.abrirSensor()<br />
sen1 = robot.getValSenAnalog("2")<br />
print sen1<br />
sen2 = robot.getValSenAnalog("4")<br />
print sen2<br />
sen3 = robot.getValSenDigital("5")<br />
print sen3<br />
</syntaxhighlight><br />
<br />
<br />
Operaciones solicitadas al modulo de la placa, driver butia.lua<br />
<br />
abrirButia()<br />
ping()<br />
<br />
<br />
== Carga de batería ==<br />
<br />
Esta operacion nos devuelve la carga aproximada del pack de pilas del robot con un error de 1 volt. <br />
<br />
'''getCargaBateria()'''<br />
<br />
<br />
<syntaxhighlight lang="python"><br />
carga = robot.getCargaBateria()<br />
print carga<br />
</syntaxhighlight><br />
<br />
<br />
<br />
setVelocidad3(velIzq = 0, velDer = 0)<br />
<br />
setPosicion(idMotor = 0, angulo = 0)<br />
<br />
<br />
<br />
<br />
Operaciones solicitadas al driver boton<br />
<br />
abrirBoton(self)<br />
<br />
getBoton(self)<br />
<br />
getLuzAmbiente(self)<br />
<br />
getDistancia(self)<br />
<br />
getEscalaGris(self)<br />
<br />
getTemperature(self)<br />
<br />
getVibration(self)<br />
<br />
getTilt(self)<br />
<br />
getContactoCapacitivo(self)<br />
<br />
getInduccionMagnetica(self)<br />
<br />
setLed(self, nivel = 255)</div>
Pbruccoleri
http://www.fing.edu.uy/inco/proyectos/butia/mediawiki/index.php?title=Python&diff=409
Python
2011-06-19T23:19:26Z
<p>Pbruccoleri: </p>
<hr />
<div>API de Butiá:<br />
<br />
Descripción de las funciones y algunos ejemplos.<br />
<br />
INSTANCIAR CLASE:<br />
butiabot = butiaAPI.robot()<br />
<br />
APERTURA:<br />
butiabot.abrirButia()<br />
<br />
VERSIÓN:<br />
getVersion<br />
Devuelve la version del firmware de la placa con el que estamos trabajando <br />
<br />
ver = butiabot.getVersion()<br />
print ver<br />
<br />
CERRAR comunicación con el servidor lubot<br />
butiabot.cerrar()<br />
<br />
CONEXIÓN/DESCONEXIÓN CON SERVIDOR:<br />
Conecta o Reconecta al bobot en address:port<br />
<br />
butiabot.reconnect (address, port)<br />
<br />
<br />
MÓDULOS: <br />
<br />
listarModulos:<br />
devuelve la lista de los modulos disponibles en el firmware de la placa<br />
modulos = butiabot.listarModulos()<br />
print modulos<br />
<br />
abrirModulo:<br />
Apertura de modulos, abre el modulo "moduloname"<br />
butiabot.abrirModulo (moduloname)<br />
<br />
llamarModulo:<br />
Operacion de llamada de una funcion de un modulo (CALL)<br />
butiabot.llamarModulo(modulename, function , params = "")<br />
<br />
<br />
<br />
FUNCIONES VARIAS:<br />
<br />
isPresent<br />
Retorna si esta presente el modulo<br />
butiabot.isPresent (moduloname)<br />
<br />
abrirLback<br />
Abrir módulo loopBack: modulo de ayuda presente en el butia (open)<br />
<br />
butiabot.abrirLback()<br />
datoRet = butiabot.loopBack("hola")<br />
<br />
<br />
loopBack: <br />
envia un mensaje a la placa y espera recibir exactamente lo que fue enviado<br />
<br />
butiabot.loopBack(data)<br />
<br />
<br />
<br />
MOTORES:<br />
Operaciones solicidatas al driver motores.lua <br />
<br />
abrirMotores:<br />
butiabot.abrirMotores()<br />
butiabot.setVelocidadMotores(self, sentidoIzq = "0", velIzq = "0", sentidoDer = "0", velDer = "0")<br />
butiabot.setVelMotor(self, idMotor = "0", sentido = "0", vel = "0")<br />
<br />
datoRet2 = butiabot.setVelocidadMotores("0", "1000", "0", "500")<br />
print datoRet2<br />
time.sleep(1)<br />
datoRet3 = butiabot.setVelocidadMotores("0", "0", "0", "0")<br />
print datoRet3<br />
datoRet4 = butiabot.setVelMotor("0","1","1023")<br />
time.sleep(1)<br />
print datoRet4<br />
datoRet4 = butiabot.setVelMotor("0","1","0")<br />
datoRet4 = butiabot.setVelMotor("1","0","452")<br />
time.sleep(1)<br />
print datoRet4<br />
datoRet4 = butiabot.setVelMotor("1","1","0")<br />
<br />
<br />
SENSORES:<br />
Operaciones solicitadas al driver de los sensores<br />
<br />
abrirSensor()<br />
<br />
getValSenAnalog(pinAnalog = "0"):<br />
<br />
getValSenDigital(pinDig = "0"):<br />
<br />
<br />
butiabot.abrirSensor()<br />
sen1 = butiabot.getValSenAnalog("2")<br />
print sen1<br />
sen2 = butiabot.getValSenAnalog("4")<br />
print sen2<br />
sen3 = butiabot.getValSenDigital("5")<br />
print sen3<br />
<br />
<br />
<br />
Operaciones solicitadas al modulo de la placa, driver butia.lua<br />
<br />
abrirButia()<br />
ping()<br />
<br />
CARGA DE BATERIA<br />
Esta operacion nos devuelve la carga aproximada del pack de pilas del robot con un error de 1 volt. <br />
getCargaBateria()<br />
<br />
carga = butiabot.getCargaBateria()<br />
print carga<br />
<br />
<br />
<br />
<br />
setVelocidad3(velIzq = 0, velDer = 0)<br />
<br />
setPosicion(idMotor = 0, angulo = 0)<br />
<br />
<br />
<br />
<br />
Operaciones solicitadas al driver boton4<br />
<br />
abrirBoton(self)<br />
<br />
getBoton(self)<br />
<br />
getLuzAmbiente(self)<br />
<br />
getDistancia(self)<br />
<br />
getEscalaGris(self)<br />
<br />
getTemperature(self)<br />
<br />
getVibration(self)<br />
<br />
getTilt(self)<br />
<br />
getContactoCapacitivo(self)<br />
<br />
getInduccionMagnetica(self)<br />
<br />
setLed(self, nivel = 255)</div>
Pbruccoleri
http://www.fing.edu.uy/inco/proyectos/butia/mediawiki/index.php?title=Python&diff=408
Python
2011-06-19T23:18:16Z
<p>Pbruccoleri: Página creada con 'API de Butiá: Descripción de las funciones y algunos ejemplos. INSTANCIAR CLASE: butiabot = butiaAPI.robot() APERTURA: butiabot.abrirButia() VERSIÓN: getVersion Devuelve ...'</p>
<hr />
<div>API de Butiá:<br />
<br />
Descripción de las funciones y algunos ejemplos.<br />
<br />
INSTANCIAR CLASE:<br />
butiabot = butiaAPI.robot()<br />
<br />
APERTURA:<br />
butiabot.abrirButia()<br />
<br />
VERSIÓN:<br />
getVersion<br />
Devuelve la version del firmware de la placa con el que estamos trabajando <br />
<br />
ver = butiabot.getVersion()<br />
print ver<br />
<br />
CERRAR comunicación con el servidor lubot<br />
butiabot.cerrar()<br />
<br />
CONEXIÓN/DESCONEXIÓN CON SERVIDOR:<br />
Conecta o Reconecta al bobot en address:port<br />
<br />
butiabot.reconnect (address, port)<br />
<br />
<br />
MÓDULOS: <br />
<br />
listarModulos:<br />
devuelve la lista de los modulos disponibles en el firmware de la placa<br />
modulos = butiabot.listarModulos()<br />
print modulos<br />
<br />
abrirModulo:<br />
Apertura de modulos, abre el modulo "moduloname"<br />
butiabot.abrirModulo (moduloname)<br />
<br />
llamarModulo:<br />
Operacion de llamada de una funcion de un modulo (CALL)<br />
butiabot.llamarModulo(modulename, function , params = "")<br />
<br />
FUNCIONES VARIAS<br />
<br />
isPresent<br />
Retorna si esta presente el modulo<br />
butiabot.isPresent (moduloname)<br />
<br />
abrirLback<br />
Abrir módulo loopBack: modulo de ayuda presente en el butia (open)<br />
<br />
butiabot.abrirLback()<br />
datoRet = butiabot.loopBack("hola")<br />
<br />
<br />
loopBack: <br />
envia un mensaje a la placa y espera recibir exactamente lo que fue enviado<br />
<br />
butiabot.loopBack(data)<br />
<br />
<br />
<br />
MOTORES<br />
Operaciones solicidatas al driver motores.lua <br />
<br />
abrirMotores:<br />
butiabot.abrirMotores()<br />
butiabot.setVelocidadMotores(self, sentidoIzq = "0", velIzq = "0", sentidoDer = "0", velDer = "0")<br />
butiabot.setVelMotor(self, idMotor = "0", sentido = "0", vel = "0")<br />
<br />
datoRet2 = butiabot.setVelocidadMotores("0", "1000", "0", "500")<br />
print datoRet2<br />
time.sleep(1)<br />
datoRet3 = butiabot.setVelocidadMotores("0", "0", "0", "0")<br />
print datoRet3<br />
datoRet4 = butiabot.setVelMotor("0","1","1023")<br />
time.sleep(1)<br />
print datoRet4<br />
datoRet4 = butiabot.setVelMotor("0","1","0")<br />
datoRet4 = butiabot.setVelMotor("1","0","452")<br />
time.sleep(1)<br />
print datoRet4<br />
datoRet4 = butiabot.setVelMotor("1","1","0")<br />
<br />
<br />
SENSORES<br />
Operaciones solicitadas al driver de los sensores<br />
<br />
abrirSensor()<br />
<br />
getValSenAnalog(pinAnalog = "0"):<br />
<br />
getValSenDigital(pinDig = "0"):<br />
<br />
<br />
butiabot.abrirSensor()<br />
sen1 = butiabot.getValSenAnalog("2")<br />
print sen1<br />
sen2 = butiabot.getValSenAnalog("4")<br />
print sen2<br />
sen3 = butiabot.getValSenDigital("5")<br />
print sen3<br />
<br />
<br />
<br />
Operaciones solicitadas al modulo de la placa, driver butia.lua<br />
<br />
abrirButia()<br />
ping()<br />
<br />
CARGA DE BATERIA<br />
Esta operacion nos devuelve la carga aproximada del pack de pilas del robot con un error de 1 volt. <br />
getCargaBateria()<br />
<br />
carga = butiabot.getCargaBateria()<br />
print carga<br />
<br />
<br />
<br />
<br />
setVelocidad3(velIzq = 0, velDer = 0)<br />
<br />
setPosicion(idMotor = 0, angulo = 0)<br />
<br />
<br />
<br />
<br />
Operaciones solicitadas al driver boton4<br />
<br />
abrirBoton(self)<br />
<br />
getBoton(self)<br />
<br />
getLuzAmbiente(self)<br />
<br />
getDistancia(self)<br />
<br />
getEscalaGris(self)<br />
<br />
getTemperature(self)<br />
<br />
getVibration(self)<br />
<br />
getTilt(self)<br />
<br />
getContactoCapacitivo(self)<br />
<br />
getInduccionMagnetica(self)<br />
<br />
setLed(self, nivel = 255)</div>
Pbruccoleri