Lidar Labeler Rosbag Loading Error (Ubuntu 20.04): Could not locate the base directory for ros.

17 views (last 30 days)
Hello everyone,
I try to make use of the Rosbag loading feature ( I selected Import > Add Point Cloud and then switched to Rosbag and the loading error appeared.
I have installed the Matlab ROS Toolbox and I have installed ROS noetic
env | grep ROS
and I have sourced ROS
source /opt/ros/noetic/setup.bash
Why does this loading error still appear?
Thanks in advance

Accepted Answer

Cam Salzberger
Cam Salzberger on 6 Apr 2021
Hello Daniel,
Does the error occur if you try to load the rosbag data outside of the Lidar Labeler?
bag = rosbag(filePath);
msgs = readMessages(bag, 1); % Testing with just the first message to start, try more if it works
If the error occurs, my suspicion is that you are seeing a library conflict between the ROS MATLAB libraries and the installed ROS libraries and their dependencies. MATLAB uses ROS Melodic, while you have ROS Noetic installed, so there will be a fair number of different library versions.
Try starting MATLAB without having sourced ROS Noetic and without pointing towards the installed Noetic folders. You may have to double-check your PATH and LD_LIBRARY_PATH environment variables to make sure that no "noetic" folders are still present before starting MATLAB.
It would be helpful to see exact error messages too, at least to make it easier for other users to find this post.
  1 Comment
Daniel He
Daniel He on 9 Apr 2021
Hello Cam,
This is really embarassing, but it turns out that I just didn't have my ROS Toolbox installed (even I though I very sure I checked the Box to install the it)
Your answer would have been still helpful, because I figured my mistake out through testing with a similar script from a friend
Thank you for you answer

Sign in to comment.

More Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by