Thumbnail

Irobot Roomba Movement Panel

Control the iRobot Roomba and read sensor data from 500 series roombas

+ How To Add This Control To Your Project (Click to Expand)
  1. Make sure you have the latest version of ARC installed.
  2. Select the Get button in this page to download the archive file.
  3. Double click the downloaded archive file to execute installer.
  4. The installer will add this control to ARC.
  5. Load ARC and press the Project -> Add Control button from the menu.
  6. Choose the Movement Panels category tab.
  7. Press the Irobot Roomba Movement Panel icon to add the control to your project.

Manual

Control the iRobot Roomba and read sensor data. This skill currently works with the 500 series robots and iRobot create. The baud rate and connection type will need to be configured in the settings menu. 

This robot skill can connect to an iRobot by using either a USB adapter or a microcontroller acting as an EZB (Arduino, etc.). The connection type in the config menu will specify the way this skill communicates with the iRobot. Continue reading below...

Main Window
User-inserted image

1) Enable sensor streaming and statistics of received sensor data. This requires a bi-directional connection. See below for different connection types and reading sensor data.

2) Movement directions to drive the robot, and a box to place the mouse cursor which enables using the keyboard arrow keys.

3) The speed for the left and right wheels, which defaults to 0.

4) Commands for initializing the SCI connection, enabling cleaning, stop cleaning, or powering off the robot

5) Status and log data for successful initialization and errors.


Config Window
User-inserted image

1) Connection type. Changing this setting will enable the selected connection type configuration below (Software serial, PC COM port, H/W UART). There is more information below in this manual on connection types.

2) Software Serial connection type. This type should only be used if there are no other supported options. This uses software serial on the EZB to emulate a transmitted serial signal. This is not 100% reliable and therefore should only be used if there are no other options. This is a one-way transmission, so sensor data cannot be read.

3) PC COM Port connection type. Uses a PC COM/Serial port that is usually a USB<->TTL convertor or an official iRobot Roomba USB cable (See details below). This is a bi-directional transmission, so sensor data can be read.

4) H/W UART on the EZB. Selecting this will use the HW UART if supported. This allows sensor data to be read because it is bi-directional.

5) NMS (Navigation Messaging System).

a) Enabling the first option in this group will send the iRobot Roomba's current coordinates to the NMS as a Level #3 Group #2 positioning/pose sensor. There is more information about this further in this manual.

b) The second option in this group will Pause NMS navigation if any of the iRobot Roomba sensors are triggered. The sensors covered are: cliff, bumper, virtual wall, and wheel drop

Baud Rates
Different models (i.e. create vs Roomba) use different baud rates. Find your Roomba's version and check it's SCI (Serial Command Interface) or OI (Open Interface) manual to see what baud rate it uses. We believe the Roomba uses baud rate 115200, and the create uses 57600. But, don't hold us to that :). We do notice that older Roomba's use 57600 baud - ensure you have selected the correct baud rate in the config settings. 500+ series Roombas use 115,200 baud. If you are unsure, try each baud rate.

Demo Video
Here's a video of the nice proportional steering that this control provides the iRobot Roomba. This video has the Roomba set to follow Kate's orange socks.



Like all movement panels, only one can exist. In this case, this Movement Panel will connect to a Roomba by its SCI interface. This control allows for a variety of speeds also, so you can use the analog joystick to control speeds. Or use the speed control in the camera to track objects with nice smooth trajectories.

ARC allows multiple physical robot controllers to be connected at once. The Movement Controls only operate on the first board (Board 0) or PC serial port.

Reading Sensor Data
You can read sensor data if the PC COM or HW UART ports are used for the connection. This also requires the TX and RX wires to be connected to the Roomba's SCI port. The data from the sensors and internal values are set as global variables. You can access everything from battery voltage to wheel encoder counts.

SCI Connection Types
The connection types that can be used to connect the Roomba to ARC are:

1. Software Serial (read-only)
2. HW UART (read/write bi-directional two-way)
3. USB COM TTL (read/write bi-directional two-way)

