Nox is a nice (and time-consuming) robot which uses SLAM (ROS) with a Kinect to navigate in its environment.Nox is a differential-drive robot built using ROS, Raspberry Pi and Arduino. I started the project as a robot base with basic navigation I could then use for other things, like a vacuum cleaner.
However I quickly decided to make it a standalone robot with a proper design, as it's often missing in DIY robots. In its current state the robot can use SLAM (gmapping) to create a map of its surroundings (using the Kinect depth perception to detect wall and obstacles) and localize itself within the map. It can plan a path to a given goal and drive to it avoiding obstacles.
Nox is powered by a 11.1v Lithium-Ion battery and driven by two motors. The front panel can be removed to change the battery. A slotted hole and a screw fasten it and allow to put batteries of different lengths. I put a battery alarm with a screen to monitor the level.
The motors are two 12v DC motors (107rpm) from Banggood. They are nice but I actually don't need the robot to go that fast and I would have been okay to trade some of the speed for more accurate encoders.
The lights on the side are recycled from a New Year's Eve glowing stick I got for free and serve to indicate the robot states. When the Arduino is not connected to the ROS master (indicating that the robot program has not started yet) the lights blink three times in a row very quickly. When driving, the lights have a more “breathing”-looking blink and the blinking speed depends on the robot speed.
Not connect blinking
As stated above, the robot is a differential drive one, so the motor are placed on the same axis. The base is made of wood with two caster wheels for support. I initially planned on using one caster wheel to avoid the hyperstatic thing but couldn't find a good-sized one. The rest of the structure is made mainly of wood and metal brackets, easy to find in any DIY retail store. On the rear part of the robot plates can be stacked to put the electronic boards on.
The carter is made of black plastic plate, cut and glued by hand (will definitely use 3D printing next time).
On the inside the main controller is a Raspberry Pi 3B running Ubuntu and ROS. The Raspberry can be accessed from a outside computer through WiFi and ssh to give order to the robot. The ROS program carries out odometry calculation, navigation planning, and mapping using the Kinect. The Raspberry Pi sends the velocity command to an Arduino which controls the two motors with a PID through an Adafruit Motor Shield. It reads the value of the encoder, calculate the speed of each motor and send back the value to the Raspberry for odometry calculation. Arduino and Raspberry Pi are connected by USB and the Arduino program acts as a ROS node (look for rosserial for more info).
I used different types of Arduino before settling down for the good one. At first I used the basic Arduino Uno but I didn't have enough interrupt pins to read the encoder values with (the best method to do so with Arduino). The speed and accuracy were limited as I had to resort to other programing tricks to make it work. I tried using an Arduino Leonardo but the limiting factor was memory and I had to finally switch to an Arduino Mega 2560. A blessing in disguise as I have plenty of memory and pins left to add new functions now.
Kinect 360 was part of the project from the start, as I wanted to do SLAM (Simultaneous Localization And Mapping) but without spending a ton of money on a lidar. A kinect is basically a 25€ 3D-camera (of course don't expect the same accuracy as an Hokuyo) and, in addition to the depth scanning needed for SLAM, can be also used for computer vision, has an accelerometer and a microphone array. All of which being handy for the following steps of the project.
Two DC converters are used to convert the voltage. The motor are running directly with the battery voltage (more or less 11.1v). The command part (including Raspberry Pi, Arduino and encoders) is running on 5V converted from the battery. The Kinect needs a 12v stabilized voltage and a converter provides it from the battery too.
On the software part, I used ROS Kinetic. The only node I really wrote is the “nox_controller” which, as his name doesn't really imply, is used to compute the odometry from the Arduino data (motor speed). The model used for the calculations can be found in the paper “On Differential Drive Robot Odometry with Application to Path Planning” (I actually did my own formulas but they are the same, anyway the paper is worth a read). Covariance matrices are given in the odometry but not currently used (however it will become useful if I'm integrating a IMU to the odometry).
In the Arduino the motor control is done through PWM. A PID is supposed to manage each motor speed but as the PWM/motor speed ratio is very linear I got good result with a direct command of the speed and desactivated the PID for now. Don't worry though correct PID implementation and calibration is on its way.
Read More Detail :Nox – A House Wandering Robot (ROS)