ROS Bag 파일 기록 및 분석
ROS bag 파일을 가져오고 시각화하고 분석하기
ROS 토픽의 메시지 데이터는 ROS bag 파일(rosbag)이라고 불리는 로그 파일에 저장됩니다. MATLAB® 함수, 앱, Simulink® 블록을 사용하여 이러한 rosbag 파일의 ROS 데이터에 액세스하고 필터링하고 오프라인 분석을 실행할 수 있습니다. 이러한 bag은 대개 하나 이상의 ROS 토픽을 서브스크라이브하고 수신된 메시지 데이터를 효율적인 파일 구조에 저장함으로써 생성됩니다. rosbag을 사용한 작업에 대한 예제는 Work with rosbag Logfiles 항목을 참조하십시오.
rosbagreader를 사용하여 rosbag에서 메시지 데이터를 추출하고, rosbagwriter를 사용하여 rosbag 로그 파일을 만들고 로그를 씁니다. 또한 ROS 기록기 앱을 사용하여 Simulink 시뮬레이션 동안 ROS 메시지를 기록할 수 있습니다. 자세한 내용은 Use ROS Logger App to Save ROS Messages from Simulink 항목을 참조하십시오.
ROS bag 로그 파일의 메시지를 시각화하고 라이브 ROS 토픽을 보려면 ROS 데이터 분석기 앱을 사용합니다.
앱
| ROS 데이터 분석기 | ROS 또는 ROS 2의 라이브 토픽과 bag 파일에서 메시지 시각화 (R2023a 이후) |
함수
rosbagreader | rosbag 로그 파일 정보 액세스 (R2021b 이후) |
select | rosbag에서 메시지의 일부 선택 |
timeseries | Create time series object for selected message properties |
timetable | Create timetable for selected message properties in ROS bag file (R2024a 이후) |
rosbagwriter | Create and write logs to rosbag log file (R2021b 이후) |
write | Write logs to rosbag log file (R2021b 이후) |
rosbag | rosbag 로그 파일 열기 및 구문 분석 |
readMessages | rosbag에서 메시지 읽기 |
BagSelection | rosbag 선택 항목을 저장하기 위한 객체 |
블록
| Read Data | Play back data from log file |
도움말 항목
Bag 파일 분석
- ROS 데이터 분석기 앱 시작하기
ROS 데이터 분석기 앱을 사용하여 라이브 ROS 또는 ROS 2 토픽 및 bag 파일의 메시지를 시각화합니다.
MATLAB에서 Bag 기록
- ROS Log Files (rosbags)
Summary of the structure of rosbags and the workflow for selecting subsets of messages in a rosbag. - Work with rosbag Logfiles
Load arosbag, and learn how to select and retrieve the contained messages.
Simulink에서 Bag 기록
- Log ROS Messages from Simulink to a Rosbag Logfile
Save ROS message data from Simulink to a rosbag file.



