Making your own SLAM robot

Sloth_Syntax
4 min readAug 6, 2023

--

Hello, in this blog, I’ll guide you through the exciting process of creating a SLAM robot — an autonomous vehicle capable of building maps and localizing itself within them. SLAM stands for Simultaneous Localization and Mapping, and it plays a crucial role in robotics and autonomous systems. Let’s explore the steps to build your own SLAM robot and introduce different visualization techniques to represent its movements on a map.

Step 1: Choosing the Right Microcontroller and Sensors

To get started, you’ll need a microcontroller capable of handling the robot’s computations and sharing data for map visualization. I recommend the Arduino Nano 33 BLE, which comes with a built-in LSM9DSL sensor — a 9-axis magnetometer, accelerometer, and gyroscope. This sensor eliminates the need for external peripherals to track the robot’s movements and is supported by libraries that handle the complex equations for you.

Alternatively, if your chosen microcontroller lacks an integrated sensor, you can opt for the ADXL module, which reads 6-axis data and provides the necessary movement information for your robot.

In addition to the microcontroller and sensors, you’ll also require basic components such as BO motors, wheels, and obstacle-detection sensors like an Ultrasonic sensor.

Step 2: Visualization with Phyphox

For visualizing the map, I’ll be using the open-source app called Phyphox. Originally developed for STEM education, Phyphox has become a popular choice for various open-source projects. I’ll create a map/graph representing the robot’s position in the X and Y axes, along with the elevation of the robot (Z-axis). The data on the X-axis will indicate the robot’s distance from the initial point in the X-axis, and similarly, the Y-axis data will represent the distance traveled in the Y-axis. The Z-axis will showcase the robot’s elevation. Additionally, I’ll display the Orientation/Heading degrees of the robot to indicate its direction.

Link for Phyphox

Phyphox limitations include the inability to visualize data beyond 3 dimensions on a graph. However, I can overcome this by exporting the data as a CSV file and use it for further visualization, mapping, and exploratory data analysis (EDA). Feel free to explore other visualization methods that pique your interest and creativity!

Step 3: Interactive Visualization Techniques

There are several exciting ways to visualize the robot’s movements on the map. Let’s take a look at some options:

  1. 2D Plot with Arrows: I’ll plot the robot’s position along the X and Y axes using arrows to indicate its direction at each location. I’ll use different colors for movements or timestamps to show the robot’s path over time. Obstacles can be represented as circles or squares on the map.
  2. 3D Plot with Quivers: If I have data from the Z-axis, I’ll create a 3D plot with quivers (three-dimensional arrows) to display the robot’s motion and direction at each point. Obstacles can be visualized as three-dimensional objects as well.
  3. Heatmaps: If I have a lot of data, a heatmap can represent the density of the robot’s movement or the distance from the point. I’ll use color gradients to indicate high and low values, helping me identify patterns and areas of interest.
  4. Trajectory Animation: I’ll create an animation showing the robot’s movement over time. I can use a moving dot or a small robot icon that updates with each new set of X, Y, and direction readings to demonstrate the robot’s position and motion.
  5. Interactive Web Application: For a more engaging experience, I’ll build an interactive web application that allows users to explore the robot’s movements and obstacle data. Users can pan, zoom, and interact with the visualization to view the robot’s actions from various angles.

Conclusion

Building a SLAM robot and visualizing its movements on a map is a thrilling project that combines robotics, programming, and creativity. Whether you follow my recommended approach using the Arduino Nano 33 BLE and Phyphox or experiment with different microcontrollers and visualization techniques, the possibilities are endless.

Let me know in the comments which approach you find easier and more fun, and don’t hesitate to share your own experiences and ideas! Happy building and mapping!

--

--

Sloth_Syntax
Sloth_Syntax

Written by Sloth_Syntax

Tech enthusiast exploring AI, robotics, and embedded systems. Sharing insights, innovations, and stories that bridge engineering concepts with real-world impact

No responses yet