Saturday, June 3, 2017

Roomba Dashboard - A cli dashboard for irobot create 2

Roomba Dashboard


Roomba-Dash is a cli dashboard for the IRobot Create 2 platform. I got the roomba because I wanted to build a security robot for my home.  Since I was not familiar with the capabilities of the Roomba, I build a dashboard to understand the sensors.

Demo of the dashboard driving a Roomba.

Dashboard Details:

The dashboard is primarily used to get all the useful sensor data from the roomba. In addition it can also be used to send some of the commands to the Roomba. Particularly it can change between the different roomba modes (full, safe, passive). There are a couple of gauges that provide data about the current, volts and charge of the battery.  The batt. level gauges also provides the battery level as a percentage but shows it as a graph over time.

Motor current gauge shows the current drawn by the motors. Encoder, Rotation shows the various encoder (L,R), Radius, Angle and Distance travelled. This is requested about 3 times a second and they reset on every call. The IR code shows the IR signal that is received by omni and left, right sensors. The  cliff sensors show the signal level from the cliff sensors located beneath the roomba. In addition, if any of the sensors are triggered, they will also highlight in red. The velocity sensor shows the current velocity of the motors. The light bumper gauge shows the IR bumper signals from the 6 IR sensors across the front of the roomba. Similar to the cliff sensor gauge, this also lights up when a bump is detected. The wheel sensor tracks the wheel drops and the front bumper.

Code Build Details:

The dashboard is build in golang using termui and go-roomba libraries runs on top of a C.H.I.P single board computer. The code for the dashboard is available on github/deepakkamesh. Building the dashboard is fairly straight forward. Just download the code and 'go build bin/main.go'. Its important Download the github forked versions of these libraries or alternatively add my forked version as another remote and do a git pull. I have submitted by fixes as a pull request to the owners of the repos but yet to hear back from them. Until then either approaches outlines above should work. The second approach is preferable since it does not break the import paths.

Hardware Build Details:

The hardware uses a CHIP single board computer. Its running a headless debian version for the OS. The CHIP comes with only one usb that I needed for a webcam. So I connected the TX/RX from the headers to the connectors on the roomba. The details of how to do that are available on the roomba website. Please follow the 3.3V logic instructions as the CHIP uses 3.3v logic.

I decided to power the CHIP directly from the serial port on the Roomba which has always on power. The roomba website also has a tutorial on how to accomplish this.

In addition, I tied the BRC pin to a GPIO pin on the CHIP and I pulse it for a second every minute ti prevent the Roomba from sleeping. 

Post a comment if you have any questions. 

YDLidar (lidar) X4 API in golang

YDLidar X4 This is a demo of the YDLidar using a golang API. The software supplied with the device only contains the drivers in C++ an...