Embedded C for Self Driving Car Part 1

1 minute publication
5 min readMay 9, 2022

Integer Type

Photo by David von Diemar on Unsplash

So you are ready to write embedded code for a self-driving car like WAYMO or a smart thermostat like Nest. You want to write a code that will go to a specific processor to analyze certain sensor data to make decisions like make a right turn or turn on the heat.

Let’s sit back, and think a little deep. Let’s break down the problem. Let’s only focus on one particular part of the problem.

As an example, I am going to only talk about a single problem that will process the current location of self-driving vehicle which in technical jargon is called LOCALIZATION. Which in my experience is the most difficult problem technically.

In the localization problem, there are multiple sensors data that help make a decision about the current location, the direction it is heading as well as posture(JUMPING like a TRX). We will focus on thinking that the vehicle is going to move forward and we only need to know how much it moved forward.

Photo by Jorgen Hendriksen on Unsplash

Let’s simplify the problem more. We will assume that there will not be any slipping of the tire like the way bald guys drive in FAST & FURIOUS. And also let’s assume the tire is perfectly round and each rotation of the tire converted into circumference can confidently give you how much distance we moved forward.

Given, we know the tire size, we just need to know how many times the tire rotated. For that, we have a sensor called an encoder, which keeps track of wheel rotation.

Photo by Bechir Kaddech on Unsplash

You can think of an encoder as the bike wheel. In the picture, it shows the spoke in the wheel. You can see from the picture that there are around 48 spokes for the wheel.

Now if I become a tiny person embedded into the front FORK of the bicycle, and I have uni-directional vision like an eye strapped on a goat, I can only see one spoke at a time.

--

--

1 minute publication

MY GOAL IS TO CREATE CONCISE CONTENT AND NOT TO WASTE YOUR TIME LIKE A BUNCH OF CLICK & BAIT CHANNELS.