Robotics StackExchange | Archived questions

rosbag_v2 loop problem

Hi everyone; I am using Ubuntu 20.04 and installed Foxy and Noetic on my computer. I wanted to use a rosbag file in my environment and my main middle framework is Foxy and therefore, I installed ros-foxy-rosbag2-bag-v2-plugins to run rosbag files on ROS2. This tool works well. But, since the rosbag file is too short, I want to loop this file and obtain an appropriate simulation environment. When I used ros2 bag play -l rosbag_v2 for looping, I got the error: usage:

ros2 bag play [-h] [-s STORAGE] [--read-ahead-queue-size READ_AHEAD_QUEUE_SIZE] [-r RATE] [--topics TOPICS [TOPICS ...]] [--qos-profile-overrides-path QOS_PROFILE_OVERRIDES_PATH] [-l]
                     [--remap REMAP [REMAP ...]]
                     bag_file
ros2 bag play: error: argument bag_file: Bag file 'rosbag_v2' does not exist!

What is the reason of this error?

Asked by mfatih on 2021-06-10 08:44:04 UTC

Comments

Shouldn't you include the .bag extension?

Asked by gvdhoorn on 2021-06-10 09:45:27 UTC

You might be forgetting the .bag extension, as @gvdhoorn suggested

Asked by aprotyas on 2021-06-10 11:18:37 UTC

@gvdhoorn and @aprotyas Yes, its full name is rosbag_v2. It is not bag file, it is tool to play rosbag files on ROS2.

Asked by mfatih on 2021-06-11 09:44:02 UTC

Answers

I fixed this by changing the place of -l command. I placed it in front of the bag file like that ros2 bag play -s rosbag_v2 -l <bag file>.

Asked by mfatih on 2021-06-11 09:41:28 UTC

Comments