Close

A quick update: First movements

A project log for Roomba 537 SLAM

I found a Roomba in an e-waste bin and decided to give it the gift of SLAM

PodgePodge 06/08/2020 at 08:480 Comments

Once the the level shifter was functioning I then needed to connect the pi to the Roomba. To do this I used a 8-way male moulded din cable assembly which is much easier to find than the 7-way counterpart. This works because the 8th pin sits in the middle void created by the 7-way receptacle's locator (the rectangle in the middle of the connector in the image below) - that is it just chills in a void and does nothing. 

With this cable I connected the Rx of the Roomba to the Tx of the Raspberry Pi (via the level shifter of course) and plugged it into the socket under the top cover of the Roomba - it is now ready for some serial commands.

As per the iRobot Roomba SCI spec to control the Roomba you need to first send a few commands  with a 20 ms pause in between to put it in passive mode then safe mode then full mode which will allow unrestricted access. This is done by sending the opcodes 128, 130, 131 and 132. 

To command the Roomba to drive it needs to be sent the opcode 137 (drive) and then 4 data bytes as per the following sequence ( a nice example is given in the SCI):  

[137] [Velocity high byte] [Velocity low byte][Radius high byte] [Radius low byte]


My first command was forward 10mm/sec and 0 radius (value 32768) turn which doesn't quite work. The Roomba will move ok but will still run with a large radius - perhaps it is my hi/lo byte splitting function. But I am still calling that a victory cause it almost does what I want - just need a bit more work to suss out whats going wrong.

All the code for these commands and the basic framework I will be using is committed and pushed to my git repo.

Enjoy

Discussions