Roomba SCI Cable 
The cable can have either TX & RX or just RX connected from the Roomba. However, do note that if only the RX pin is connected, the sensor data will not be read. 

Roomba <-> USB <-> PC
This cable will allow reading sensor data. iRobot has a low-cost USB cable that can connect directly to a PC. This is useful if the PC is located within the robot. You can get it from here: https://store.irobot.com/default/parts-and-accessories/create-accessories/communication-cable-for-create-2/4466502.html

Roomba <-> EZB <-> PC (two-way communication)
This cable will allow reading sensor data. This requires a 7 pin Male Mini Din to connect to an EZB I/O Controller. Watch DJ's iRobot Roomba Live Hack to see how to make a cable. The meat of the video starts at 20:00 because the first bit is demonstrating the iRobot Roomba and talking about it. You can find the part numbers and design information for a cable on Synthiam's GitHub repo HERE


Roomba <-> EZB <-> PC (one-way communication)
The image below demonstrates how to make a cable with RX only. Meaning, the sensor data will not be read by ARC.
User-inserted image



Charging After SCI Connection
When the iRobot Roomba is used with this robot skill, the robot will be put into a mode that will not accept charging. The only way to enable the robot to accept charging is to power off or reset using the two buttons on the control. Pressing either the Reset/Power Off or Power Down buttons will play an acknowledge song if successful.
User-inserted image



NMS (Navigation Messaging System)
Within the configuration, the menu has an option to enable the NMS (Navigation Messaging System). This will push calculated cartesian position/location (i.e. pose) coordinates into the NMS for use with mapping/navigation tools such as The Navigator. In order to obtain wheel encoder data from the iRobot, a two-way SCI cable is needed (i.e. RX and TX must be connected) and streaming must be enabled.

The iRobot uses wheel encoders (508.8 ticks per revolution) to keep track of the odometry. This robot skill will calculate cartesian coordinates from the wheel encoders and send those values into the NMS. The iRobot's memory will keep the wheel encoder count even when powered off. In order to use the NMS correctly, follow this procedure to clear the iRobot memory and reset the encoder counts.

Get The Navigator robot skill here.

1) Visit the iRobot Robot Skill configuration screen and enable NMS. Also, ensure your connection type is either PC COM Port or H/W UART because those are the only two that allow two-way communication. 

*Optionally, you may select the "Pause NMS navigation with sensor detection" checkbox. This will send a pause signal to the selected NMS Level #1 navigator if any of the sensors are triggered.
User-inserted image




2) Connect to the iRobot Roomba and enable Sensor Streaming. Verify packets are being received by the packet count increasing in the Sensor Data status display.
User-inserted image


3) Now we will press the Reset/Power Off button and the robot will play a little tune acknowledging that it has rebooted and reset internal settings. The Sensor Streamer checkbox will disable as well.
User-inserted image


4) Position your iRobot Roomba in the room where 0,0 (home) will be. Good idea to mark the area as well so saved maps can be re-used.
User-inserted image


5) Press the CLEAN button once on the iRobot to power on. It should light up. 
User-inserted image


6) In the robot skill, press the INIT button and then enable Sensor Streaming. Again, verify packets are being received. The robot will play a little tune acknowledging that it has been initialized.
User-inserted image


7) If you have The Navigator robot skill added to your project, you will notice the robot will be at location 0,0 (home).
User-inserted image


8) You may now right-click in The Navigator and specify waypoints or drive the robot around and view the trajectory. Read The Navigator for instructions on using that robot skill, as it is not covered in this manual.

Accuracy of Wheel Encoders
... or lack of accuracy is a better title. Wheel encoders are not accurate for mapping but will present a general enough position for simple tasks. This is because there are many limitations to wheel encoder odometry, such as gear slop, slipping wheels and real-world velocities are not constant.

As quoted by Andrew Kramer's work based on Edwin Olson's 2004 paper...

Quote:


