Ask Your Question
0

can't use sudo rosbag

asked 2019-08-20 21:39:32 -0500

I can use rosbag by "rosbag record" and "sudo su" then "rosbag record" ,but I can't “sudo rosbag” I will get that:: ""Traceback (most recent call last): File "/opt/ros/melodic/bin/rosbag", line 34, in <module> import rosbag ImportError: No module named rosbag"" How should I config env?

edit retag flag offensive close merge delete

Comments

have you sourced the ros env? source /opt/ros/<DISTRO>/setup.bash

PapaG gravatar imagePapaG ( 2019-08-20 23:32:46 -0500 )edit

1 Answer

Sort by » oldest newest most voted
0

answered 2019-08-21 17:58:58 -0500

tfoote gravatar image

When you use sudo by default it removes your environment. You need to use -E to keep the environment.

https://stackoverflow.com/questions/8...

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

2 followers

Stats

Asked: 2019-08-20 21:39:32 -0500

Seen: 14 times

Last updated: Aug 21