watonomous.github.io

  1. Knowledge Base
  2. Knowledge Base Home
  3. General Tutorials

[ Knowledge Base : Rosbag Tutorial ]

Created by [ Rowan Dempster], last modified by [ Charles Zhang] on Jan 06, 2020

Rosbag Visualization

To replay a rosbag, ensure you've install ROS Kinetic on Ubuntu 16.04. Using tmux to manage your terminals really comes in handy. T<num> represents a terminal to be opened.

  1. In T1, run roscore.
  2. In T2, run rviz
  3. In T3, run:
    1. rosbag play -l path/to/myrosbagfile.bag.

    2. Press 'space' to pause and 's' to step through frames.
    3. Read this for many options, like skipping into a rosbag, playing only a few seconds, etc.: http://wiki.ros.org/rosbag/Commandline#rosbag_play.

Rosbag Server

Rosbag Filtering

Recording Rosbags

rosbag record documentation: http://wiki.ros.org/rosbag/Commandline#rosbag_record

On the Rugged, there is an alias defined in /home/autodrive/.watoalias called `rosbag_record` that records most relevant topics. Use and update this alias when necessary

Usage:

Tips

Perception Tips:

In Rviz, to visualize LIDAR data, switch the Fixed Frame value to /velodyne. If you don't what Rviz is or how to use it, see the tutorial here: http://wiki.ros.org/rviz/Tutorials.

If you find that your LIDAR data doesn't change after a while accumulates from previous frames, run:
rosparam set /use_sim_time false, then restarting rviz

To extract images from a rosbag install image_view and follow remaining steps:

sudo apt-get install ros-kinetic-image-view # not necessary on full install
mkdir image-dataset
cd image-dataset
rosrun image_view extract_images image:=/camera/image_color _sec_per_frame:=0.2
#or
rosrun image_view video_recorder image:=/camera/image_color _fps:=5 _filename:=output.avi

Note, if it appears your rosbag is choppy or laggy, it might be in compressed form which makes it slow to read. You must decompress the file before using it:

rosbag decompress <my-ros-bag-name>.bag

Document generated by Confluence on Nov 19, 2021 12:20

Atlassian