The larger problem is that odometry is inherently inaccurate. Encoder ticks do not translate directly into distance traveled by the wheel because wheels slip, the wheels aren’t perfectly circular, the ground isn’t perfectly flat, encoder ticks might be missed, and the motor gearbox has a backlash that isn’t accounted for in our model. This means that the position calculated from odometry will gradually diverge from the true position. We could use other methods that might be more accurate, such as optical flow and IMUs. However, any sensor we might use suffers from some inherent random error, known as noise, and this error will accumulate over time.

Great Platform Base
How about using an iRobot Roomba for your robot wheelbase? You can attach a camera and the EZ-B to a Roomba and turn it into a lean mean cleaning security machine! Combine a USB Joystick and the HTTP Remote Server Control... Voila! Remote control security cleaning robot. That's easy!

You can use an iRobot Roomba motherboard as an H-Bridge to drive your custom motors. This gives your robot the ability to self-charge. By positioning the IR sensors on your robot in the same fashion as the Roomba, your robot can easily dock with the Roomba's self-charging base.

PRO
USA
#100   — Edited
Do these Roombas have lidar for navigation or is it one of those bumper things where goes straight until it hits something then moves in another direction until bumper hits again?
PRO
Portugal
#101   — Edited
These Roombas have an IR sensor array and bump sensors front.
I have a xiaomi that has Lidar, and you can place it on the floor in any room and it figures out exactly where it is.
The android mapping app is so cool...

User-inserted image
PRO
Canada
#102  
I was actually amazed the Roomba had sensors on the bumper because my Roomba just smashed into everything.  There is a great viral video of a Roomba someone hacked swearing a cursing every time it hits something.

I guess a paint option on NMS would be nice so you could draw lines in to represent your rooms. Drive to every corner so you get the general location and then play join the dots.
PRO
USA
#103  
Good to know on these. I have one but have not replaced the battery yet. But I was looking at my neato and the lidar is on the top, but couldn't see anything on the Roomba. IR interesting. The good thing is I'm adding a robot to the top and I won't have to worry about the robot blocking the lidar.
#104  
Ha ha ya that swearing video, I was going to do the same thing but the EZ Tiny can't do roomba sensor input, need ezb4 or any other computer that does transmit/recieve from UART.My Tiny can only do transmit data by software.
#105   — Edited
So in my sampled Roomba mobile  I do get the init button and Dock button next to the joystick and camera, so If I wanted to add the Start main brush ControlCommand() button on the mobile interface and start /stop vacuum button ,I think it is just as simple as making a new script titled Brushes off put in the code and if I go to inteface builder It should then give the new option for a Brushes off button, Etc....Right? Upload to cloud and then download to my mobile tablet, I think that is how I did it last month?

Okay I get it...got to make a new button,label it then I can edit the Command control code for Brush On and save it in mobile Interface window.

---Wow this is really cool, DJ has made it even more easy than ever to start getting all the Roomba codes to work on the Mobile Builder and create my own custom buttons for the mobile Tablet, Using Java script now instead of EZ script, the cheat window makes this so simple to copy and paste for the mobile buttons. Like I always just copied scripts from those before me that uploaded samples but now it is so easy to do my self,I have many cool ideas for the mobile Tablet controls.
#106   — Edited
I just wanted to add to what I have found looking back at all the detailed library ,history posts and Questions from Synthiam and EZ Robot going back to the EZ v3 and a bunch of posts in 2016 on Getting the Roombas/Create,Create2 to work with Synthiam mobile software some of the best info I got from a User name Dunning Kruger in our Forum here. He had some great Mobile sample code that could get the motor brushes running with your mobile app interface . I had it working up to a month ago using sample code from others as well. Only had to change the EZ4 UART commands into Send Serial commands for my IO Tiny. I there was no button to turn on Vacuum motor so I will need to find that send Serial code to get full vacuuming functions again in Mobile Tablet. Unless anyone else knows what the serial code is for Vacuum ON/Off? I do remember the info is on the Roomba plug in ?info button,going to see if I can find that still. (I had it working last month but I may have accidentally over written that program I had.)

