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 데이터 분석기 | Visualize messages from live ROS or ROS 2 topics and bag files (R2023a 이후) |
함수
rosbagreader | Access rosbag log file information (R2021b 이후) |
select | rosbag에서 메시지의 일부 선택 (R2019b 이후) |
timeseries | Create time series object for selected message properties (R2019b 이후) |
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 로그 파일 열기 및 구문 분석 (R2019b 이후) |
readMessages | rosbag에서 메시지 읽기 (R2019b 이후) |
BagSelection | rosbag 선택 항목을 저장하기 위한 객체 (R2019b 이후) |
블록
Read Data | Play back data from log file (R2019b 이후) |
도움말 항목
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.
Bag 파일 분석
- ROS 데이터 분석기 앱 시작하기
ROS 데이터 분석기 앱을 사용하여 라이브 ROS 또는 ROS 2 토픽 및 bag 파일의 메시지를 시각화합니다. - Load and Play ROS or ROS 2 Bag File
Load and play ROS or ROS 2 bag file in ROS Data Analyzer app. - Control ROS or ROS 2 Bag File Playback
Control playback of ROS or ROS 2 bag file in ROS Data Analyzer app. - Visualize Messages from Live ROS or ROS 2 Topics
Visualize messages from live ROS or ROS 2 topics in ROS Data Analyzer app.