Morai 시뮬레이터 카메라 영상을 RViz에 Publish
선배가 카메라 영상을 RViz에 토픽 구독으로 띄우는걸 해보라고 하셔서 진행한 작업이다.
이 블로그를 보고 작업했다.
http://chofukutomi.blogspot.com/2017/01/usb-camera-ros-kinetic-ubuntu-1604.html
[참고] ROS kinetic에서 WebCam 사용하기 (Ubuntu 16.04)
Reference: 1. https://github.com/bosch-ros-pkg/usb_cam/issues/53 2. http://zumashi.blogspot.jp/2016/12/ros-kinetic-usb-cam.html 3. ...
chofukutomi.blogspot.com
그런데 선배가!! "카메라에 직접 연결하는 형태 말고, image 전달하면 rviz에 띄워주는 함수로 구현되면 좋을 것 같습니다. 추가로, 카메라 여려개 사용할 예정인데, 여러개 띄우는것도 가능한지 궁금하네요" 라고 하셨다!! (뚜둥!)
이전까지는 ros의 pub, sub 개념을 직접 코드화 해보지 않아서 약간 멘붕이 왔었다.
다행히 선배가 이해하기 쉽게 잘 알려주셔서 ros의 빨리 개념이 잡히고 image를 publish 하는 함수를 짤 수 있었던 것 같다!
시뮬레이터의 플랫폼에 달려있는 카메라에서 송출되는 이미지가 RViz에 뜨는 것이 신기했다ㅋㅋㅋ
코드 출처!!
정말 여러 블로그를 보면서 시도해봤는데 이 코드가 젤 잘돌아간다ㅋㅋㅋ
https://www.programmersought.com/article/61544639460/
ROS uses python to publish Image topic - Programmer Sought
Use python to publish Image messages under ROS The blogger went to the official website for a long time, and there is no example of publishing Image on the python side. Specially to add. First, the Image type is derived from sensor_msgs.msg. Its types incl
www.programmersought.com