1. Ros 설치
Ubuntu 18.04기 때문에 ROS Melodic을 깔아야햇다!
아래 블로그를 참조! 👏
https://whiteknight3672.tistory.com/248
Ubuntu 18.04 + ROS Melodic 설치 방법 정리
필요한 우분투와 ROS 버전 확인 설치 전, 리눅스 버전에 대해 설명드리겠습니다. ROS는 Debian, Windows 10 등 다양한 OS에서의 작동을 지원하지만 Ubuntu를 공식지원하며, Ubuntu 환경을 이용하는 유저가
whiteknight3672.tistory.com
2. 환경 만들기!
python version 3.7으로 conda env 생성
: ROS 때문이었던 것 같은데 이유를 까먹었다.
conda create -n data python=3.7
cv2 설치
pip install opencv-python
rosbag 설치- bagreader로 대체
pip install bagpy
rosbag 설치
conda install -c conda-forge ros-rosbag
**cv_bridge 설치**
conda install -c conda-forge ros-cv-bridge
3. Rosbag 파일 열어보기
원하는 토픽을 알아보기 위해서 rosbag info 명령어를 사용.
rosbag info data.bag
해당 토픽막 쏙 빼내서 변환하기 아래의 깃허브 코드를
편의를 위해 조금 수정하여 변환하였다.
https://gist.github.com/wngreene/835cda68ddd9c5416defce876a4d7dd9
Extract images from a rosbag.
Extract images from a rosbag. GitHub Gist: instantly share code, notes, and snippets.
gist.github.com
주의점 :
cv_bridge는 python2에서 돌려야하므로 유의할 것!(cv2 때문)
'공부쓰 > research : memo' 카테고리의 다른 글
mobaXterm rendering error sol~! (2) | 2021.09.03 |
---|---|
영어 작문에 도움되는 강의 추천 (Coursera) (2) | 2021.04.05 |
2021.03.31 TODO LIST (0) | 2021.03.31 |