PYTHON/ROS

[ROS 실무] 2. ROS bag file - plot

Auzii 2022. 12. 16. 11:21
300x250
Install [ rosbag2 plot in ubuntu 20.04 (ROS foxy) ]

 

Install & run

▶1) https://github.com/ros2/rosbag2/tree/emersonknapp/futurize-foxy
download through zip file (because we need foxy branch not master)

 

https://github.com/ros2/rcl_interfaces
https://github.com/ros2/test_interface_files

 

rcl_interfaces and test_interface_files install. Then, you can see three packages(rosbag2-emersonknapp-futur..., rcl_interfaces-master, test_interface_files-master) in src folder of your workspace

 

▶2) ~/bag_ws

 

$ colcon build --merge-install

 

▶3) make test package.. ex) bagtest folder$ros2 run bagtest bag


you should handle this two files:

/home/~/foxybag_ws/src/bagtest/bagtest/bag.py
/home/~/foxybag_ws/src/rosbag2-emersonknapp-futurize-foxy/rosbag2_py/test/test_sequential_reader.py

 

Errors

▶1) metadatasize error


you need to install ros2/rosbag github file for foxy user


So, https://github.com/ros2/rosbag2/tree/emersonknapp/futurize-foxy << Come


you should install zip file, not use git clone http (this is master branch)

 

▶2)pybind11 error

 

$ pip3 install onnx
$ sudo apt-get install python3-pybind11

 


 

bag.py에서 수정할 것

 

1. 맨 위 topic_list에서 내가 보고 싶은 topic name 넣기

2. main 문에서

bag_path = os.getcwd() + '/폴더경로/파일명'

으로 수정 후 실행

300x250