Edit-----OKay so the web site just says this code turns on all brushes and vacuum together at 100 percent, good enough.....

SendSerial (D0,115200,138,13

..............I have uploaded a sample program that does turn on all motors and brushes,vacuums floor by touch control on your phone or tablet ,I simply converted sample code from EZB4 UART code  into EZB Tiny Serial code using the TX pin at D0 ,No sensors yet but you can use the joystick and video window to remote drive Roomba and Vacuum by touch control using Synthiam ARC Mobile on your device. Search my User name for the App down load, If you have EZB4 or computer then use original program By User Dunning Kruger and download his App for UART version.
PRO
USA
#107  
I have built the cable as per the instructions on Github. Since this uses a different method of attachment to UART0 as opposed to UART1 you end up with a 3 pin connector that goes into a 4 pin slot. You must pay attention to the polarity. I found this in the datasheets and it might be helpful. Looks like the 3.3V pin is not connected.

User-inserted image
#108  
Ahhh, spring day often brings in the Ants looking for food.The best time to let the Roomba go crazy on their little arses!xD
PRO
USA
#109  
I am having trouble getting this to work with NMS. I am following the tutorial to a tee, I am using UART comms for bidirectional comms and sending the data to the NMS. I cannot get the initial yellow dot to display at the 0,0 coordinates nor does it plot out as I move by bot. The coordinates update but there is not graphical indication on the NMS window. After about 2 minutes the coordinates and heading just start to vary randomly.
Do the internal wheel encoders function as a level 3 group 2 sensor, even if inaccurate?
PRO
Synthiam
#110  
Is the robot skill showing packets increasing?

User-inserted image
PRO
USA
#111  
Yep, packets accrue at a rate slightly slower than my student loans.

Also noticing that there seems to be long periods where the plugin stalls and a lot of random variables are output. Eventually it will stabalize
PRO
Synthiam
#112  
When it stalls might be when the weird locations are updated in the nms. Sounds like somehow there is a noisy connection. Not sure how to figure that out. Ill have to think about that
PRO
USA
#113   — Edited
Any idea why there is no initial placement of the yellow dot to establish the (0,0) cartesian coordinate?
PRO
Synthiam
#114   — Edited
Not yet - I’ll reply if I do. But I’m stumped because I can’t reproduce it. The roomba provides the localization details - I don’t know why it’s not providing the details for you.
#115  
So glad to see the Roomba skill always get updated,was my favorite new Robot to work with this year,Keep up the great work!:D
PRO
Synthiam
#116  
@Perry - What do the wheel encoder variables look like for you? Are they moving up as the robot drives?

Hopefully, your Roomba wheel encoders aren't damaged. Maybe write a quick javascript that loops and prints the values to check. Something like...

Code:


while (true) {

  print("L: " + GetVar("$RoombaLeftEncoderCounts"));
  print("R: " + GetVar("$RoombaRightEncoderCounts"));
  sleep(500);
}
PRO
USA
#117   — Edited
Hi DJ. I tried the code but get this error

User-inserted image


I did use the advanced variable watcher to verify my encoders are working. I did notice that comms were intermittent and the encoder values will fluctuate wildly quite often. During this time my position start increasing non-stop. The reason I could not see the yellow dot and position movement was because it thought the bot was 75 meters away from (0,0).
So I get initial function and it works for about 30 seconds and will work for another 30 if I reset the roomba.
PRO
USA
#118  
Maybe this will help to illustrate. The red circle is it starting to map as I drive and the orange circle shows where it instantly jumps position by 20 meters off the screen.

User-inserted image
PRO
Synthiam
#119  
The description sounds like either the encoders aren’t working. Or an older firmware with an encoder comm issue. Or the wiring has noise and is being corrupted. 

I’ll add an option to enable debugging to view parsing errors. That can identify noise issues. 

If that isn’t it - there must be a firmware version difference and a bug in their firmware.