for Robot Artificial Inteligence

13. Quick sort

|

Introduction

  • Quick Sort is our first “fast” sorting algorithm. It divides the data cleverly to reduce the run time of the algorithm.

Why is it Important?

  • Quick sort is the next step in sorting algorithms. This sorting algorithm uses a smart way to divide the data so that it can reduce the run time. This comes at the cost of added complexity

Lesson Notes

  • Quick Sort works off picking a “pivot” point. All numbers less than the pivot point go to the left, and all numbers greater than the pivot point go to the right. It then reapplies this algorithm to each side of the pivot.

  • This creates an algorithm which implements a divide and conquer approach to sorting. Because of it’s ability to split up the sorting, it is able to sort in a log(n) like manner.

  • As you can see, as the algorithm splits itself with every step, it is slowly creating a sorted algorithm. No longer does it need to run through the array for each number to be sorted. Now it can just keep breaking up the numbers until they are all sorted.

  • If we look at the example above, we can read it from left to right and have a sorted array. We have {10,30,40,50,70,80,90} Each level of this algorithm takes n amount of time. Because of the way we split up the information however, there will only be log(n) levels. This means the general run time of the algorithm is going to be the number of levels multiplied by n, or nlogn, a strong improvement on the n^2 we have been seeing

  • With this algorithm however, the pivot point is important. If we keep picking pivot points that don’t split up the data, then we will not divide the data correctly. Instead of log(n) levels, we have the possibility of getting n levels. This means it will come out to n X n again, getting us the n^2 time

  • Best Time: Ω(nlogn) : The best case in this scenario is if we pick a perfect pivot point to split the data. It doesn’t matter if the array comes in sorted or not. The pivot point is what matters the most. If we pick a pivot point that perfectly splits the data each time, then we will have log(n) levels, and therefore the nlogn run time

  • Average Time: Θ(nlogn) : The average time happens when we choose a decent pivot point. As long as we can split up the data and let the program divide and conquer, we get an nlogn time.

  • Worst Time: O(n^2) : The worst-case scenario happens when we choose a bad pivot point. Instead of dividing the work up to log(n), we keep only splitting out 1 number each time. (The number is larger or smaller than the rest of the array). This makes it so we have roughly n levels. Therefore we end up having the n X n relationship, instead of the n X logn relationship.

Comparison

Quiz

<a href=”https://postimg.cc/t113CqnJ>

Comment  Read more

1. Introduction to Autnomous Navigation

|

Autonomous Navigation

  • A system in which a number of sub-systems, rather than a single technology, are composed of very complex(一个系统,其中许多子系统(而不是单一技术)由非常复杂的系统组成)
  • Algorithm(算法)
    • Sensing(感测), perception(知觉), decision(决定)
  • Client System (客户系统)
    • Composed of OS and hardware platform(由操作系统和硬件平台组成)
  • Client Platform (客户平台)
    • Provide HD maps and deep learning model training, simulation, data storage, etc.(提供高清地图和深度学习模型训练,模拟,数据存储等)

Sensing

  • Commonly used sensors(常用传感器)
    • GPS, IMU, LIDAR, Camera, Radar, Sonar
    • GPS
      • it is used for location estimation(位置估计所需)
      • GPS generates data at 10 Hz(GPS会以10 Hz的慢周期生成数据。)
      • Not usable in shaded areas such as underground, tunnel, or indoor spaces(不适用于阴影区域,例如地下,隧道或室内空间)
    • IMU
      • it is used for location estimation(位置估计所需)
      • IMU generates data at over 200 Hz(IMU以超过200 Hz的快速周期生成数据)
      • Accumulated errors occur over time(随着时间的推移会出现累积的错误)
    • Camera
      • Used for object recognition and tracking such as lane detection, traffic light detection, and pedestrian detection(用于物体识别和跟踪,例如车道检测,交通信号灯检测和行人检测)
      • obatain FOV(Field of View) by multiple HD-class cameras(通过安装多个高清级摄像机来保护FOV)
        • 앞 뒤 옆 전방향으로 Frame 얻음
    • Lidar
      • Measure distance using laser (light) (使用激光(光)测量距离)
      • high resolution(高分辨率)
      • using in Mapping, location estimation, obstacle avoidance, etc.(使用在于映射,位置估计,避障等)
      • Create HD maps to estimate the location of a moving car(创建高清地图以估算行驶中的汽车的位置)
      • Detect obstacles around(检测周围的障碍)
    • Radar
      • Measure the distance using electromagnetic waves(使用电磁波测量距离)
      • Used as a last resort to avoid obstacles(作为避开障碍的最后手段)
      • Includes speed information as well as vehicle distance(包括速度信息以及车辆距离)
      • Can be used in snow, rain and night environments(可在下雪,下雨和夜晚的环境中使用)
      • Used to perform urgent operation by transferring the original data to the control device without data processing(用于通过将原始数据传输到控制设备而不进行处理来执行紧急操作)

pose estimation

  • Position estimation using GPS and IMU()使用GPS和IMU进行位置估计)
    • IMUs have a fast update frequency while low accuracy(IMU的更新周期快而准确性低)
    • GPS has a slow update frequency, but relatively high accuracy(GPS更新周期较慢,但准确性较高)
    • Combining two values using a Kalman filter(使用卡尔曼滤波器组合两个值)
  • Disadvantages of location estimation using GPS(使用GPS进行位置估算的缺点)
    • Accuracy error in meters(精度误差(米))
    • Noise increases when the signal is reflected off a building(当信号被建筑物反射时,噪声会增加)
    • Accurate GPS values cannot be obtained where the sky is obscured(遮盖天空的地方无法获得准确的GPS值)

State Prediction

  • what happend when previous state we know, and IMU input comes in.(当我们知道先前的状态并且输入IMU时会发生什么)

Measurement Update

  • what if we known state prediction value of, and GPS(Measurement) input comes in(如果我们知道状态预测值和GPS(测量)输入怎么办)

Localization

  • Position estimation using camera(使用相机进行位置估计)
    • Extract depth information for a scene from a stereo camera(从立体相机中提取场景的深度信息)
    • Construct a map by detecting feature points from images(通过检测图像中的特征点来构建地图)
  • Disadvantages of Position estimation using a camera
    • Sensitive to lighting conditions(对照明条件敏感)
    • Dark tunnels, sunset roads, dark nights, bad weather, etc.(黑暗的隧道,落日的道路,漆黑的夜晚,恶劣的天气等。)
  • position estimation using Lidar(使用激光雷达进行位置估计)
    • using Particle Filter
  • Disadvantages of position estimation using a Lidar
    • When there is a lot of snow, rain or dust(当下大雪,下雨或灰尘时)
    • If there are many suspended particles in the air, noise will occur in the measured value.(如果空气中有许多悬浮颗粒,则测量值中会产生噪音。)
  • Needs a sensor fusion process that only collects the advantages of multiple sensors(需要仅融合多个传感器优势的传感器融合过程)

Object detection and tracking

  • pupular using Deep learning based object detection and tracking using Lidar point cloud(使用Lidar点云的基于深度学习的对象检测和跟踪)
  • Point Cloud Features(点云功能)

  • Deep learning based object detection method using point cloud(基于深度学习的基于点云的目标检测方法)

Motion prediction

  • Predict the various actions of other drivers and reflect them in their driving(预测其他驾驶员的各种动作并在驾驶中反映出来)
  • Create probability models for reachable points of other vehicles(创建其他车辆可到达点的概率模型)
  • Find the probability distribution for reachable points(Find the probability distribution for reachable points)

path planning

  • Input(输入)
    • Environmental map(环境图)
    • Robot position(机器人位置)
    • starting point(开始点)
    • goal point(目的点)
  • output
    • Route from start point to arrival point(从起点到到达点的路线)
  • terminology
    • Complete
      • This algorithm is complete if it is possible to find a route to the starting and ending points.
      • However, there should be a possible route between the starting point and the arrival point.
    • Optimal
      • This algorithm is optimal if it is possible to find the optimal path between the start and end points.
  • Methods

  • Reference SLAM KR

Comment  Read more

5. how to track multiple object at once

|

Elements of a multi-object tracking systems

  • vague 모호한

What makes multi-object Tracking difficult?

  • prediction과 measure 겹치는 부분을 tracking 해서 멀티 옵젝트 tracking을 한다.

  • 하지만 만약 아래와 같은 문제가 생긴다면 어떻게 할 것인가?

  • this is data association problem

