本記事では,ros2のbagファイルをcsvに変換する方法を説明します.
・ros2bag_to_csvをコマンドで実行する方法
(execute)
ros2 topic echo /nmea_1/nmea_sentence nmea_msgs/msg/Sentence --csv --qos-history keep_all --qos-reliability reliable > nmea_output.csv
ros2 topic echo /localization/gnss/pose_with_covariance geometry_msgs/msg/PoseWithCovarianceStamped --csv --qos-history keep_all --qos-reliability reliable > gnss.csv
ros2 topic echo /localization/pose_estimator/pose_with_covariance geometry_msgs/msg/PoseWithCovarianceStamped --csv --qos-history keep_all --qos-reliability reliable > ndt.csv
ros2 topic echo /localization/pose_twist_fusion_filter/biased_pose_with_covariance geometry_msgs/msg/PoseWithCovarianceStamped --csv --qos-history keep_all --qos-reliability reliable > ekf.csv
(example)
ros2 topic echo /YOUR_TOPIC your_msgs/msg/YourMsgType --csv --qos-history keep_all --qos-reliability reliable > output.csv
(execute)
ros2 bag play -r 100 '/home/megken/rosbag2_2024_06_11-19_34_20'
(example)
ros2 bag play -r 100 YOUR_BAG_DIR
参考URL
https://zenn.dev/xen_nippon/articles/0ae35719f6cc44
・NMEAセンテンスについて
参考URL
https://ales-corp.co.jp/technical-information-nmea/
・DEG形式からDMM形式変換
参考URL
https://www.tokyo2show.co.jp/knowledge/?p=15