ROS2 rosbag2 read bag file
I recorded data using ros2 bag record --all --output test.bag
in ROS2 Foxy. In ROS1 I could read the bag contents using something like:
import rosbag
bag = rosbag.Bag('test.bag')
for topic, msg, t in bag.read_messages(topics=['chatter', 'numbers']):
print(msg)
bag.close()
What is the ROS2 equivalent code?