This repository is one of two parts of my dissertation for my master's at Oxford Brookes University. See also my repository for making FastSLAM, the other part of my dissertation.
This is an implementation of biologically-inspired simultaneous localisation and mapping (SLAM) for a self-driving car.
BioSLAM works through the use of a Kohonen network, a type of neural network used for unsupervised competitive learning that results in a self-organising map (SOM). As a winner-take-all network, only one node (called the best matching unit, or BMU) in the output layer wins at each timestep. The BMU has its weights adjusted the most, and the 'neighbourhood' of nearby nodes have weights adjusted proportionate to their distance from the BMU, where nearby nodes are adjusted considerably and far off nodes are adjusted just barely or not at all.
The design for this implementation was mostly inspired by these sources:
- AI-Junkie's C++ tutorial for a self-organising feature map
- 'Having Fun with Self-Organising Maps' by Cosmo's Blog
- Chapter 9 of Introduction to the Theory of Neural Computation by Hertz, Krogh, and Palmer, 1991
- Assumes an existing ROS 2 installation (Dashing or newer). If you are using a distro other than Dashing, replace 'dashing' in the following terminal commands with your distro name.
- This package also uses the following Python3 libraries:
- NumPy
- Matplotlib
- Open a terminal and source your ROS installation
source /opt/ros/dashing/setup.bash
- Create a new directory for your ROS 2 workspace (if you won't be using an existing one). For instance, if you named your workspace
ws
and placed it in your home directory:
mkdir -p ~/ws/src
- Clone this repository into the
src
directory of your ROS 2 workspace
cd ~/ws/src
git clone https://github.com/ibvandersluis/bioslam.git
- Also clone dependent packages
git clone https://gitlab.com/obr-a/integration/ads_dv_msgs.git
git clone https://gitlab.com/obr-a/integration/obr_msgs.git
git clone https://gitlab.com/obr-a/integration/helpers.git
- Resolve package dependencies
cd ~/ws
rosdep install -i --from-path src --rosdistro dashing -y
- Build (this will take a couple minutes when building packages for the first time)
colcon build --symlink-install
After you have run colcon build
:
-
By default, this code will plot results but will not output any debugging files. To change this, go to
bioslam/bioslam/main.py
and set the global variableDEBUGGING
toTrue
. Running FastSLAM will then cause the code to make a folderbioslam_debug
in the working directory and populate it with debug files. Similarly, plotting can be turned off by settingPLOTTING
toFalse
, which will considerably increase the speed of the code. -
Open 2 new tabs in your terminal and source the workspace in each
cd ~/ws
. install/setup.bash
- In one of the new tabs play the rosbag. Some rosbags are included in the
fastslam/bags
directory
ros2 bag play <path_to_rosbag>
- In the other new tab run the FastSLAM node
ros2 run bioslam main