✔ camera package : https://github.com/ros-drivers/usb_cam
✔ darkent pachage : https://github.com/leggedrobotics/darknet_ros
$ sudo apt install ros-melodic-usb-cam // usb_cam 사용에 필요한 패키지
$ sudo apt-get install v4l-utils // cam 정보를 얻을수 있는 드라이버 설치
...
$ v4l2-ctl --list-devices // cam이 연결된 포트를 확인할 수 있는 명령어
$ v4l2-ctl --all -d 0 // cam의 셋팅값 확인
// 맨마지막 숫자는 위에서 확인한 cam의 포트 번호 입력
경험에 의한 개인적인 견해이며, 기준을 조금 더 정밀하게 했으면 하는 아쉬움이 있다.
Brightness
White balance temperature
Exposure_auto
Backlight_compensation
코드 내에서 값 변경 (python)
subprocess.check_call("v4l2-ctl -d /dev/video0 -c brightness=90", shell=True)
subprocess.check_call("v4l2-ctl -d /dev/video0 -c exposure_auto=3", shell=True)
subprocess.check_call("v4l2-ctl -d /dev/video0 -c focus_auto=1", shell=True)
subprocess.check_call("v4l2-ctl -d /dev/video0 -c white_balance_temperature_auto=1", shell=True)
subprocess.check_call("v4l2-ctl -d /dev/video0 -c backlight_compensation=1", shell=True)
darknet_ros에서 pub하는 bounding box와 해당 frame를 받아온다.
class가 traffic light인 경우, bounding box에 대한 정보를 저장 후 신호 분류를 위한 알고리즘을 시작한다.