오늘 아침 8 시에 일어나서 이것저것 준비하다보니 8시 50 분에 밖에 나가게 되었다. 집과 회사 간의 거리가 약 5 분정도 걸려서, 바로 첫 출근을 하게 되었다. 걸으면서, 여러 사람들이 회사 갈 준비를 하는 모습들이 보이는데, 뭔가 안쓰럽기도 하고, 이게 한국 직장인 생활인가 싶어서, 뭔가 우울하지만 그래도 나에겐 이게 기회가 아닐까 하는 마음에 회사 빌딩에 들어갔다. 미팅 시간은 9시 30분 하지만 도착하니 딱 9시. 문자로 도착했다고 연락을 드릴까, 기다릴까 하다가 연락을 드려서 30 분을 기다리게 되었다. 처음에는 잘못왔나 싶을정도로 너무 개방적인것 같았으며, 점점 더 한국에서 개발자 생활들이 더더욱 좋아지고 있구나를 알게되었다.
경영팀에 있으신 분과 CFO? 와 대화를 하며 계약은 잘 마무리 된것 같았다. 물론 나도 모르게 긴장을 하고 있었고, 눈을 못마주칠정도로 집중을 하기가 어려웠다. 물론 적응기간이 필요하고, 회사에서 생활을 하다보면 뭔가 달라질거라는 생각을 했었다. 처음에는 모니터 27 inch 2개와 컴퓨터 본체를 받았는데, 모니터 암을 skrew driver 로 했어야 됬었는데 굉장히 땀도 나고, 타투를 가리려고 니트를 입은 내가 바보 같았다. 본체를 보았을때, 조금 기분이 좋았던건 3060 인가 3080 을 쓰고 있어서 “와우” 이런 말을 속으로 하고 은근 기분이 좋았다. 하지만 이걸 용도에 맞게 잘쓸수 있을까? 라는 질문을 잠깐 했다.
처음에 회사 이메일에 등록을 하고, confluence 와 slack 에 초대가 되었다. 한번도 bitbuket 을 제대로 사용해본 경험도 없었기 때문에(물론 software engineering 수업때 했는데, 항상 TODO 만 하느라 바빴다), 조금 긴장아닌 긴장을 하게 되었지만, 초대 이후에 개발환경 구축에 대해서는 이것 저것 물어보고 기본 개발환경은 잘 구축하게 되었다. 그 이후로 내 주변 사람들과 이야기 할수 있게 되었는데, 나와 같은 전문연구요원이 일하고 있었으며, 또 미국에서 유학을 했던 사람도 있었다. 뭔가 아직은 cowoker 이라는 label 이 달리긴 했지만 여러 협업을 하다보면 점점 더 알게되겟지 하는 바램이 있었다.
2 시 50 분 무렵쯤 팀장님이 오셔서, “저희 처음 입사했는데, 운좋게도 우리 미팅이 있네요” 라고 하셨는데… 그냥 “와우”. 그리고 미팅을 하게되었는데… 나는 그냥 가만히 앉아서 듣고만 있었다. 신입이라는걸 즐겨야되면서도 멍때리는 내 모습을 상상하면 웃겨 보일수도 있다는 생각이 들었다. 이러고 나서 한참을 우분투 virtualbox 셋업하는데 시간을 너무 많이 써버렸었다. 팀내 미팅을 끝맞추고 5시 반쯤 팀장님과 여러 이야기를 하게 되었고, 내가 할 수 있는 업무를 조금 갈피를 잡게 되었다. 아직은 뭣도 모르는 신입 새내기지만 새내기더라도 시간이 지나면 진짜 자율주행에 도움되는 또는 기여될수 있는 그런 개발자 또는 엔지니어가 되기 위해서 많은 노력을 해야되겠구나 라는 생각에 퇴근을 잘했다.
별로 힘들지도 않았지만, 한국 회사 기대되고 설렌다. 그리고 쭈욱 연구하고 싶은 마음과 아이디어에 오늘을 빠이빠이 한다.
MORAI 라는 회사에 처음으로 인터뷰를 보다가, 면접관이 나에게 이런 말을 했다. “혹시 영화 21 이라는 영화 보셨나요?, 거기에서 나온 굉장히 유명한 논리 문제인데, 풀어보실래요?” 그때 이 이야기를 들었을때, “오 뭐지? Ice Breaking 같은 건가?” 라는 생각을 했었다. 하지만, 결과론적으로, 나는 잘못된 답을 하고 있었고, 계속 1/2 가 맞지 않나요 라는 말을 계속했었다. 처음에는 심리적인 대결이 였을지도 모른다는 생각에 빠져서 무척 당황했었지만…
이러한 이유로, 바로 짜증나서 21 영화를 보게 되었다. 이 영화에 대한 대체적인 줄거리는 읽어보거나 Trailer 를 보기 바란다.
아무튼… 이 영화에서 그 문제를 푸는 주인공을 보았을때, “와, 나는 아직 감정에 치우져지는 결정을 가끔씩 내리는 구나” 라는 생각과 “조금은 냉철한 시각이 필요하겠구나” 라는 생각을 했었다. 이제 소프트웨어 공학쪽으로 코딩을 짜고 알고리즘을 연구 할텐데, 조금 걱정이 먼저 앞선다…
이 영화를 또 보면서 느낀건, “아, 사람들이 경험하는 것들이 다양하면 다양(Diverse) 할수록, 이야기 할거리도 많아지고, 그 추억과 경험들을 쌓게 되다보면, 하나의 Identity 를 만들어가겠구나.” 이게 research 에도 도움되지 않을까? 라는 생각이 문득 들었다.
이 영화를 본 이후, 얼마나 이 문제를 못풀었다는 생각에 땅을 쳤었지만, 결론적으로 이 회사에 합격되서, 입사 확적을 내렸었다. 너무 가고 싶은 회사이고, 더 배우고 싶고, 인터뷰 문제에 대해서 조금 새롭게 느껴서, 좋은 인상을 품고 있었다. 너무 너무 감사하고, MORAI 가서도 이 문제에 대해서 또 말할 기회가 되지 않을까?
Tracking is important in self-driving cars, this technique is crucial for estimating the state of a system. This is very similar to the probabilistic localization method(Monte Carlo localization). However, the difference in Kalman Filter estimates a continuous states whereas in Monte Carlo localization, it is forced to chop the world in the discrete places. As a result, the Kalman Filter happens to give us a uni-model distribution, whereas the Monte Carlo was fine with multi-model distributions. Both of these techniques are applicable to robot localization and tracking other vehicles.
Definition of Kalman Filter
A Kalman filter gives us a mathematical way to infer velocity from only a set of measured locations. `The Kalman filter is used to estimate the state of a system when the measurement is noisy
Kalman Filter - Common Types
KF - linear
EKF - nonlinear
UKF(unscented Kalman filter) - highly nonlinear
The Basis of the Kalman Filter
The basis of the Kalman Filter is the Gaussian Distribution.
The prior belief + Measurement Updates will provide the posterior (with mean and the variance), which is also called new states. The two Gaussians will provide us with more information together than either Gaussian offered alone. As a result, the new state estimate is more confident than our prior belief and our measurement. This means that it has a higher peak(mean) and is narrower(variance).
The state prediction is the estimation that takes place after an inevitably uncertain motion. Since the measurement update and state prediction are an iterative cycle, it makes sense for us to continue where we left off. After taking into account the measurement, the posterior distribution can be calculated. However, since we’ve moved onto the state prediction step in the common filter cycle, this Gaussian is now referred to a s the prior belief.
Now robot’s executes the command, “Move forward 7.5 meters”. Calculating the new estimate is as easy as adding the mean of the motion to the mean of the prior, and similarly, adding the two variances together to produce the posterior estimates.
#include<iostream>
#include<math.h>
#include<tuple>usingnamespacestd;doublenew_mean,new_var;tuple<double,double>measurement_update(doublemean1,doublevar1,doublemean2,doublevar2){new_mean=(var2*mean1+var1*mean2)/(var1+var2);new_var=1/(1/var1+1/var2);returnmake_tuple(new_mean,new_var);}tuple<double,double>state_prediction(doublemean1,doublevar1,doublemean2,doublevar2){new_mean=mean1+mean2;new_var=var1+var2;returnmake_tuple(new_mean,new_var);}intmain(){//Measurements and measurement variancedoublemeasurements[5]={5,6,7,9,10};doublemeasurement_sig=4;//Motions and motion variancedoublemotion[5]={1,1,2,1,1};doublemotion_sig=2;//Initial statedoublemu=0;doublesig=1000;for(inti=0;i<sizeof(measurements)/sizeof(measurements[0]);i++){tie(mu,sig)=measurement_update(mu,sig,measurements[i],measurement_sig);printf("update: [%f, %f]\n",mu,sig);tie(mu,sig)=state_prediction(mu,sig,motion[i],motion_sig);printf("predict: [%f, %f]\n",mu,sig);}return0;}
Advantage of Kalman Filter
How can the Kalman filter help us make better sense of our robot’s current state?
The Kalman filter can very quickly develop a surprisingly accurate estimate of the true value of the variable being measured. (e.g. robot’s location in one dimensional world)
Unlike other algorithms that require a lot of data to make an estimate, the Kalman filter is able to do so after just a few sensor measurements. It does so by using an initial guess and by taking into account the expected uncertainty of a sensor or movement.
Let’s say that my robot is using GPS data to identify its location. Today’s GPS measurements are only accurate to a few meters. Sensor fusion uses the Kalman filter to calculate a more accurate estimate using data from multiple sensors.