the number of objects being tracked is not fixed

  • sometimes tracks need to be created or removed.

  • 만약 prediction과 measurement가 멀다면 에어플레인의 track을 delete한다.
  • 하지만 false positive나 missed detection이 된다면 큰 오류가 발생한다.
  • this is track maintenance problem

when tracking multiple objects what are some ways to approach

  • data association
  • track maintenance

obesrvation step

  • all those thing is handling in Observation steps

assignment step

  • Matching an obesrvation to a track

  • Eclidian distance로 assignement를 하는것이 아는 probability distribution으로 assignement를 한다.

track maintenance

  • deleting and creating tracks

estimation filtering

  • we may choose to ignore obseravtion outside of a defined region for each track

gating

  • it’s a screening mechanism that determines which detections are valid candidate to look at for assignment and which should just be flat-out ignored for

Exercise

  • GNN(Global nearest neighbor) for Data association
  • IMM for estimation filter

  • speed up

  • JPDA for Data association

Comment  Read more

4. Tracking a Single Object with an IMM Filter

|

  • Interacting multiple model iflter is showing much better

why IMM is more efficient?

  • but it has data assosiation problem
    • if many object is moving , it is distributed
  • predict next trajectory is important

Motion comes from

how do we account for control inputs?

if control input we don’t know?

it is uncooperative

  • 에어플레인의 스피드와 턴을 모르니 우리는 accounted for with process noise를 증가시켜야 한다.

  • 아까와 같이 터닝하는 포인트에 low process noise같은 경우 unit의 양을 가늠할 수 없을 정도로 커지는데 high process noise 같은 경우 터닝하는 포인트의 증가하는 표준편차값이 줄어들었다.

the problem can be solved by Multiple Model Filter

  • 하지만 state estimation의 previsou와 current의 상관관계를 업데이트하기 위하여 state covariance를 필터에 업그데이트 시킨다.

why not run an IMM with a million models?

  • usually model used 3 or four

Comment  Read more

3. Fusing a GPS and IMU to Estimate Pose

|

last section we combined the sensor in an IMU to estimate an object’s orientation in this section we add a GPS sensor, GPS can measure position and velocity and so in this way we can extend fusion algorithm to estimate them as well and

Hot to get position ? GPS!

exercise

  • GPS만 사용했을떄 Orientation에 대한 값은 엉망이지만 Postion 에 대한 값은 Ground Truth와 비슷하다.

  • 오른쪽에 보이는 것은 X,Y,Z에 대한 값인데 무슨 값이냐 하면, Ground Truth와 현재 실험하는 데이터 값에 대한 정확도에 대한 표준 편차이다.
  • 오른쪽 맨위는 QUaternion 값으로 Ground Truth와 비교하는 값이다.

  • 만약 속도를 올리면 GPS만 사용할 경우에도 position 값이 정확하지 않다.

  • IMU가 데드레콘으로 업데이트가 되면서 GPS하고 퓨전이 된다. 여기서 쓰인 방법으로는 EKF 방법이다.

  • Estimating sensor bias is important

  • bias가 점점 벗어나게 된다면 잘못된 값을 얻게 되기 떄문이다.
  • Calibration을 하더라도 Draft가 되지 않게 주의해야한다.
  • initial bias estimate가 중요하다, 그러기 위해서는 시간을 주어서(Coverage) intilaize를 하는 것이 좋다.
  • bias draft가 생겼을때 보정할 수 있는 필터가 필요하다.

  • Initialize

Real system ( we don’t know ground truth)

Kalman Filter

filter inilizied we can start with kalman filter, every common filter consists predict and correction

  • 만약 GPS만 쓴다면 Prediction Step은 1초에 Velocity가 변화지 않는다고 가정하고 since there were no update to correct that assumption the estimate would drastically run away from truth
  • however with the IMU, the filter is updating a hundred times a second and looking at the accelerometer in seeing that the veolocity is in fact changing. so in this way the filter can react to a changing state faster with the quick updates of IMU, then it can with the slower updates of the GPS
  • once the filter converges and it has a good estimate of sensor biases then that will give us an overall better prediction and therefore a better overall state estimation. that is power of sensor fusion.

  • play around with this! we can check

Reference

Matlab Sensor Fusion.

Comment  Read more