Robotics StackExchange | Archived questions

ImportError: cannot import name Bag

Hi, I've created a catkin workspace and I'm trying to open a rqtbag version made by me (with some plugins). The problem comes when I try to use roslaunch to launch rqtbag from my workspace.
If I open the standar rqt_bag it works, but if I do this, it does not work.

This is the error that it shows:

Traceback (most recent call last):
  File "/home/roberott/Escritorio/DepartamentoDeRobotica/catkin_ws/src/rqt_bag/scripts/rqt_bag", line 4, in <module>
    from rqt_bag import Bag
ImportError: cannot import name Bag

Asked by rosaru on 2020-12-16 14:14:11 UTC

Comments

Answers

It should be:

from rqt_bag.bag import Bag

Asked by mgruhler on 2020-12-17 02:20:35 UTC

Comments

It doesn't work either

Asked by rosaru on 2020-12-18 18:15:35 UTC

@rosaro what does that mean? Same error message? Different error message? Please be more specific.

On a vanilla kinetic install, this works after sourcing /opt/ros/kinetic/setup.bash (iff ros-kinetic-rqt-bag is installed via apt, obviously)

> source /opt/ros/kinetic/setup.bash
> python
Python 2.7.12 (default, Oct  5 2020, 13:56:01) 
[GCC 5.4.0 20160609] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> from rqt_bag.bag import Bag
>>> Bag
<class 'rqt_bag.bag.Bag'>

Asked by mgruhler on 2021-01-04 05:24:26 UTC