Monday, December 19, 2011

Robot Mapping and Exploration using Websockets and HTML5

As promissed last week, here's an introduction video to "Robot Mapping and Exploration using Webockets and HTML5" Project. The memory on my phone got full unexpectedly just as I was going to show the map building features of the project. I'll post the rest on a later video.

Sunday, December 11, 2011

NEW PROJECT: Robot Exploration and Mapping using Websockets

For some time now, I have been working on this project but I have not published anything until now. The goal of the project is to use a small mobile robot to explore and map an area. The real cool thing about it is that the map is built in real time and can be viewed using any browser that supports HTML5 and websockets.
HTML5 is the fifth revision of the HTML language for presenting content on the world wide web and, as of November 2011 is still under development. In this project I make extensive use of a new HTML element, introduced with HTML5 called the canvas element. It is basically used to draw images that are then displayed on the browser. Specifically, I use three canvas elements on top of each other with the first displaying the calculated position of the robot, the second displaying the map and the third displaying the occupancy grid.

Also exciting is the use of websockets to link the client browser (real time map builder application) with the server. Wikipedia states that "websocket is a technology providing for bi-directional, full duplex communications channels, over a single Transmission Control Protocol (TCP) socket".

On this project I have adapted a python script that implements draft 76 of the websockets protocol (available only on safari as the time of writing - other reference browsers have support for websockets but are now on a posterior, more robust and secure version. I don't feel like reprogramming my server to work with the new version of chrome so I chose to use safari for windows to still be able to use the older code - hoep this doesn't get auto updated as y copy of chrome did!

The python code above also receives serial data from the robot (sent over wireless radio using an xbee module) and makes it available to the client application. Also running on the same machine, besides this websocket server is a http server also written in python. Both scripts are adapted from scripts freely available on the internet.

I also make heavy use of javascript as the client page uses it to display information real time on the screen.

On the robot, I use pololu robot base with two arduinos, one connected to the xbee shield and the other connected to a custom shield that I built and that basically takes care of all sensor connections and basic electronics to allow them to be connected to the arduino. Both boards exchange data over an i2C link.

Currently I can send data from the mobile robot to the browser, and I can control the robot manually through the browser on a proof of concept application of data moving both ways over a websocket connection.

I will leave you here now, in a week or so, I will post some screenshots of the system in action and perhaps a demo video.

In the meantime, let me know if you have any questions.

Saturday, December 10, 2011

NEW PROJECT: Open Source Internet of Things HW and SW

This is the first post on the subject of our latest project: An open Source HW and SW platform that collects sensor data and sends it to an online server for real-time manipulation by client systems. This is in line with pachube and thingspeak, two such platforms (you may recall I use thingspeak to store data from my weather station and to display sensor data as you can see here).

A general description of the objectives follows (mainly for the hardware, the part I'm mostly involved in):

HARDWARE:
1. arduino based main console with wired ethernet connection (version 1, planned to go on to wireless later)
2. arduino based sensor modules and control boards
3. sensor modules connect to the main console and require no configuration (plug and play)
4. the protopyte sensor modules will be:
a) temperature sensor
b) open door/ window sensor
c) humidity sensor and 
d) power/ current sensor
e) relay output board (at least one output available on the controller board, probably more)
5. HW as cheap as we can make it, all open source
6. At the end of the project we will have a prototype controller board and a prototype sensor board for each of the sensors on the list above
7. controller and sensor boards software open source
8. case study application: environment control of a server room
9. board configuration through built-in web interface

SERVER SOFTWARE:
1. https: secure connection
2. branch of the project to work on tablet data display
3. other general specs later

APPLICATIONS:
1. server room environment monitoring and control
2. reef aquarium data storage, display, monitoring and system control
3. weather stations data storage, display, monitoring
4. others by the community

Available time: 6 months starting Dec 2011, to be completed on Jun 2012 with a prototype that can be manufactured.

A Technology Lab project of the University of Saint Joseph in Macau SAR, China.