<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Think Autonomous - Medium]]></title>
        <description><![CDATA[How do autonomous vehicles work? How to get in the industry? What skills should you master? Learn everything you need here! - Medium]]></description>
        <link>https://medium.com/think-autonomous?source=rss----1b935c077b55---4</link>
        <image>
            <url>https://cdn-images-1.medium.com/proxy/1*TGH72Nnw24QL3iV9IOm4VA.png</url>
            <title>Think Autonomous - Medium</title>
            <link>https://medium.com/think-autonomous?source=rss----1b935c077b55---4</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 28 Nov 2026 21:46:39 GMT</lastBuildDate>
        <atom:link href="https://medium.com/feed/think-autonomous" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Cruise Automation  —  A Self-Driving Car Company]]></title>
            <link>https://medium.com/think-autonomous/cruise-automation-a-self-driving-car-company-4dee84ace02d?source=rss----1b935c077b55---4</link>
            <guid isPermaLink="false">https://medium.com/p/4dee84ace02d</guid>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[self-driving-cars]]></category>
            <category><![CDATA[deep-learning]]></category>
            <category><![CDATA[autonomous-cars]]></category>
            <category><![CDATA[robotics]]></category>
            <dc:creator><![CDATA[Jeremy Cohen]]></dc:creator>
            <pubDate>Thu, 26 Nov 2020 14:05:10 GMT</pubDate>
            <atom:updated>2021-07-30T16:41:54.136Z</atom:updated>
            <content:encoded><![CDATA[<h3>Cruise Automation — A Self-Driving Car Startup</h3><blockquote>This article has been updated on <a href="https://www.thinkautonomous.ai/blog/?p=cruise-self-driving-car">https://www.thinkautonomous.ai/blog/?p=cruise-self-driving-car</a></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/720/1*4VX394-GOuljpbqRTK-Mig.jpeg" /></figure><blockquote>Cruise Automation is a self-driving car company whose goal is to deploy safe self-driving cars at scale.</blockquote><blockquote>Founded in 2013, they develop self-driving cars that can take passengers from A to B in a safe and comfortable way. I got interested in their system and watched a few videos and interviews to get back to you with a concise analysis.</blockquote><blockquote><strong>What’s behind their system? What algorithms are in use? Can they compete with Waymo and Tesla to provide autonomous driving at scale?</strong></blockquote><blockquote>Let’s take a look at Cruise Automation…</blockquote><h4>📩 Before we start, I invite you to join the mailing list by leaving you email below! This is the most efficient way to understand autonomous tech in depth and join the industry faster than anyone else.</h4><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fupscri.be%2Fzwdjy9%3Fas_embed%3Dtrue&amp;dntp=1&amp;display_name=Upscribe&amp;url=https%3A%2F%2Fupscri.be%2Fzwdjy9&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=upscri" width="800" height="400" frameborder="0" scrolling="no"><a href="https://medium.com/media/aea2b0fbf65889a03f5950bf090094c5/href">https://medium.com/media/aea2b0fbf65889a03f5950bf090094c5/href</a></iframe><h3><strong>How it started</strong></h3><p><strong>Cruise was founded around 2013 by Kyle Vogt and Dan Kan. </strong>Their main activity was highway Autopilot for Audi: Identifying lane lines with a RADAR/Camera system.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*sV7pJcyYeQD5rXaz.png" /><figcaption>(<a href="https://www.youtube.com/watch?v=s-8cYj_eh8E&amp;__s=xxxxxxx">source</a>)</figcaption></figure><p><strong>Then, Cruise wanted to do more: and moved to fully autonomous cars:</strong></p><ul><li>In 2015, they added LiDAR to allow for urban driving.</li><li>The startup went to an acceleration program called Y-Combinator.</li><li><strong>A year later, they got acquired by General Motors and grew massively.</strong></li></ul><p>They moved garage a few times, and named all of their self-driving cars after MARVEL’s characters: Scarlett, Iron Man, …</p><blockquote><strong>Today, Cruise is a huge team of over 1,600 engineers working to solve on of the most interesting and challenging problem of them all: Urban Autonomous Driving.</strong></blockquote><h3><strong>Self-Driving Cars in one image</strong></h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*SuIkEcZ3IYTYjZvFa5WMog.png" /></figure><p>This article will detail the Perception stack, and then briefly mention the rest.</p><h3>Perception</h3><p>In <a href="https://www.youtube.com/watch?v=s-8cYj_eh8E&amp;__s=xxxxxxx">this interview from 2017</a>, former Head of Computer Vision Peter Gao describe Cruise’s problem as tough and unpredictable.</p><blockquote>Funny story, I looked for Peter Gao on LinkedIn and found a second Peter Gao, also working on self-driving cars… but for Waymo.</blockquote><p><strong>Cruise’s Perception system uses LiDARs, Cameras, and RADARs. </strong>Cameras and RADARs can be a good fit for highway autopilot, but LiDAR adds a lot of information when it comes to urban driving and pedestrian detection.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*gYVRW8Ij5Sxvy0_N.png" /><figcaption>(<a href="https://www.youtube.com/watch?v=s-8cYj_eh8E&amp;__s=xxxxxxx">source</a>)</figcaption></figure><p>Let’s start with the camera…<br>In this article, I’ll mention a process called “Sensor Fusion”… the idea is to fuse data coming from different sensors (for example a camera and a LiDAR) and thus take advantage of both sensors. More on Sensor Fusion <a href="https://towardsdatascience.com/sensor-fusion-90135614fde6">here</a>.</p><h4><strong>How does the Computer Vision system work?</strong></h4><p>Computer Vision is everywhere in autonomous driving: to find lane lines, obstacles, or even traffic signs and lights… we need to use the camera and Computer Vision algorithms…</p><p><strong>Cruise has a process working in 5 Steps</strong>:</p><ul><li>Camera Calibration</li><li>Time Calibration — Sensor Fusion</li><li>Labeling — Active Learning</li><li>Big Data — Fleet Management</li><li>Perception Tasks — Detection, Tracking, …</li></ul><h4><strong>Camera Calibration</strong></h4><p>Every camera needs calibration. It helps with 3D geometry, but also to get an accurate image.</p><ul><li><strong>Intrinsic Calibration helps with camera image rectification </strong>— removing the GoPro effect and thus having a rectified image.</li><li><strong>Extrinsic Calibration is a camera/car calibration</strong> — it helps with Sensor Fusion and 3D projections later.</li></ul><p>In the following image, you can see the results of extrinsic calibration. The closer the object, the greener.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*NV-oTissYNObmiYc.png" /><figcaption>(<a href="https://www.youtube.com/watch?v=s-8cYj_eh8E&amp;__s=xxxxxxx">source</a>)</figcaption></figure><p>👉 If you’d like to learn more about calibration, check my article <a href="https://medium.com/think-autonomous/pseudo-lidar-stereo-vision-for-self-driving-cars-41fa1ac42fc9?__s=xxxxxxx">Pseudo-LiDAR: Stereo Vision for Self-Driving Cars</a>.</p><h4><strong>Time Calibration</strong></h4><p>One of the key aspects of Sensor Fusion is to match a frame from camera to a frame from LiDAR…but these must be taken at the exact same time!</p><p>Time Calibration is made using a process called phase locking: the LiDAR is scheduled to arrive at a certain point of the rotation at a certain point in time.</p><h4><strong>Labeling</strong></h4><ul><li>There is a lot of Machine Learning at Cruise. Labeling is therefore an essential task.</li><li>2D Obstacles, tracking, lane lines, freespace, traffic lights and signs, hazard lights, and much more must be detected…</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*x7g2OBF37nr4n1Td.png" /><figcaption>(<a href="https://www.youtube.com/watch?v=s-8cYj_eh8E&amp;__s=xxxxxxx">source</a>)</figcaption></figure><h4><strong>Big Data</strong></h4><ul><li>Every vehicle generates hundreds of Terabytes every single day. If you’ve followed my course <a href="https://courses.thinkautonomous.ai/ros?__s=xxxxxxx">START WITH ROS</a>, you know that a 20 seconds recording is already over 5 Gb.</li><li>The number of cars is set to grow exponentially, and the resolution of cameras as well…</li><li>Cruise uses Spark to aggregate data and do cool operations such as query or even multi-machine training…</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KLhCDryblD0olW11gv1WlQ.png" /><figcaption>(<a href="https://towardsdatascience.com/sensor-fusion-90135614fde6">source</a>)</figcaption></figure><blockquote>We have a brief idea of the sensors, and the pipeline cruise uses. How do they actually detect obstacles?</blockquote><h3>Autonomous Driving Tasks</h3><blockquote>Cruise is doing Urban driving. Urban driving introduces a lot of complex scenarios that are not present in community driving or highway driving. For example, we must detect traffic lights, define and understand what is a double parked cars, overtake a vehicle, predict their moves, …</blockquote><h4><strong>​Traffic Light Detection</strong></h4><p>Cruise drives primarily in San Francisco, here’s an example of the traffic lights they classified.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*naOu3Sn1VsVa0lTP.png" /><figcaption>(<a href="https://www.youtube.com/watch?v=s-8cYj_eh8E&amp;__s=xxxxxxx">source</a>)</figcaption></figure><blockquote>As you can see, the problem is complex : it’s not just green, yellow, and red.</blockquote><p>There can be multiple colours, directions, flashing lights, and all of these new things every single day.</p><p>The problem is still a classification/obstacle detection one, but with more than the 3 classes you would expect. In reality, traffic lights and signs are some of the most difficult problems due to the diversity of signs we can have for a single class.</p><blockquote>As a comparison, it’s only a few months ago in 2020 that Tesla (which leads the automation race so far) announced it can now detect traffic lights.</blockquote><h3><strong>3D Obstacle Detection &amp; Sensor Fusion</strong></h3><p>Cruise detects obstacles in 2D, and then transpose them in the 3D space.</p><p><strong>How? </strong>The 2D obstacles are fused with LiDAR and RADAR 3D features, and then projected thanks to the camera’s extrinsic parameters.</p><p><strong>In my </strong><a href="https://heartbeat.fritz.ai/lidar-camera-fusion-in-self-driving-cars-18d080874c71?__s=xxxxxxx"><strong>LiDAR and Camera fusion in self-driving cars article</strong></a><strong>, I describe two fusion processed called Early and Late Fusion.</strong></p><ul><li>Early fusion is about fusing the pixels and images features with the LiDAR point cloud before even running a detection algorithm. The fusion is the first operation made.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*oMwG4AG5GnxjQCKald4WiA.png" /></figure><ul><li>Late fusion is about fusing the independent results: a 2D bounding Box coming from a camera with a 3D one coming from a LIDAR.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*FmtYHK3CzuaYKe4PiBRpuQ.png" /></figure><blockquote><strong>Cruise is doing late fusion: Obstacles are processed individually, and then fused.</strong></blockquote><p>In the following image, you can see 2D obstacles (on the left) and their 3D projection (on the right).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*j0QegKapR1DiEXRk.png" /><figcaption>(<a href="https://www.youtube.com/watch?v=s-8cYj_eh8E&amp;__s=xxxxxxx">source</a>)</figcaption></figure><h3><strong>Vehicle Light Detection — Double Parked Vehicles</strong></h3><p>Cruise drives mainly in San Francisco. When getting used to this city, they noticed something very common: double parked vehicles. <br>In San Francisco, double parked vehicles are everywhere.<strong> </strong>Whether it’s legal or not, it happens. A self-driving car has to adapt… or it will never drive over a minute.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*RMG9p4X3EE72slwpvMIHJw.gif" /><figcaption>(<a href="https://venturebeat.com/2019/06/27/heres-how-cruises-autonomous-cars-navigate-double-parked-cars/">source</a>: <a href="https://venturebeat.com/2019/06/27/heres-how-cruises-autonomous-cars-navigate-double-parked-cars/">https://venturebeat.com/2019/06/27/heres-how-cruises-autonomous-cars-navigate-double-parked-cars/</a>)</figcaption></figure><blockquote><a href="https://venturebeat.com/2019/06/27/heres-how-cruises-autonomous-cars-navigate-double-parked-cars/">From the same source</a> (VentureBeat) — In order to do this, Cruise’s cars must first identify them, which they accomplish by “looking” for a number of cues such as vehicles’ distance from road edges, the appearance of brake and hazard lights, and distance from the furthest intersection. They additionally use contextual cues like vehicle type (delivery trucks double-park frequently), construction activity, and the relative scarcity of nearby parking. […]</blockquote><blockquote><strong>And later we can read that Recurrent Neural Networks (RNNs) are used to determine whether or not a car is double parked thanks to their long-term memories. We can’t determine if a car is double-parked using a single frame, we must use a sequence of images.</strong></blockquote><p><strong>The Vehicle Light detection model which allows to:</strong></p><ul><li>confirm if a car is parked</li><li>detect if a park is momentarily stopped (hazard lights)</li><li>detect car intents with directionals</li></ul><p>The planning system can then adapt: if a car is stopped but with no directionals, it can mean that it’s just paused for a few seconds. So we shouldn’t overtake.</p><p>If it’s stopped and has the hazard lights on, let’s overtake.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*8cwz13wq0kLCuo9m.png" /><figcaption>(<a href="https://www.youtube.com/watch?v=s-8cYj_eh8E&amp;__s=xxxxxxx">source</a>)</figcaption></figure><p><strong>Those are the core elements of Perception.</strong></p><h3><strong>Obstacle Prediction</strong></h3><p>Today, a Cruise vehicle can detect a lot, it can even predict pedestrian and cars’s intents for the future. Every obstacle will have this green arrow representing the future positions.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Cee86CGovfXJtftJ.png" /></figure><blockquote>Prediction is when we take the detected obstacles and project their state (position, velocity) a few seconds into the future…</blockquote><p>In my <a href="https://courses.thinkautonomous.ai/tracking-pack?__s=xxxxxxx">Tracking Pack</a>, I use obstacle detection, Hungarian matching, and Kalman Filters to implement the SORT algorithm that detects, tracks, and predict every obstacle’s position. Cruise is probably using similar techniques too, but when it comes to intersections, it’s purely a learning approach.</p><p><strong>Cruise has a fleet of dozens of vehicles: they leverage it. <br></strong>How? Every vehicle is independently seeing different situations, and can therefore learn from the other vehicles.</p><p>Vehicles drove thousands of hours in San Francisco… They learned the trajectories in specific situations. There are some edge cases, a lot of them, but it’s still a learning problem.</p><p>In the following image, we can see a simplified vision of their approach…</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/852/0*eUpV6aKuQZUTh7lF.png" /><figcaption>(<a href="https://www.youtube.com/watch?v=-UPfyvDJz9I&amp;__s=xxxxxxx">source</a>)</figcaption></figure><ul><li>First, we can see that this is a classification problem.<br>The vehicle has a 30% chance of turning right, 30% left, and 40% chance of going straight.</li><li>Trajectories are computed, with likely (green) and unlikely (black) ones.</li><li>The model is evaluated, and there is a retraining process in a closed feedback loop.</li><li>Let’s see it in more details...</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/860/0*NyYeA4c8_Bmix-6C.png" /><figcaption>(<a href="https://www.youtube.com/watch?v=-UPfyvDJz9I&amp;__s=xxxxxxx">source</a>)</figcaption></figure><p>This is similar to an <a href="https://www.thinkautonomous.ai/articles-active-learning/?__s=xxxxxxx">active learning problem</a>: but they call in Continuous Fleet Learning.</p><p><strong>Today, Cruise’s system is so much more powerful than what I just quoted.</strong></p><p>Cruise has been able to drive years in San Francisco…</p><p>They can do specific maneuvers like unprotected lefts, but they also can drive in streets full of children safely, climb hills, and they only need about 1 operator for every 10 vehicle.</p><p><strong>Their system is impressive and very smooth but we don’t know much about their time spent driving outside of San Francisco.</strong></p><p>It raises an important question about Company owned Fleet and Customer Owned Fleet.</p><ul><li>Tesla is not controlling its fleet, the users are. They can be in the UK, in France, or in the US. And it’s data from all of these countries fed to Tesla’s system.</li><li>Cruise decides where the fleet is operating but therefore is not forced to discover new regions.</li></ul><h3>Control</h3><p>A final word on the controllers used. The goal of the control command part is to generate a steering angle and an acceleration value to follow the computed trajectory.</p><blockquote>Cruise uses a Model Predictive Control algorithm to do so. You can read more about these type of algorithms in my article <a href="https://towardsdatascience.com/the-final-step-control-783467095138?gi=b3bf2db08a7e">Control Command in Self-Driving Cars</a>.</blockquote><h3>Conclusion</h3><blockquote>Building Self-Driving Cars is a dream, and not an easy one. With their system, Cruise proves that it can compete with the most advanced companies in the world by using state of the art algorithms, and continuously evolving their system.</blockquote><blockquote>👉 If you’d like to go further and learn to code self-driving cars yourself, I’m having <a href="https://courses.thinkautonomous.ai/?coupon=BLACKFRIDAY">a massive 70% discount on my self-driving car courses</a> for Black Friday! Go check it out!</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*vjiz0c0AyfwNIeKvbabc6g.jpeg" /></figure><blockquote>Jeremy Cohen</blockquote><h3><strong>Go further with Cruise—</strong></h3><ul><li>I highly recommend watching <a href="https://www.youtube.com/watch?v=s-8cYj_eh8E&amp;__s=xxxxxxx">this video</a> where most of my images are from.</li><li>Other images are from <a href="https://www.youtube.com/watch?v=-UPfyvDJz9I&amp;__s=xxxxxxx">this video</a>, specifically about prediction.</li><li>If you’d like to see Cruise in 2020, you can watch <a href="https://www.youtube.com/watch?v=sliYTyRpRB8&amp;__s=xxxxxxx">this great interview from Cruise’s founder Kyle Vogt</a>.</li><li><strong>Cruise built a ROS Visualizer called Webviz</strong>. It allows to see RADAR output, LiDAR point clouds, and camera images.<br><a href="https://webviz.io/?__s=xxxxxxx">Play with it here</a>.</li><li>👉 It’s very similar to the work we do in my course <a href="https://courses.thinkautonomous.ai/ros?__s=xxxxxxx">START WITH ROS: Build Real Robotics Applications on the edge</a> that I highly recommend to get closer to real self-driving car building.</li><li>Cruise’s interns seem happy 😛 <a href="https://www.youtube.com/watch?v=mmWcGmP4pDk&amp;__s=xxxxxxx">Watch their video here</a>.</li><li>You can learn more about Cruise <a href="https://www.getcruise.com/technology?__s=xxxxxxx">on their website</a>.</li><li>If you didn’t understand anything, I recommend you take my 19.99€ course <a href="https://courses.thinkautonomous.ai/self-driving-cars?coupon=STARTTOTHINKAUTONOMOUS&amp;__s=xxxxxxx"><strong>SELF-DRIVING CARS: Break into the cutting-edge world</strong></a>.</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4dee84ace02d" width="1" height="1" alt=""><hr><p><a href="https://medium.com/think-autonomous/cruise-automation-a-self-driving-car-company-4dee84ace02d">Cruise Automation  —  A Self-Driving Car Company</a> was originally published in <a href="https://medium.com/think-autonomous">Think Autonomous</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Robotic OS — Embedded Computer Vision on Raspberry Pi 4]]></title>
            <link>https://medium.com/think-autonomous/robotic-os-embedded-computer-vision-on-raspberry-pi-4-a53f82ab9d03?source=rss----1b935c077b55---4</link>
            <guid isPermaLink="false">https://medium.com/p/a53f82ab9d03</guid>
            <category><![CDATA[robotics]]></category>
            <category><![CDATA[computer-vision]]></category>
            <category><![CDATA[deep-learning]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[self-driving-cars]]></category>
            <dc:creator><![CDATA[Jeremy Cohen]]></dc:creator>
            <pubDate>Tue, 13 Oct 2020 14:37:37 GMT</pubDate>
            <atom:updated>2021-07-30T16:33:46.131Z</atom:updated>
            <content:encoded><![CDATA[<h3>Robotic OS — Embedded Computer Vision on Raspberry Pi 4</h3><blockquote>This article has been updated on <a href="https://www.thinkautonomous.ai/blog/?p=robotic-os-embedded-computer-vision-on-raspberry-pi-4">https://www.thinkautonomous.ai/blog/?p=robotic-os-embedded-computer-vision-on-raspberry-pi-4</a></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*-nokMJmMHtfC8Lrefru3dA.jpeg" /></figure><blockquote>Robotic OS has been widely used for years as the go-to solution for any company or student building an autonomous robot. As I am teaching more and more people about self-driving cars and Computer Vision, I thought it would be interesting to try and see how we can break the frontier between an online course and the real world…</blockquote><p>Most online courses on Computer Vision will tell you how to work on the image, very few will talk about the camera. As I saw a major problem occurring, I wanted to build a course on Embedded Computer Vision using ROS (Robotic OS).</p><h4><strong>Why ROS?</strong></h4><p>For sure, it’s quite easy to find a tutorial on obstacle detection using a Raspberry Pi. So why bother including ROS?</p><p><strong>The short answer: Obstacle detection for obstacle detection is pointless.<br></strong>Why would we draw 2D Bounding Boxes around pedestrians or vehicles is nothing is behind to interpret the data?<br>Why would we detect obstacles if not to make a decision based on the presence or absence of an obstacle?</p><p>So what do you do? You can print the detected bounding boxes, you can even print them in a file. But what then? No autonomous robot will ever read files to get the obstacles; it’s just not working.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ORyqGHxngP36tw1kge1KEw.png" /></figure><blockquote>For an autonomous system to work, you need something like ROS. ROS is the meta operating system behind at least half of the self-driving cars out there! I believe any aspiring self-driving car engineer has to learn about ROS, or the risk is simply to get rejected by half of the companies.</blockquote><p>In this article, I will explain how to developed an embedded Computer Vision system that can play a real self-driving car recording (also called a bag), and add algorithms on this; all using a Raspberry Pi.</p><p>Before that, if you’re interested in taking the ROS Course.<br>👉 Join on <a href="https://courses.thinkautonomous.ai/ros">thinkautonomous.ai/ros</a></p><h3>Robotic OS</h3><p>In order to understand how to build a self-driving car, you need to understand the general concepts behind ROS.</p><p><strong>ROS is using a Publisher/Subscriber architecture like the following.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*85kfxGB1Wc53z5RwzOyklA.png" /><figcaption>How ROS works</figcaption></figure><ul><li>A<strong> ROS node</strong> is the equivalent of a function or a mini program. Its role is to publish information (obstacles, position, …) that we call <strong>messages</strong>. Each message is published on a <strong>topic</strong>.</li><li>A Node that publishes information is called a <strong>Publisher</strong>. Those who listen to and use this information are called <strong>Subscribers</strong>. Generally, a node is both Subscriber and Publisher, except in specific cases (for example, the camera node is only a Publisher, it doesn’t subscribe to anything).</li></ul><p>This architecture makes it possible not to block the system if a module does not respond. Nodes publish no matter if there are other nodes listening.</p><ul><li>The set of nodes form a <strong>graph</strong>.</li></ul><blockquote><strong>The course’s project is using ROS to detect obstacles in an image and publish bounding box information.</strong></blockquote><p>Here would be the typical architecture of such a project in a real self-driving car environment.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GPZNzUnTRE3ZX2AtWz7nSw.png" /><figcaption>Self Driving Car ROS Architecture (<a href="http://udacity.com/">source</a>)</figcaption></figure><p>In this image, you can see:</p><ul><li>The sensors on the left are <strong>Publishers</strong>: They publish data like images, point clouds, ...</li><li>The rest are <strong>Nodes</strong>. Most subscribe to sensor data, or to other nodes, and then publish for the next node. All until we reach the controller, in charge of generating a steering and an acceleration value for the car.</li></ul><blockquote>We know that ROS is perfect for our problem: To build a useful obstacle detection algorithm that can be integrated in a real autonomous robot. Our next problem will be to find an embedded platform to use ROS.</blockquote><h3><strong>Choosing a ROS Platform—</strong></h3><p><strong>The Raspberry Pi has always found a community of edge Engineers who wish to build Do It Yourself projects.<br></strong>What is it? It’s a mini-computer that is small, performant, and relatively cheap.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/900/1*X9UWxXGzHtCzSwq7rqIfjw.jpeg" /></figure><blockquote><strong>As I am building a new ROS course, I got interested in the Raspberry — Can this small device run ROS, embedded Computer Vision software, and be used as a remote platform for my students?</strong></blockquote><p>I looked into the Raspberry Pi 4 for a few weeks, I tried to understand how to use this tool the best I could… and how it would be a great use for my problem.</p><p>I also tried to see if other more appropriated devices such as the Nvidia Jetson Nano could be better suited. Here’s what I found —</p><h3>Raspberry Pi 4 vs. the rest</h3><p>If we are to build a Do It Yourself project, or something like Edge Computer Vision, a lot of possibilities appear.</p><ul><li>For example, I <a href="https://heartbeat.fritz.ai/vision-processing-units-vpus-6a33f282322e">recently wrote about VPUs</a> and the Intel Movidius NCS. That’s a super powerful USB Key that can be plugged to a computer and provide a lot of processing power.</li><li>More recently, the Nvidia Jetson Nano has been released and got a lot of attention.</li><li>Soon, the OpenCV AI Kit will be there as a revolutionizing tool.</li></ul><p>The last two computers have their own SDK; which means they won’t work right away.</p><p>Most Computer Vision and edge devices are very good when it comes to running an OpenCV program, but are they good when we have to work with Robotic OS, LiDAR point clouds, and GPIO sensors? Do they provide the possibility to plug any sensor and just make it work?</p><blockquote>This is one of the reasons I looked into the Raspberry Pi. It’s running Linux, has tons of GPIO possibilities, and can be used immediately! It’s more of a tiny computer than the rest because it wasn’t built for AI.</blockquote><p>It also has a lot of processing power, and the new 8Gb RAM version makes it super powerful! That, and the low price, are key elements.</p><blockquote>Imagine students enrolled in my course want to buy it and try it themselves, a Jetson Nano would be a 200$ investment. The Raspberry Pi 4 costs about 100$, which was great for my use.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1lJ24yP4NbMFtn_c9DPpvw.png" /><figcaption>(<a href="https://courses.thinkautonomous.ai/ros">source</a>)</figcaption></figure><blockquote>If you have the budget, you can probably go for a Jetson Nano or even better, but in our case, the Raspberry Pi 4 can totally work.</blockquote><h3>Raspberry Pi 4 — Prerequisites to work with ROS</h3><h4>Operating System</h4><blockquote>If a self-driving car has 4 elements (Perception, Localization, Motion Planning, Control); then we must use ROS to make these elements work together and build a real autonomous system.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Js6M9qSp2wMli-wFEOAe1Q.png" /><figcaption>ROS Modules in a self-driving car</figcaption></figure><p>Once I had the Raspberry Pi 4, and once I put it in the delightful red and white box, I had to use it with ROS.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/350/1*znK794nzzfXcB5Qr98rENw.png" /></figure><p>ROS is widely used, but there is a problem. ROS only runs with Ubuntu and Debian. The new version, ROS 2, works with Mac OS and Windows X, but not with Raspbian, the default Raspberry Pi OS.</p><blockquote><strong>For that reason, I had to change the OS and use Ubuntu 20.04 on my Raspberry Pi 4. </strong>I could install ROS Noetic on the Raspberry Pi 4.<br>This is where the fun begins!</blockquote><h4>32 vs 64 Bits</h4><p>The Raspberry Pi website provides everything necessary to install Ubuntu, but it requires us to choose between a 32 bit version and a 64 bit version. Using the 64 bit version helps using the full RAM of the Rapsberry (8Gb) and not just 2³² bits (4Gb). In our case, it’s can be necessity.</p><p>Some problems came, a 64 bit Ubuntu is great, but it doesn’t work with VNC.</p><h4>Remote Control</h4><p>VNC (Virtual Network Computing) is the go-to option for remote control. <br>I don’t want to plug a mouse and a keyboard on my Raspberry Pi. I want to plug my Raspberry Pi on my wifi box and use it on my Macbook Pro. Also, if students ever had to connect on it, it had to work.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/972/1*Q_gAs8r8oVxlDrvIBmmUjQ.png" /><figcaption>Using a Remote Control Solution</figcaption></figure><blockquote>Since VNC couldn’t work on Ubuntu 64 bits, I had to use another solution called Microsoft Remote Desktop that uses XRDP protocol.</blockquote><blockquote>We’re all set, we installed Ubuntu, ROS, and made sure we could fix any issue regarding the choices we made. We can now start to work with the project.</blockquote><h3>Building a ROS Project</h3><h4>The Project</h4><p>So what can we expect from our project?</p><p>Well, what if we plugged a camera and performed obstacle detection? What if we plugged a LiDAR and performed Point Cloud Processing? In reality, anything is possible.</p><blockquote>👉 In this project, I chose to focus on the camera aspect, but understand that we can do everything simultaneously.</blockquote><p><strong>Here’s the project architecture.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EJWzLkYFnygjalRcBNK3Zw.png" /><figcaption>Project Architecture</figcaption></figure><p><strong>The first thing I did is to play a Bag File.</strong></p><blockquote>A Bag File is a recording of everything that is going on in a self-driving car. We can record camera images, LiDAR data, and many more, and then play it. In my case, I had access to LiDAR, camera, RADAR, and GPS data.</blockquote><blockquote>I played the bag, and displayed interesting data. It all ran using 85% of CPU and 1/8 Gb of RAM, leaving plenty of space for the algorithms.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/480/1*jfJADrgGnw4I54CemBPFqA.gif" /></figure><p><strong>Why a bag file?<br></strong>When you use a Bag File, you replace the sensors. Instead of purchasing sensors and then going in the street to sense something, I just used someone else’s work and made it work on my computer.</p><blockquote>Most Engineers work with Bag Files. <br>They don’t go out every time they want to test something; they replay the events and see how their algorithms perform now.</blockquote><h4><strong>Embedded Computer Vision</strong></h4><p>My first intuition to teach students how to use ROS is to make them build a node (program) that would:</p><ul><li>Subscribe to the camera information</li><li>Publish the obstacles it found using a YOLOv4 algorithm.</li></ul><p><strong>All of that was possible, the students on the course learn to implement it.</strong></p><p>The course covers a lot of concepts and details to build the project:</p><ul><li>How to use CV Bridge and avoid popular errors (you can literally loose days)?</li><li>How to build obstacle detection algorithms on ARM Processors (on Raspberry Pi and other embedded devices)?</li><li>How to publish custom messages and make sure we can compile in every situation?</li><li>How to work in Python and C++ at the same time?</li><li>and many more…</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*x_zC9esgW3HnC6NvvwozXA.gif" /><figcaption>Obstacle Detection Topic using ROS and Tiny YOLOv4</figcaption></figure><p><strong>The course is called START WITH ROS: Build Real Robotics Applications on the edge and has a cool trailer:</strong></p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2F_Q9JbNeSVR0%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3D_Q9JbNeSVR0&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2F_Q9JbNeSVR0%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/c0ae6770e8fb7e064627d52a7abfa738/href">https://medium.com/media/c0ae6770e8fb7e064627d52a7abfa738/href</a></iframe><blockquote>👉 <a href="https://courses.thinkautonomous.ai/ros?coupon=LAUNCH">Join the course, and learn to build Embedded ROS Applications here.</a></blockquote><blockquote>The future of AI is tiny and on the edge. I didn’t say it, Harvard did on their website. Cloud Computing has allowed us to learn a lot about AI and Deep Learning, but it did hide an important part: the hardware.</blockquote><blockquote>In an autonomous robot, understanding the sensors, the hardware, and the platforms you’re working on is beyond mandatory; it’s part of the job.</blockquote><blockquote>The course will teach you the fundamentals of Robotic OS, but also important Hardware concepts you must know as an aspiring Self-Driving Car Engineer. It has everything you need to get started, and to keep building great projects on it.</blockquote><blockquote><strong>Jeremy Cohen</strong></blockquote><blockquote><a href="https://courses.thinkautonomous.ai/ros?coupon=LAUNCH">Join the course, and learn to build Embedded ROS Applications here.</a></blockquote><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fupscri.be%2Fzwdjy9%3Fas_embed%3Dtrue&amp;dntp=1&amp;display_name=Upscribe&amp;url=https%3A%2F%2Fupscri.be%2Fzwdjy9&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=upscri" width="800" height="400" frameborder="0" scrolling="no"><a href="https://medium.com/media/aea2b0fbf65889a03f5950bf090094c5/href">https://medium.com/media/aea2b0fbf65889a03f5950bf090094c5/href</a></iframe><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a53f82ab9d03" width="1" height="1" alt=""><hr><p><a href="https://medium.com/think-autonomous/robotic-os-embedded-computer-vision-on-raspberry-pi-4-a53f82ab9d03">Robotic OS — Embedded Computer Vision on Raspberry Pi 4</a> was originally published in <a href="https://medium.com/think-autonomous">Think Autonomous</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Pseudo-LiDAR — Stereo Vision for Self-Driving Cars]]></title>
            <link>https://medium.com/think-autonomous/pseudo-lidar-stereo-vision-for-self-driving-cars-41fa1ac42fc9?source=rss----1b935c077b55---4</link>
            <guid isPermaLink="false">https://medium.com/p/41fa1ac42fc9</guid>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[autonomous-cars]]></category>
            <category><![CDATA[deep-learning]]></category>
            <category><![CDATA[self-driving-cars]]></category>
            <category><![CDATA[computer-vision]]></category>
            <dc:creator><![CDATA[Jeremy Cohen]]></dc:creator>
            <pubDate>Mon, 07 Sep 2020 14:43:57 GMT</pubDate>
            <atom:updated>2021-10-20T18:03:35.752Z</atom:updated>
            <content:encoded><![CDATA[<h3>Pseudo-LiDAR — Stereo Vision for Self-Driving Cars</h3><blockquote>An updated version of this Pseudo-LiDAR article has been published on <a href="https://www.thinkautonomous.ai/blog/?p=pseudo-lidar-stereo-vision-for-self-driving-cars">https://www.thinkautonomous.ai/blog/?p=pseudo-lidar-stereo-vision-for-self-driving-cars</a></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/850/1*-Ud3oyk-NQisyojzRU21BQ.png" /></figure><p>Stereo Vision for Self-Driving Cars is becoming more and more popular these days. The field of Computer Vision grew intensely over the last decade, especially for obstacle detection and Computer Vision using Deep Learning.</p><p>Obstacle detection algorithms such as YOLO or RetinaNet provide 2D Bounding Boxes giving the obstacles’ position in an image using Bounding Boxes. <strong>Today, most object detection algorithms are based on monocular RGB cameras and cannot return the distance of each obstacle.</strong></p><p>To return the distance of each obstacle, Engineers fuse the camera with LiDAR (Light Detection And Ranging) sensors that use lasers to return depth information. Outputs from Computer Vision and LiDAR are fused using Sensor Fusion.</p><p>The problem with this approach is the use of LiDAR, which is expensive. <strong>One useful trick engineers use is to align two cameras and use geometry to define the distance of each obstacle: We call that new setup a Pseudo-LiDAR.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*RK9riBul8qOae6Il.png" /></figure><p>Monocular vs Stereo Vision</p><p>Pseudo LiDAR leverages geometry to build a depth map and combines this with object detection to get the distance in 3D.</p><h3>Depth estimation in 5 Steps</h3><p>From 2 cameras, we can retrieve the distance of an object. This is the principle of triangulation, and this is the core geometry behind Stereo Vision. Here’s how it works:</p><ol><li><a href="https://www.thinkautonomous.ai/blog/?p=pseudo-lidar-stereo-vision-for-self-driving-cars#calibration"><strong>Stereo Calibration</strong></a><strong> </strong>— Retrieve the key parameters from the camera</li><li><a href="https://www.thinkautonomous.ai/blog/?p=pseudo-lidar-stereo-vision-for-self-driving-cars#epipolar"><strong>Epipolar Geometry</strong></a> — Define the 3D Geometry of our Setup</li><li><a href="https://www.thinkautonomous.ai/blog/?p=pseudo-lidar-stereo-vision-for-self-driving-cars#disparity"><strong>Disparity Mapping</strong></a> — Compute the Disparity Map</li><li><a href="https://www.thinkautonomous.ai/blog/?p=pseudo-lidar-stereo-vision-for-self-driving-cars#depth"><strong>Depth Mapping</strong></a> — Compute a Depth Map</li><li><a href="https://www.thinkautonomous.ai/blog/?p=pseudo-lidar-stereo-vision-for-self-driving-cars#obstacles"><strong>Obstacle Distance Estimation</strong></a> — Find objects in 3D, and Match with the Depth Map</li></ol><p>In this article, we’ll learn how to do these 5 steps to build a 3D Object Detection Algorithm, the goal will be that for each object, we can estimate the X,Y,Z position.</p><p>📩 Before we start, <a href="https://thinkautonomous.leadpages.co/serve-leadbox/52aqmJY9AnvEDvVV8w8g2P/">I invite you to join the mailing list by leaving you email below!</a> It’s something I’ve been running daily for 2 years, and that helped tens of thousands of Engineers learn cutting-edge skills. <a href="https://thinkautonomous.leadpages.co/serve-leadbox/52aqmJY9AnvEDvVV8w8g2P/">Join here.</a></p><h3>1. Stereo Calibration — Intrinsic and Extrinsic Calibrations</h3><blockquote><em>When looking at any image on the internet, it’s likely that the camera has been calibrated. Every camera needs calibration. Calibration means converting a 3D point (in the world) with [X,Y,Z] coordinates to a 2D Pixel with [X,Y] coordinates.</em></blockquote><p>The output of this step is simple:<strong> we need the camera intrinsic and extrinsic parameters</strong>. These will be used later to retrieve the distance.</p><h4>How are images created?</h4><p>Cameras today use the Pinhole Camera model. The idea is to use a pinhole to let a small number of ray lights through the camera and thus get a clear image.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*lL2rI5gvWIzLAi8z.png" /></figure><p>Today, <strong>cameras are using a lens</strong>, to zoom and get a better clarity. As you can see, the lens is located at a distance f to the sensor. This distance f is called the focal length.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*PGvkhlN5y-3rABQX.png" /></figure><p>A few lines ago, I mentioned that the goal of camera calibration is to find the intrinsic and extrinsic parameters. I also said that the goal of calibration is to help us take a 3D Point, and convert it into a Pixel, thus creating an image.</p><p>So, here’s how camera calibration works in one image:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*-_AeD-HHJfOuctTn.png" /></figure><p>Camera Calibration Process</p><h4>Extrinsic Calibration</h4><p>Extrinsic Calibration is the conversion from World Coordinates to Camera Coordinates. We’re basically saying “Here’s a point in 3D in a specific coordinate frame. What would be the coordinate of this point if we’d look from the camera frame?”. A point in the world is rotated to the camera frame, and then translated to the camera position. The extrinsic parameters are called R (rotation matrix) and T (translation matrix).</p><p>Here is the formula:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*zZGC_78kZ7q78UaV.png" /></figure><p>Extrinsic Calibration Formula</p><h4>Intrinsic Calibration</h4><p>Intrinsic Calibration is the conversion from Camera Coordinates to Pixel Coordinates. Once we have the point in 3D, we’re using the intrinsic parameters to convert this 3D point into a Pixel. This is done using the focal length. The intrinsic parameter is a matrix we call K .</p><p>Here is the formula for world to image conversion:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*QaJdi1JMDQqhVAig.png" /></figure><p>K is the intrinsic matrix. It comprises f, the focal length and (u₀,v₀) is the optical center: these are the intrinsic parameters.</p><h4>Final Formula</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*klcBhG124KxOClax.png" /></figure><p><strong>So, we now understand that given a point in the world, we can convert that to the camera frame using the extrinsic calibration, and then to a pixel using the intrinsic calibration.</strong></p><p>Here is the final formula we use:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*4Pd23oBvD0r__tnG.png" /></figure><p>You can notice, the extrinsic matrix has been modified, this is because matrix multiplications need matrix shapes to match; and it wasn’t the case. We thus moved to Homogeneous Coordinates. You can learn more about the full formula in my course on Stereo Vision.</p><p>Next, let’s see how it works with OpenCV.</p><h4>Camera Calibration: Stereo Vision &amp; OpenCV</h4><p>Generally, we use a checkerboard and automatic algorithms to perform it. When we do it, we tell the algorithm that a point in the checkerboard (ex: 0,0,0) corresponds to a pixel in the image (ex: 545, 343).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*tverIxpT73WcQ1Ul.png" /></figure><p>Example of a calibration</p><p>For that, <strong>we must take images of the checkerboard with the camera,</strong> and after some images and some points, a calibration algorithm will determine a calibration matrix for the camera by minimizing a least square loss.</p><p>Generally, calibration is necessary to remove image distortion. Pinhole camera models include a distortion, the “GoPro Effect”. To get a rectified image, a calibration is necessary. A distortion can be radial or tangential. Calibration helps to undistort an image.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/658/0*iYRGLUDCdfMNSXwW.png" /></figure><p>Image Calibration</p><p>In my course on <a href="https://courses.thinkautonomous.ai/stereo-vision">Stereo Vision</a>, I go through the fundamentals of calibration in mono and stereo mode. We also see how to undistort images, and how to compute additional matrices such as the Essential and Fundamental matrices, used for applications such as 3D Reconstruction. <a href="https://io.dropinblog.com/https">Here’s the link to learn more.</a></p><p>For now, to learn more about calibration, follow <a href="https://docs.opencv.org/3.4.3/dc/dbb/tutorial_py_calibration.html">this link </a>.</p><p><strong>👉 At the end of the calibration process, you have two rectified images, with the parameters K, R, and T:</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*QPnHmqCY1Qcd_PzM.png" /></figure><h3>2. Epipolar Geometry — Stereo Vision</h3><blockquote><strong><em>Stereo Vision is about finding depth based on two images.</em></strong><em> Our eyes are similar to two cameras. Since they look at an image from different angles, they can compute the difference between the two points of view and establish a distance estimation.</em></blockquote><p>In a stereo setup, we have two cameras, generally aligned on the same height. So, how can we use a setup and geometrically design a system?</p><h4>How can stereo cameras estimate depth?</h4><p>Imagine you have two cameras, a left and a right one. <em>These two cameras are aligned in the same Y and Z axis. Basically, the only difference is their X value.</em></p><p>Now, have a look at the following stereo setup, with two cameras CL (camera left) and CR (camera right) looking at an obstacle O. With geometry, we’ll find its distance. .</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*pAW6pfckKeoQQwrN.png" /></figure><p>Stereo Setup</p><p>Our goal is to estimate the Z value, the distance, for the O point (representing any pixel in an image).</p><ul><li>X is the alignment axis</li><li>Y is the height</li><li>Z is the depth</li><li>xL corresponds the point in the left camera image. xR is the same for the right image.</li><li>b is the baseline, it’s the distance between the two cameras.</li></ul><p>Taking the left and the right camera respectively, we can get the two equations in this drawing using similar triangles.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*qn-jdNWy_IAP4Kq5.png" /></figure><p>If you apply Similar Triangles theorem, you’ll realize that we can arrive at two equations:</p><ul><li>For the left camera:</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/270/0*069BILbW-EGf0JCx.png" /></figure><ul><li>For the right camera:</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/556/0*_gvq5gIrxCT0dkS4.png" /></figure><p>When we do the maths, we can quickly arrive to Z, and can even derive X and Y.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/776/0*G22_myJR9R1EUcEd.png" /></figure><h3>3. Stereo Disparity &amp; Mapping</h3><h4>What is disparity?</h4><blockquote><em>Disparity is the difference in image location of the same 3D point from 2 different camera angles.</em></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*VCi0k46UH_L58-EK.png" /></figure><p>Concretely, if I take the side mirror on the left image at pixel (300, 175); I can find it on the right image at pixel (250, 175).</p><p>In this example, xL = 300 and xR = 250. The disparity is called xL-xR; or here 50 pixels. It is estimated by sending two images to a function.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*nwm4QhgZ8_gFd1yp.png" /></figure><p><strong>👉 Thanks to stereo vision, we can estimate the depth of any object, assuming we do the correct matrix calibration.</strong></p><p>The formula is as follows:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/586/0*E95_Ujo3VM5J95Xn.png" /></figure><p>Compute this for every pixel, and you get a disparity map! As you can see, close objects are lighter than far away objects that are represented in darker colors. We already have a sense of depth!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*3YDNFUE6I21lxYHX.png" /></figure><h4>Stereo Matching</h4><p>Why “epipolar geometry” ?</p><blockquote><em>To compute the disparity, we must find every pixel from the left image and match it to every pixel in the right image. This is called Stereo Matching.</em></blockquote><p>To solve this problem —</p><ul><li>Take a pixel in the left image</li><li>Now, to find this pixel in the right image, simply search it on the epipolar line. There is no need for a 2D search, the point should be located on this line and the search is narrowed to 1D.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*e9n8mAN8L_mNNSl-.png" /></figure><p>As in the example above, the mirror is on the same height because of the stereo calibration and rectification. We have a 1 dimensional search only. This is because the cameras are aligned along the same axis.</p><h4>The Epipolar Line</h4><p>This is because the cameras are aligned along the same axis. How does Stereo Matching work?</p><p>The correspondence problem, also known as epipolar search, can be done in many different ways:</p><ul><li>Using Local Approaches</li><li>Using Global Approaches</li><li>Using Semi-Global Approaches</li><li>Using Deep Learning</li></ul><p>OpenCV basic functions can solve the issue, but will be less precise than current Deep Learning approaches. In my course <a href="https://courses.thinkautonomous.ai/stereo-vision">MASTER STEREO VISION </a>, we learn how to apply this problem and we read tons of research papers to understand how to do stereo matching properly.</p><p>Now, given our two initial images, here’s what we’ve got:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*s2kGXYg8N33f2CEW.png" /></figure><h3>4. Stereo Vision — From Disparity to Depth Maps</h3><p>👉 We have two disparity maps, that tells us basically what is the shift in pixels between two images. We also have, for each camera, a projection matrix : P_left and P_right.</p><p>In order to estimate the depth, we’ll need to estimate K, R, and t.</p><p>Based on the formula:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/200/0*06g9p4jvE0IwjLep.png" /></figure><p>An OpenCV function called cv2.decomposeProjectionMatrix() can do that and get K, R, and t from P; for each camera.</p><h4>Depth Map</h4><p>It is now time to generate the depth map.</p><blockquote><em>The depth map will tell us the distance of each pixel in an image, using the other image and the disparity map.</em></blockquote><p>The process is the following:</p><ul><li>Get the focal length 𝑓 from the 𝐾 matrix</li><li>Compute the baseline 𝑏 using corresponding values from the translation vectors 𝑡</li><li>Compute depth map of the image using our formula from before and the calculated disparity map d:</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/776/0*kBqfMei8jKHdPbAn.png" /></figure><p>Stereo Vision formula</p><p>We do that computation for each pixel, and we get a depth map!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*iJHoXP_MSAHXHae_.png" /></figure><h3>5. Estimating depth of an obstacle</h3><p><strong>We have a depth map for each camera! Now, imagine we combine this with an obstacle detection algorithm such as YOLO</strong>. Such algorithms will return, for every obstacle, a bounding box with 4 numbers: [x1; y1; x2; y2]. These numbers represent the coordinates of the upper left point and the bottom right point of the box.</p><p>We can run this algorithm on the left image for example, and then use the left depth map.</p><p><strong>Now, in that bounding box, we can take the closest point.</strong> We know it, because we know the distance of every single point of the image thanks to the depth map. The first point in the bounding box will be our distance to the obstacle.</p><p>Boum! We just built a pseudo-LIDAR!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*OuS781sAgF0fVsqo.png" /></figure><p>Thanks to stereo vision, we know not only the obstacles in the image, but also their distance to us! This obstacle is 22.75 meters away from us!</p><h3>Stereo Vision Applications — How do you use Stereo Vision?</h3><p><strong>Stereo Vision is something that turns 2D Obstacle Detection into 3D Obstacle Detection using simple geometry and one additional camera</strong>. Today, most emerging “edge” platforms consider Stereo Vision, such as the new Open CV AI Kit or integrations on Raspberry and Nvidia Jetson cards.</p><p>The simple and elegant thing is that you can get started in Stereo Vision using OpenCV… and then get much deeper by adding Neural Networks. Since it’s mostly geometry, the only place where we’ll use Neural Networks is in the disparity search (Step 3).</p><p>In terms of costs, it stays relatively cheap compared to using a LiDAR and still offers great performances. <strong>We call that “pseudo-LiDAR” because it can replace LiDAR in its functions: Detect obstacles, classify them, and localize them in 3D.</strong></p><p>It doesn’t stop there. In the <a href="https://courses.thinkautonomous.ai/stereo-vision">Stereo Vision course </a>, we also do much more advanced things such as 3D Reconstruction. If we have the distance of every pixel, we can recreate a 3D Point Cloud, as follows:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/599/0*VvfdfEgFyycXaRGV.gif" /></figure><p>Stereo Vision is also a good alternative to LiDAR. In my article <a href="https://www.thinkautonomous.ai/blog/?p=sensor-fusion-vs-stereo-vision-my-results">Stereo Vision vs Sensor Fusion: Which approach is better?</a> , I compare how I use both approaches, and the results!</p><blockquote><em>Finally, if you’d like to learn how to implement this yourself, and convert from being a 2D Engineer to 3D Computer Vision Engineer, then I invite you to </em><a href="https://thinkautonomous.leadpages.co/serve-leadbox/52aqmJY9AnvEDvVV8w8g2P/"><em>receive my private daily emails on computer vision and self-driving cars</em></a><em>, and visit my course </em><a href="https://courses.thinkautonomous.ai/stereo-vision"><em>MASTER STEREO VISION: Killer Approaches to Pseudo-LiDARs &amp; 3D Computer Vision.</em></a></blockquote><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FzMkF-e_TNZA%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DzMkF-e_TNZA&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FzMkF-e_TNZA%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/c99eed99527dea5fd9f96dce201260d0/href">https://medium.com/media/c99eed99527dea5fd9f96dce201260d0/href</a></iframe><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=41fa1ac42fc9" width="1" height="1" alt=""><hr><p><a href="https://medium.com/think-autonomous/pseudo-lidar-stereo-vision-for-self-driving-cars-41fa1ac42fc9">Pseudo-LiDAR — Stereo Vision for Self-Driving Cars</a> was originally published in <a href="https://medium.com/think-autonomous">Think Autonomous</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Self-Driving Car Engineer Nanodegree 2020 Review]]></title>
            <link>https://medium.com/think-autonomous/self-driving-car-engineer-nanodegree-2020-review-e61aeddf828d?source=rss----1b935c077b55---4</link>
            <guid isPermaLink="false">https://medium.com/p/e61aeddf828d</guid>
            <category><![CDATA[self-driving-cars]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[deep-learning]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[autonomous-cars]]></category>
            <dc:creator><![CDATA[Jeremy Cohen]]></dc:creator>
            <pubDate>Wed, 22 Jul 2020 10:11:54 GMT</pubDate>
            <atom:updated>2021-07-20T15:43:27.910Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*iEg8hMp9NjC2ciWTy6RxXg.png" /></figure><blockquote>The Udacity Self-Driving Car Engineer Nanodegree has been a very popular way for students to learn about autonomous driving technologies and find a job in the field. Thousands of students enrolled, and some got out with the job.</blockquote><blockquote>I am one of them, and today, I will share with you my review of the program.</blockquote><blockquote><strong>There is just this one thing: </strong>I enrolled 3 years ago and graduated 2 and a half years ago! The program changed a bit, I looked for students who just graduated to see the changes and made my review accordingly.</blockquote><blockquote>Also, an updated version of this article has been published on <a href="https://www.thinkautonomous.ai/blog/?p=self-driving-car-engineer-nanodegree-2020-review">https://www.thinkautonomous.ai/blog/?p=self-driving-car-engineer-nanodegree-2020-review</a></blockquote><h3>Questions I will answer:</h3><ul><li>Is the Nanodegree worth it?</li><li>Is the content still up to date and relevant?</li><li>Was it actually useful to enter the industry?</li><li>Can you get the promised salaries?</li></ul><blockquote>I will start by giving you a quick presentation of the Nanodegree and a tour of the projects and content you learn in this program… I’ll then give my opinion on whether you should enroll or not.</blockquote><h4>Before that</h4><p>I am writing daily about Self-Driving Cars &amp; Autonomous Technology to a private mailing community! You can join this community and learn tons of things about self-driving cars and receive valuable content tips. <br>Join us, and be at the cutting-edge by entering your email below!</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fupscri.be%2Fzwdjy9%3Fas_embed%3Dtrue&amp;dntp=1&amp;display_name=Upscribe&amp;url=https%3A%2F%2Fupscri.be%2Fzwdjy9&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=upscri" width="800" height="400" frameborder="0" scrolling="no"><a href="https://medium.com/media/aea2b0fbf65889a03f5950bf090094c5/href">https://medium.com/media/aea2b0fbf65889a03f5950bf090094c5/href</a></iframe><h3><strong>What is this course?</strong></h3><p>When I enrolled, the Nanodegree was a 9-month long program where you could join and get out knowing how to program a self-driving vehicle. At the time, you had to submit an application letter and wait about a week to be accepted.</p><blockquote>I decided to join the Nanodegree when I was lost in my career. I just began an internship and realized I was far behind in AI and Advanced Technologies, even though I just graduated. This course was salvation; as it promised everything I wanted.</blockquote><p><strong>In 2017, the program was making insane promises:</strong></p><ul><li>150k per year minimum salary</li><li>Cutting-Edge skills applicable everywhere</li><li>Partnerships with UBER, MERCEDES, and other hiring partners</li><li>Possibility to save 1,000,000 people’s lives per year</li></ul><p><strong>I didn’t even look at the summary of the course; I was sold.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/400/1*B6t6XsSFiZKZXp4MYy7Wgw.jpeg" /></figure><blockquote>A year later, I was working in a self-driving car startup on Computer Vision.<br>It seems that it worked!<br>However, every promise has now disappeared on the course’s page.<br>So maybe it doesn’t work for everyone?</blockquote><h4>The Nanodegree in 2020</h4><p>Today, the program has been shortened to 6 months to get better completion rates. If you knew the 9 months program, you probably remember it as fascinating but intense. The risk of dropping out is high, it’s a 20h/week program!</p><p>By reducing the program length, they also reduced the content and removed 3 projects; leaving 9 projects instead of 12 to learn how to be a self-driving car engineer.</p><p>The program lasts 6 months and takes about 15/20 hours per week to complete. It’s in Python and C++; and you must have some requirements:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*DsEMSLnToTaCptP5.png" /></figure><p>If you don’t have these requirements, you can get them alone or follow the “Intro to Self-Driving Car” course.</p><h3><strong>Tour of the content</strong></h3><p>In this Nanodegree; you will learn the pillars of self-driving cars.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*-0hXwJlY9vYkgQxx.png" /><figcaption>(taken from <a href="https://www.thinkautonomous.ai/technologies-behind-self-driving-cars">my self-driving cars course</a>)</figcaption></figure><ul><li>Additionally, you will learn about <strong>System Integration and ROS —</strong> How to program a real self-driving car.</li></ul><h4>Perception — Computer Vision</h4><blockquote>The Nanodegree starts with Computer Vision and “Lane Line Finding projects”.</blockquote><p>You will learn how to process images so build 2 lane line detection systems: one that is basic and only work with straight lines, one that works with curves.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/360/1*8u4zIewDzpNoTCxzVSTMvA.gif" /><figcaption>Basic Lane line Detection</figcaption></figure><p>The first project (red lines) will teach you how to process an image, work with filters and transformations, and find lines. The goal of this project is to be really easy so you can get it done in your first week.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/500/1*CQkjRWnZuPsO0npeUhLllA.gif" /><figcaption>Advanced Lane Line Detection</figcaption></figure><p>The second project will teach you about camera calibration, image thresholding, color spaces, and bird-eye-view. This second project is a bit more challenging but also teaches much more about Computer Vision.</p><blockquote><strong>👉 These two projects are very interesting and look very good. </strong>If you want to learn about Computer Vision, you will need these kinds of projects in your background.</blockquote><blockquote>However, note that none of the techniques taught in these two projects are actually used in the industry.<br>These techniques are nice to start in Computer Vision, but are not enough in the real world. It’s just an introduction to Computer Vision.</blockquote><p><strong>When I arrived in the autonomous shuttle company, one of my tasks was to design a lane line detection system.</strong><br>I couldn’t use this, as I had to use Deep Learning.</p><h4>Perception — Deep Learning</h4><blockquote>The Nanodegree then jumps to Deep Learning where you will build two projects: A traffic sign classifier, and a Behavioral Cloning project.</blockquote><p>These two projects will teach you how to use Deep Learning in Computer Vision (highly needed) with practical approaches.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/452/1*qykDS6KkxVgPJuw5QAq3nQ.jpeg" /><figcaption>Traffic Sign classifier</figcaption></figure><p>In the traffic sign classifier project where you’ll learn about Neural Networks and Convolutional Neural Network to classify images.</p><p>This was my first ever introduction to this and it was quite good.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/439/1*W9NyDK-ZfLVzMaNSeCY_xQ.gif" /><figcaption>Behavioral Cloning</figcaption></figure><p>In the behavioral cloning project, you will learn to use a self-driving car simulator to record data and annotate them and then train a model on this data to steer the wheel.</p><blockquote><strong>👉 These two projects are very nice to teach Deep Learning, the behavioral cloning project is also very impressive.</strong></blockquote><blockquote>However, I here have the exact same comment as before: this is not used in self-driving cars!</blockquote><blockquote>If you’re looking for an overview of the technologies, it’s good! Just don’t expect to find real self-driving car code in these projects; even for the classification part. You can refer to my email “<a href="https://mailchi.mp/ee0ddc9ba774/why-end-to-end-deep-learning-is-a-fake-dream">Why end-to-end Deep Learning is a fake dream</a>” from last month for more information.</blockquote><p>These four projects are part of the Perception section of the Nanodegree.<strong><br></strong>It’s all in Python. The rest is about the other modules of self-driving vehicles; and it’s in C++.</p><h4>Sensor Fusion &amp; Localization — Bayesian Filters</h4><p>The next project is about Sensor Fusion and Localization.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*Th60v5rY4aKbhvGBMy_FSw.gif" /><figcaption>Sensor Fusion using Kalman Filters</figcaption></figure><p>In Sensor Fusion, you will learn what Kalman Filters are and how to use Extended Kalman Filters to fuse data from RADAR and LiDAR.</p><p>It’s nice and challenging; quite advanced too. The project is however not very visual; maybe they changed it so it looks like the Sensor Fusion Nanodegree?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1009/1*md7f0XfYV1MB84KtOpSB0w.gif" /><figcaption>Localization using Particle Filters</figcaption></figure><p>In Localization, you will learn about Particle Filters, another type of Bayes Filters.</p><p>This is also great but I have the same comment; you can’t really show this to a recruiter and expect to impress.</p><blockquote>👉 The course content is really good. It is taught by Mercedes Benz team. <br>One bad point is that the projects are not very intuitive and appealing. I’m not sure if they changed this.<br>It was much better in the Sensor Fusion Nanodegree.<br>It’s all in C++, which is more challenging but also closer to reality.</blockquote><h4>Planning &amp; Control — Work in Simulators</h4><p>Finally, you will learn about Planning and Control.<strong><br></strong>Planning is about defining a trajectory, Control is about following it.<br>These two parts are in C++ using the simulator. To me, using the simulator is a very good thing since it allows for visually appealing projects.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/960/1*kcMxFi44c6z7388lr-yq9g.gif" /><figcaption>Highway Driving</figcaption></figure><p>In the planning section, you will learn about basic Artificial Intelligence (Dijkstra, A* algorithms), and you will have to design a highway driving algorithm. This is the most challenging project of the whole Nanodegree.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*pnyFIr6TFblT5RanauXnPg.gif" /><figcaption>PID Controller</figcaption></figure><p>In the control section, you will learn about PID Controllers, used to determine a steering angle. They previously had an MPC section that disappeared in the nanodegree update.</p><blockquote><strong>👉 This introduction is quite good considering they could allow only a small portion of the course to each topic.</strong></blockquote><h4>Coding a Real Self-Driving Car</h4><blockquote>Finally, you will put code in a real-self-driving car. I did it during the 9 months long Nanodegree, and it was one of the best experiences of my life.</blockquote><p>I teamed up with 4 people, and we had to drive in a parking lot in a real self-driving car. To me, this is the main reason to purchase this course.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2F13VhwfG965Q%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3D13VhwfG965Q&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2F13VhwfG965Q%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/9778782b715b6607f2c82dcc76ce71e9/href">https://medium.com/media/9778782b715b6607f2c82dcc76ce71e9/href</a></iframe><p>This projects will also teach you a lot about ROS, and autonomous vehicle architectures. With this project, the Nanodegree provides a unique experience, close to reality. You can literally code a self-driving car from your bedroom!</p><blockquote>This project will be very challenging, and I thank my former partners for helping with it. This Nanodegree used to have a Slack which I found was one of the best thing we could have in the whole course. Thousands of students with the same interests could talk to eachother and learn together; it has been replaced with the <strong>Knowledge</strong> platform I find much less convenient.</blockquote><h3>Is the content up to date?</h3><blockquote>The content is very good to teach you what’s behind self-driving cars. Don’t expect to use it in real self-driving cars. The last project might be close to reality, but it using outdated versions of ROS, Ubuntu, and is done in Python; which is not ideal.</blockquote><p>Generally, most of the content has been created over 3 years ago and is a bit outdated. Python 2.7 dependencies are no longer supported and the techniques taught are not state of the art.</p><p>When I first enrolled, there was a real hype around self-driving cars, and I felt at the cutting-edge. Today, this program needs a real refresh to make you feel that again.</p><h3>Can you find a job with the Nanodegree?</h3><p>Not many engineers know how self-driving cars work.</p><blockquote>This program will give you projects that you can use and an excellent overview and understanding of self-driving cars.</blockquote><blockquote>However, this is just an overview where you code each part.</blockquote><p>As every overview, you won’t dive deep into a topic.</p><ul><li>You won’t learn how to work with LiDARs</li><li>You won’t learn cutting-edge Computer Vision</li><li>You won’t learn algorithms for real-life planning and mapping</li><li>You won’t learn to use GPS</li><li>You won’t learn real control command systems</li></ul><blockquote>The program is an excellent overview, but you will need more to find a job, especially with high salaries.</blockquote><blockquote>This program motivated me to start and learn, but I then had to continue my road, choose a path, and dive deeper into it.</blockquote><p>For example, if you enroll in the Sensor Fusion Engineer Nanodegree, you will go in depth of the Perception topic. For sure, you won’t know how Planning works, but you will have “job-ready” skills.</p><p><strong>👉 If you need an overview, my </strong><a href="https://courses.thinkautonomous.ai/self-driving-cars?coupon=OTO"><strong>SELF-DRIVING CARS guide</strong></a><strong> provides it for much less.</strong></p><h3><strong>Do I recommend it?</strong></h3><blockquote>3 years ago, I would have told you to go with your eyes closed.<br>Today, I don’t. It’s a really great program, but it no longer makes you feel like you’re at the cutting-edge. It’s also quite outdated, similar to the Robotics Software Nanodegree.</blockquote><h4>Price</h4><p>Small section on the price; it’s 359$ per month; for 6 months. <br>You can also pay in full for 1974$.</p><p>3 years ago, it was totally worth the price as I could find a high paying job, increase my skills, and be much more valuable in the market. Today, maybe it isn’t worth that much.</p><p>👉 At the time, I paid for 3 terms of 800€ each; so 2,400€ for the whole Nanodegree. The price has been almost divided by 2 since.</p><blockquote>If you want to go with Udacity, I would recommend the <a href="https://www.udacity.com/course/sensor-fusion-engineer-nanodegree--nd313">Sensor Fusion Nanodegree</a> or the <a href="https://www.udacity.com/course/computer-vision-nanodegree--nd891">Computer Vision Nanodegree</a>. It’s much more focus on a topic and you will learn much more valuable skills.<br>You can read my review of the Sensor Fusion Nanodegree <a href="https://www.thinkautonomous.ai/sfnd-review">here</a>.</blockquote><blockquote>The Self-Driving Car Engineer Nanodegree changed my life and I will forever be grateful. I could use this program to get a job as a Self-Driving Car Engineer and I could continue down a path.</blockquote><blockquote>However, I have been disappointed by the changes recently made: they removed every relevant project that could get you a job and removed the communication platform that was the best part of being enrolled in a Nanodegree.</blockquote><blockquote>Going through the end is a great accomplishment and I’m sure that you’ll love it if you enroll; just know what to expect. <a href="https://www.udacity.com/course/self-driving-car-engineer-nanodegree--nd013">Visit the course here</a>.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*DjXUXmmCZ2kl6kL1.png" /></figure><blockquote>Jeremy Cohen.</blockquote><p><strong>Go Further</strong></p><ul><li><a href="https://www.thinkautonomous.ai/">Visit Think Autonomous’ webpage</a></li><li><a href="https://upscri.be/zwdjy9">Receive the daily emails</a> or simply enter you email below.</li></ul><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fupscri.be%2Fzwdjy9%3Fas_embed%3Dtrue&amp;dntp=1&amp;display_name=Upscribe&amp;url=https%3A%2F%2Fupscri.be%2Fzwdjy9&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=upscri" width="800" height="400" frameborder="0" scrolling="no"><a href="https://medium.com/media/aea2b0fbf65889a03f5950bf090094c5/href">https://medium.com/media/aea2b0fbf65889a03f5950bf090094c5/href</a></iframe><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e61aeddf828d" width="1" height="1" alt=""><hr><p><a href="https://medium.com/think-autonomous/self-driving-car-engineer-nanodegree-2020-review-e61aeddf828d">Self-Driving Car Engineer Nanodegree 2020 Review</a> was originally published in <a href="https://medium.com/think-autonomous">Think Autonomous</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How RADARs work]]></title>
            <link>https://medium.com/think-autonomous/how-radars-work-1eb523893d62?source=rss----1b935c077b55---4</link>
            <guid isPermaLink="false">https://medium.com/p/1eb523893d62</guid>
            <category><![CDATA[autonomous-vehicles]]></category>
            <category><![CDATA[self-driving-cars]]></category>
            <category><![CDATA[autonomous-cars]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[robotics]]></category>
            <dc:creator><![CDATA[Jeremy Cohen]]></dc:creator>
            <pubDate>Thu, 09 Jul 2020 13:42:42 GMT</pubDate>
            <atom:updated>2021-07-23T18:27:13.159Z</atom:updated>
            <content:encoded><![CDATA[<blockquote>This article has been updated on <a href="https://www.thinkautonomous.ai/blog/?p=how-radars-work">https://www.thinkautonomous.ai/blog/?p=how-radars-work</a></blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/1*AnNDzME8DG7tV7Pco796gA.png" /></figure><blockquote>RADARs is a sensor that we use since the 1930s. Originally, it was used by the military to detect ennemy aircrafts. It has been a tremendous sensor during wars, used by every side. Today, it’s a technology used in vehicles for Adaptive Cruise Control, and in autonomous vehicles for obstacle detection.</blockquote><blockquote>Let’s see how RADARs work, what are the strengths and weaknesses of this sensor, and how it can be used to detect objects positions, classes, and velocities.</blockquote><blockquote>Let’s take a look at Radio Detection And Ranging.</blockquote><h4>Before that</h4><p>I invite you to join the Autonomous Thinkers and receive daily content on autonomous vehicles, Computer Vision, and AI technology.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fupscri.be%2Fzwdjy9%3Fas_embed%3Dtrue&amp;dntp=1&amp;display_name=Upscribe&amp;url=https%3A%2F%2Fupscri.be%2Fzwdjy9&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=upscri" width="800" height="400" frameborder="0" scrolling="no"><a href="https://medium.com/media/aea2b0fbf65889a03f5950bf090094c5/href">https://medium.com/media/aea2b0fbf65889a03f5950bf090094c5/href</a></iframe><h3>Why RADAR is useful</h3><p>In self-driving cars, RADAR is a very common sensor.</p><p>Companies like Tesla or Comma.ai use RADARs coupled with camera to unsure a vision-only system that couldn’t be possible without it. Other manufacturers use the RADAR coupled with LiDARs and Cameras to get an awesome sensor fusion module.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LmtDG8rU2v5Wu_4thRrGyA.jpeg" /><figcaption>(<a href="https://www.google.com/url?sa=i&amp;url=https%3A%2F%2Fwww.eenewsautomotive.com%2Fnews%2F5th-generation-radar-sensors-offers-significantly-higher-resolution%2Fpage%2F0%2F1&amp;psig=AOvVaw3H6Nw_4vhCA7Q_K93St5wd&amp;ust=1594224650763000&amp;source=images&amp;cd=vfe&amp;ved=0CAIQjRxqFwoTCIC2pOXDu-oCFQAAAAAdAAAAABAn">source</a>)</figcaption></figure><p><strong>When it was created, the RADAR was cumbersome, but today, it fits in every vehicle you already possess, often located behind the front bumper.</strong></p><p>Another great argument about RADAR is its price; it can cost up to 500$, but not much more.</p><p>When used in the context of autonomous driving, the RADAR is a great complementary sensor that can solve other sensors’ weaknesses.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*shJfGr01PeLwPHmTkbmGzQ.png" /><figcaption>(<a href="https://cleantechnica.com/2016/07/29/tesla-google-disagree-lidar-right/">source</a>)</figcaption></figure><blockquote>To sum up the picture, RADARs can measure the velocity of an object directly and can work during different scenarios such as day, night, rain, fog, snow… while other sensors may be troubled.</blockquote><h3>How RADARs work</h3><h4>Introduction</h4><p>RADAR stands for Radio Detection And Ranging. It works by emitting electromagnetic (EM) waves that reflect when they meet an obstacle. Since it works using EM waves, it can work under any condition.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*fimD_LGYRBN5QszYogv-Bw.png" /><figcaption>(<a href="http://www.electricalelibrary.com/en/2018/05/06/how-radar-works/">source</a>)</figcaption></figure><p>One thing we must understand is that we are dealing with waves, exactly like in High School Physics.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/430/1*3zgIbQzbRyH5tlU2QA9CRg.png" /></figure><p>For example, every wave has a wavelength, a frequency, but also an amplitude, and a phase.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/825/1*gb1qjhw1CWU5JZZ1qo6oIw.png" /><figcaption>(<a href="http://www.techplayon.com/wavelength-frequency-amplitude-phase-defining-waves//">source</a>)</figcaption></figure><p>Processing these waves will help us find obstacles.</p><h4>Hardware —FMCW</h4><p>There are many different types of RADARs, one of the most popular and relevant to our case is called <strong>FMCW — Frequency-Modulated Continuous Wave.</strong></p><blockquote><strong>Why is it popular and relevant to our case?<br></strong>This type of RADAR radiates continuous power. It can detect obstacles at a very small ranges and can measure simultaneously the range and the velocity of an object.</blockquote><p><strong>The wave looks like this: it’s a signal called a sawtooth whose frequency can increase or decrease over time. </strong>We’ll see what it means in a few minutes with the Doppler Effect.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/865/1*R9Fxepgp9CDfbGPE_D6w6Q.png" /><figcaption>(source)</figcaption></figure><p>The hardware of an FMCW RADAR is comprised of many things:</p><ul><li><strong>A frequency synthesizer</strong> — Something that sets the wave at the right frequency.</li><li><strong>A power amplifier</strong> — Something that amplifies the signal so RADARs can see at long range (300m).</li><li><strong>An antenna </strong>— Something that converts the electricity into electromagnetic waves that are sent into a specific direction and reflected (back to the antenna).</li><li><strong>A Mixer </strong>—Something that helps with frequency shifts.</li><li><strong>A Processor </strong>— Just as in any computer, a processor helps with computations, and we can even process the signal to do Machine Learning, clustering, tracking, …</li></ul><h4>Can we detect every object?</h4><p>When the emitted wave reaches an object; it’s reflected. But how? and where?</p><p>As you’ll notice, it’s not always reflected exactly back to the RADAR’s antenna. An index of reflection called the <strong>Radar Cross Section (RCS)</strong> is used and takes into account:</p><ul><li>The geometry of the target</li><li>The direction of the RADAR</li><li>The frequency</li><li>The material of the target</li></ul><p><strong>RCS is a metric calculated that takes into account all these factors.</strong> Here’s an example.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/325/1*ko2gZYsiiRen5qxhPLEpZQ.png" /><figcaption>(<a href="http://www.radartutorial.eu/">source</a>)</figcaption></figure><p>Now consider the following image of a Stealth Aircraft. This type of plane can appear completely undetected by the RADAR because of its geometric shape design to deflect the waves in other directions, its smooth surface, and its non-reflective paint designed to absorb the waves so they don’t go back to the emitter.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/705/1*3ogQcQ0KiVpdmX3kjAgvVg.png" /><figcaption>(source: Pinterest)</figcaption></figure><p>Due to the reflectivity, and other factors, it’s possible to classify obstacles with a RADAR.</p><h4>How to estimate the range of an obstacle?</h4><p>There are a lot of different equations involved when we want to work with RADARs. In cause, this is 100% signal processing. However, the maths are simple and don’t get that hard when it comes to it.</p><p>Here is an example — Let’s say we have a car in front of us and we need to know its distance to us.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*merO1HttbdgYamkOuEJvBg.png" /></figure><ul><li>We know the speed of the signal since it propagates in the air; <strong>c = 3*10⁸</strong>.</li><li>We can measure the <strong>time the signal takes to come back :T</strong>. Then the time it takes to hit the target is T/2.</li><li>The Range is simply <strong>R =</strong> <strong>c*T/2</strong>.</li></ul><blockquote>A more sophisticated (close to reality) calculation would replace T with a combination of some parameters of the RADAR such as the bandwidth or the period of the chirp.</blockquote><p>👉 <strong>The point is: It’s not hard maths, you just need the hardware parameters.</strong></p><h4>How to estimate the velocity of an object?</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/740/1*uLOYsEAlLjxWT0ClXCQmEQ.jpeg" /><figcaption>(<a href="https://lepetitjournal.com/bucarest/actualites/la-police-naura-plus-le-droit-dutiliser-des-radars-caches-257244">source</a>)</figcaption></figure><p><strong>So this happened, you got a speeding ticket— <br></strong>Ready to understand the cause? It’s called <strong>the Doppler Effect</strong>.</p><p>Look at the following image —</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*aT2ZnFx4F2Y-Ij441Ya6XQ.png" /><figcaption>(source)</figcaption></figure><p>As you can see, the waves are totally different.</p><ul><li>The red wave is <strong>what the RADAR transmits</strong>.</li><li>The blue wave on the top is the <strong>reflected wave for a vehicle that is approaching —</strong> The wavelength is small.</li><li>The blue wave at the bottom is the <strong>reflected wave for a vehicle that is moving away from us —</strong> The wavelength is large.</li></ul><blockquote>When we calculate the shift in the frequency, we can determine the velocity and the direction of the vehicle: this is called the Doppler Effect.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/246/1*1hnw6GVvFI2oJCesT0EEDA.png" /><figcaption>Equation for the doppler shift</figcaption></figure><p>We know:</p><ul><li>fD — The shift in the frequency (measured, details spared)</li><li>λ — The wavelength</li></ul><p><strong>👉 We can therefore determine the velocity of the vehicle νr.</strong></p><h4>How to interpret the waves?</h4><p>The RADAR doesn’t output something logical to us — it shows a wave. The only thing we can notice in this wave is the amplitude and the frequency.</p><p>The final task is about converting this wave into an interpretable signal using a <strong>Fast Fourier Transform (FFT)</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*MZ3rVFl9PR1Ar9VhlAI_8g.png" /><figcaption>(<a href="https://www.oreilly.com/library/view/elegant-scipy/9781491922927/ch04.html">source</a>)</figcaption></figure><p>I’ll skip the explanations on the Fast Fourier Transform. If you didn’t learn this at school, you can get an introduction <a href="https://www.khanacademy.org/science/electrical-engineering/ee-signals/ee-fourier-series/v/ee-fourier-series-intro">here</a>. Most people just call an fft() function. One thing to understand: it helps us shift our wave <strong>from time domain to</strong> <strong>frequency domain</strong>.</p><blockquote>Once in the frequency domain, we can notice some waves got reflected at different frequencies and separate them from the others. <strong>Each peak represents a detected obstacle.</strong></blockquote><h3>Noise</h3><p>One thing to know is that RADAR is a very noisy sensor. You see an obvious obstacle, but the RADAR outputs 5 or 6 detections. You can see no obstacle, but the RADAR shows some detections for unknown reasons. <strong>We call that noise.</strong></p><p>The noise comes from various things. A can of soda can reflect the waves and appear to be an object. Mostly, this is environmental noise.</p><p><strong>To filter the noise, we use a metric called SNR or Signal to Noise Ratio</strong>. A RADAR outputs waves and amplitudes. The higher the amplitude, the higher the probability of a detection.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/598/1*8uTJIRP5G1hOkB9GntU5Lw.png" /><figcaption>(source)</figcaption></figure><h4>Clutter</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/857/1*WfRu42a7FsOfX7eh945lyg.png" /></figure><blockquote>What comes next is called cluttering, or thresholding. We can remove the weak detections and keep only what reflects best.</blockquote><p>Advanced techniques such as dynamic cluttering are possible.</p><h3>Clustering and Detections</h3><p>Finally, we are able to detect obstacles and estimate their velocities. But what we get is only reflected waves interpreted thanks to FFT.</p><p>We can have many results outputted and might need to cluster the output.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*P11dZuc5FPmh1S8cX3r_gg.png" /><figcaption>(<a href="https://ieeexplore.ieee.org/document/7226315">source</a>)</figcaption></figure><p>Clustering algorithms are algorithms based on distance calculations such as Euclidean Clustering or K Means Clustering.</p><h3>Conclusion —</h3><blockquote>RADAR is a very powerful tool. It can’t really be used alone in the context of autonomous driving because of the noise; but it can be coupled with a camera or a LiDAR and be very powerful.</blockquote><blockquote>It can work in many conditions and estimate range and velocities directly. With some work, it can even classify.</blockquote><blockquote>One thing I didn’t mention is that RADAR can see underneath buildings and obstacles. This is very powerful if we want to estimate the environment over the close range.</blockquote><blockquote>Here is an example of a RADAR predicting an accident that is non visible seconds before it happens (thanks to object tracking).</blockquote><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FAPnN2mClkmk%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DAPnN2mClkmk&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FAPnN2mClkmk%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/8afdc0dec502aa619f712987dc94785a/href">https://medium.com/media/8afdc0dec502aa619f712987dc94785a/href</a></iframe><blockquote>As you can see, it shows the potential of this technology and Tesla already used the RADAR to save many lives, check some compilations <a href="https://www.youtube.com/watch?v=--xITOqlBCM">here</a>.</blockquote><blockquote>To learn more about self-driving car technology, I invite you to <a href="https://www.thinkautonomous.ai/email">join the mailing list</a> for exclusive content, career tips, discounts, and more!</blockquote><blockquote>Jeremy Cohen</blockquote><h3><strong>Projects</strong></h3><p>Here is a project made during the <a href="https://www.udacity.com/course/sensor-fusion-engineer-nanodegree--nd313">Sensor Fusion Nanodegree from Udacity</a> that I highly recommend.</p><ul><li><a href="https://github.com/Jeremy26/Radar_Generation_Detection">Radar Target Generation</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1eb523893d62" width="1" height="1" alt=""><hr><p><a href="https://medium.com/think-autonomous/how-radars-work-1eb523893d62">How RADARs work</a> was originally published in <a href="https://medium.com/think-autonomous">Think Autonomous</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>