Skip to content
This repository has been archived by the owner on Apr 12, 2024. It is now read-only.

Latest commit

 

History

History
33 lines (20 loc) · 2.33 KB

WSL_ROSBAG_TIPS.md

File metadata and controls

33 lines (20 loc) · 2.33 KB

ROSbag Tips

Some solutions to issues I encountered to running rosbags.

These bags really helped during testing since we often can't get racing data or have to stick to the basement of BIDC -_-

If you're looking for vehicle lidar data from residential areas, try the Kitti Dataset, or Jackal Dataset. This bag has some coned FSAE pointclouds

Running ROS1 bags on WSL

The bag file utility in ros2 ros2 bag has compatibility settings for running bags recorded with ROS1. The command is ros2 bag play -s rosbag_v2 bagfile.bag, but chances are you do not have the rosbag_v2 plugin installed

  1. First, add the (noetic apt repository)[http://wiki.ros.org/noetic/Installation/Ubuntu], or that of another ROS1 version.

sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list'

curl -s https://raw.githubusercontent.com/ros/rosdistro/master/ros.asc | sudo apt-key add -

sudo apt update

  1. Then install the bag compatibility plugin sudo apt install ros-<distro>-rosbag2-bag-v2-plugins. This will install its dependency, ros-distro-ros1-bridge, which further requires some noetic packages

  2. In order to have ROS 1 and 2 active together, we must source /opt/ros/noetic/setup.bash and /opt/ros/foxy/setup.bash, in that order. If you are sourcing foxy in your .bashrc already, add this before it:

source /opt/ros/noetic/setup.bash
source /opt/ros/foxy/setup.bash
  1. ROS distros are activated until the end of the shell session, which means source ~/.bashrc won't reload them correctly. Instead, you should log out and log back in. For WSL users, wsl --shutdown does not actually perform a full log out. You can simulate relogin this by running sudo su - $USER manually in the terminal with ros2 bag. see why
  2. Finally, the command ros2 bag play -s rosbag_v2 bagfile.bag should work
  3. Note that while source /opt/ros/noetic/setup.bash is still in your .bashrc, you'll have to run sudo su - $USER on every new shell. There not good solution other than to revert your .bashrc after you finish your rosbag business.