Introduction: Localino Tracks Roomba IRobot, Maps the Environment and Allows Control.

This instructable explains a procedure how to track and control your Roomba iRobot indoors with the Localino Indoor Localization System, a WiFi-UART bridge and a PC application. The explanation detail of this instructable, explaining a HIL-control (HIL - hardware in the loop), is rather low. There are many instructables out there which cover some of these topics already in great detail and repetition is not necessary. However, we tried to reference these sources well and give additional valuable details which reduce your setup time tremendously. If you have technical knowledge how to adapt and flash an ESP with firmware and solder some components to build the necessary Roomba WiFi-UART bridge, follow a documentation and can setup the indoor location system from Localino, this instructable will give some valuable ideas and insights.

The setup is not limited to a Roomba iRobot, you can also track and control anything else based on the positions from the indoor location system, for example your indoor flying drone.
And the best thing, your data belongs to you and is not uploaded anywhere (like known from some other cleaning robots)

We are constantly updating this tutorial. Stay tuned....

Step 1: System Requirements

1. any robot that you want and can control remotely (we use an Roomba iRobot)

2. the control interface for the Roomba iRobot (we use an ESP8266 WiFi-UART bridge)

3. Indoor Localization System consiting of anchors and tags, that reports the location of the Roomba constantly (we use the Localino Indoor Localization system from www.localino.net)

4. a PC application that receives the positions and sends the commands to the control interface (we use python)

Step 2: Build and Connect the WiFi-UART Bridge to the Roomba

In order to build the WiFi-UART bridge, you can check out this github repo: https://github.com/incmve/roomba-esp8266

It has a nice basis to start with. Make sure you read the guideline well, because the Roomba VCC during charging increases up to 20 Volts! If you add an ESP8266 without a proper buck-converter that works even up to 20V and down-converts to 3.3V, you will damage your ESP.

Also make sure to use a level shifter (e.g. using a voltage divider) to shift the 5V UART logic levels from the Roomba to 3.3V, which are used by the ESP.

Another important detail is, that the buck converter should have 300mA, but noch much less or much more (depending on the buck converter itself). There is some out there which can do much more current, but cause the Roomba to crash because they draw too much current during start-up. We found out that the Pololu 3.3V, 300mA Step-Down Voltage Regulator (D24V3F3) works just perfect. The alternative versions which have 500mA / 600mA caused the Roomba UART interface to crash. Basically the Roomba was reacting on button press, but not on commands via the UART interface. Once this happend we had to remove the Roomba battery and cold-restart the Roomba with the WiFi-UART bridge attached. However, only the D24V3F3 worked well.

Aside from that technical detail, you have to add additional commands to the code, that you can find in the Roomba open interface specifications. You wil need to add all commands that you want your roomba to react to (for example, backwards, forwards, speed, etc.).

examples within the arduino IDE:

void goForward() { char c[] = {137, 0x00,0xc8, 0x80,0x00}; // 0x00c8 == 200 Serial.print( c ); }

void goBackward() { char c[] = {137, 0xff,0x38, 0x80,0x00}; // 0xff38 == -200 Serial.print( c ); }

void spinLeft() { char c[] = {137, 0x00,0xc8, 0x00,0x01}; Serial.print( c ); }

void spinRight() { char c[] = {137, 0x00,0xc8, 0xff,0xff}; Serial.print( c ); }

if you write in lua it looks a bit different, an example for a LEFT turn would look like this:

if(_GET.pin == "LEFT")then
print ('\137'); --VOR

tmr.delay(100);

print ('\00'); -- Velocity = 200 = 0x00C8 -> 0 und 200

tmr.delay(100);

print ('\200'); -- Velocity

tmr.delay(100);

print ('\254'); -- Radius = 500 = 0x01F4 = 0x01 0xF4 = 1 244

tmr.delay(100);

print ('\12'); -- Turn

end

Make sure you have to correct open interface description for your Roomba. There are at least two open interface specifications available.

for Roomba 5xx series: http://www.irobot.lv/uploaded_files/File/iRobot_R...

for Roomba 6xx series: http://anrg.usc.edu/ee579/spring2016/Roomba/iRobo...

Once you have build your WiFi-UART bridge and tested the commands you made big step further. This video demonstrates that the application and approach works. We were a bit lazy, the webinterface is missing all other control commands, like forward, backward, speed, right, left and so forth, but you can issue the commands via http. Anyhow, its just a demonstration that the remote control of the Roomba works with an easy piece of hardware and software using an ESP8266.

Now as you can control your Roomba remotely from a PC application, the only thing missing is the indoor localization. We need this to close the feedback loop, because our goal was to steer the robot to a certain direction. Let's do this.

Step 3: Setup Your Indoor Localization System

To close the feedback loop we make use of an indoor localization system. We use Localino for this.
The Localino system consists out of "anchors" and "tags". The anchors are positioned at fixed locations inside the room and locate the position of the moving tag (which is placed on the Roomba). The location processing is done in a PC application. That is of great advantage, because your can also control the Roomba from the same PC! There is free source code available from the Localino website, it is written in python and there is also a real-time stream available that offers the XYZ coordinates of the tag. The datastream is available via UDP network, but you can also add MQTT or any other fancy things that you like. If you know Python, there are heaps of libraries which help you.

In this video, the localization of the Roomba is demonstrated. Therefore we have 4 anchors setup in the room at fixed locations, which allow 3D positioning of the Roomba. In general, we would only require 3 anchors, because the Roomba probably will not move in the Z-axis, therefore 2D would be sufficient. But because the anchors are located at the AC main plugs height (which is approx 30cm above ground) a 2D setup would cause little position estimation errors. So we decided to have 4 anchors and localize in 3D.

Now as we have the position of the Roomba our next step is to control the Roomba from the same application. The idea is to use the ground truth and estimate a perfect cleaning path for the robot. With the use of the Localino we can close the feedback loop and control the robot from the PC application.

Setup remarks

Position the Localino anchors inside the room at different x, y positions and three of them at the same z position. Position one out of four anchors at a different height z per room. Make sure that there is good coverage from the Localino tag, that will be moving with the Roomba.

All anchors have a uniqe anchor ID, which is displayed on the barcode of the Localino and can be read out with the “localino configuration” tool.

Note the positions in X, Y, Z and the anchor IDs. This is required for the Localino Processor Software and has to be adapted in the “localino.ini” file in the folder “LocalinoProcessor”

The anchors should point upwards or downwards in Z (when XY area is covered), but not in the direction of the covered area. The anchors should also not be covered by metal or any other wireless signal disturbing material. If this is not possible, there should also be a certain air gap between any material and the anchor.

...more to come.

Step 4: Adapt the Python Software

stay tuned. more to come.

Remote Control Contest 2017

Participated in the
Remote Control Contest 2017