Club robotique de Sophia-Antipolis

Accueil > POBOTpedia > Programmation > Découvrir > Microsoft Robotics Studio > MRS Example : Show me a picture when you see a fire

MRS Example : Show me a picture when you see a fire

mardi 10 octobre 2006, par Chris

This examples shows how to use a TPA81 passive infra red sensor to detect a fire and then tell the user and show a picture of the fire using the Visual Programing Language.

This examples uses a tool called Visual Programing Language which is a part of MRS and lets you program using drag and drop, a bit like the Lego program bricks.

You may laugh at such a tool, but it can be an effective way of quickly combining services to test a strategy, and opens up the use of MRS to those who do not want to spend a month getting their head around the ccr, generics, iterators and service architectures.

The TPA81 Thermopile Array (View Documentation) can test the temperature of 8 pixels and control a servo to allow panning of the sensor.

The default configuration is shown below :

GIF - 7.2 ko

Here it is set up to update and store each pixel’s temperature and move the servo with a 100 milisecond gap between each poll.

We could use the TPA81Map service to show us exactly where the hot spot is :

GIF - 7.7 ko

But in this example, we will just use the TPA81 Hardware service by dragging it into the Visual Programing Language window and making the following program :

GIF - 21.1 ko

This simple program starts by a 2 second wait, then does a ’Get’ of the sensor service every half a second. Note that the TPA81 is itself polling the device every 100 milliseconds, so we could have made this polling much faster. Indeed a more elegant aproach would have been to subscribe to the TPA81 to get notifications of each sensor change.

If the temperature of pixel zero of module zero is above 40C, it will send some text to the Text-To-Speech service to say ’Fire 48C’, and launch a browser url to show the latest picture available from the webcam service. After this it does a 5 second pause, so as not to flood your browser too much.

JPEG - 11.7 ko

This very simple program is unlikely to win you any competitions, but gives you the idea of ways in which tools like the Visual Programing Language can open up robotics programing to newcomers who want results fast - All power to them, I say.

Chris Kilner

Un message, un commentaire ?

modération a priori

Attention, votre message n’apparaîtra qu’après avoir été relu et approuvé.

Qui êtes-vous ?

Pour afficher votre trombine avec votre message, enregistrez-la d’abord sur (gratuit et indolore) et n’oubliez pas d’indiquer votre adresse e-mail ici.

Ajoutez votre commentaire ici
  • Ce formulaire accepte les raccourcis SPIP [->url] {{gras}} {italique} <quote> <code> et le code HTML <q> <del> <ins>. Pour créer des paragraphes, laissez simplement des lignes vides.

Ajouter un document