R + Arduino + ROS

Facebooktwitterredditpinterestlinkedinmail


[In English]

Como ya comenté en un post anterior, es posible integrar Arduino dentro de ROS. Por otra parte, hay un paquete rosR muy interesante que permite crear scripts R trabajando también en ROS; la documentación del paquete es completa y cubre tanto la parte ROS como la parte R:

Combinando ambos paquetes se pueden hacer cosas majas. Por ejemplo, en el vídeo al final del post se muestra cómo un nodo ROS envía las lecturas de un sensor FSR conectado a un Arduino (Duemilanove, en este caso) por un topic al que está suscrito un script R que muestra un plot con esos valores sobre la marcha. El código del sketch y del script, basados en los ejemplos proporcionados en la documentación de ambos paquetes, están en mi Github.

En este caso, he usado la máquina virtual Nootrix con ROS indigo 32, ya que me resulta útil por motivos docentes. La misma combinación Arduino-R también funciona correctamente en un Xubuntu 14.04.3 de 64 bits con ROS indigo instalado.

Por probar, he compilado la versión 64 bits de rosR en un Ubuntu Mate 15 con ROS jade distribuido entre un portátil y el netbook del Turtlebot, y también funciona… ¡¡Turtlebot, R te espera :)!!


[En español]

As I commented in a previous post, it is possible to use Arduino with ROS. Furthermore, there is a very interesting rosR package that allows to build R scripts also in ROS; the documentation of this package is complete and covers the ROS point of view as well as the R perspective:

You can build nice things using both packages. For example, the video at the bottom of this post shows how a ROS node sends the readings of a FSR sensor connected to an Arduino (Duemilanove, in this case) through a topic; a R script which is subscribed to that topic plots those values on the fly. The code of the skecth and the script, based on the examples provided in the documentation of both packages, is in my Github.

You can see in the video that I use the Nootrix ROS indigo 32 virtual machine, since I find it useful due to teaching reasons. The same Arduino-R combination also works fine under a Xubuntu 14.04.3 64 bits with ROS indigo.

I tried to compile the rosR 64 bits version under Ubuntu Mate 15 with a ROS jade distributed between a desktop and the Turtlebot netbook, and it also works… Turtlebot, R is waiting for you 🙂