2015. 5. 24.

Camshift + Kalmanfilter with OpenCV & python on RaspberryPi B2 - object tracking robot for team project - 2

자 이제 아두이노를 이용해서 팬틸트 제어를 해보자.

Let's control the Pan&Tilt angle using Arduino.



 이 동영상에서 보는 것 처럼 우선 pan&tilt각 제어 중에서 tilt각만 제어를 했다. 
Aruino Due를 사용해서 디지털서보모터를 이용해 0~90도 tilt각을 제어했다.

 As you can see in this video, I control a tilt angle first. 
Using Arduino Due and digital servo motor, I controlled tilt angle from 0 to 90 degrees.





 

 저번 글에도 올렸던 내용이지만, 더 고화질로 재촬영했다. 
라즈베리파이에 Camshift + Kalman filter를 적용한 코드의 결과로, 지정된 색을 잘 트래킹하는 것을 알 수 있다.

 This content is same in last post, but better quality.






  그리고나서, 라즈베리파이에서 물체의 중심좌표를 아두이노로 전송하면, 아두이노가 그에 맞게 카메라 tilt각도를 움직여서 트래킹하는 프로토타입을 만들었다. 처음에는 좌표계변환을 통해서 알맞은 tilt각을 계산하려고 했지만, 너무나도 많은 변수들(실제 그 각만큼 확실히 움직였는지, 축일치가 확실한지 등등..)이 너무 많아서 외부환경에 강건한 PID제어를 사용하기로 했다. 일단은 비례제어로 움직이게 했다.
  동영상의 끝부분에서 보면 알겠지만, 급정지하는 물체에 대해서 카메라의 출렁거림을 볼 수 있을 것이다. 즉 단순 P제어가 아닌, PID 제어가 필요하다는 것을 의미한다.

 Then, RPi send the center x, y data to arduino. The arduino control servo motor to control tilt angle. We built a prototype. At first, we tried to calculate tilt angle using coordinate transformation. But there are so many things to think. (Real moving angle, real axis coincidence, etc..) So we used a PID control that robust to external factors. Once we used P control.
 As you can see in this video ends, A camera is rocking when the object is suddenly stopped. This means that we not only P control but also PID control is needed.



  다음에는 tilt각에 PID제어를 적용하고, pan 각을 제어할 것이다. 그 후에는 레이져나 BB탄 총을 설치할 것이다. 완성이 곧 눈앞에 보인다.

 Next time, we apply PID control to tilt angle and control pan angle. After that, we attach Laser module or BB gun something.




댓글 없음: