ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

can't use sudo rosbag

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

datnt2509 gravatar image

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


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

PapaG gravatar image PapaG  ( 2019-08-20 23:32:46 -0600 )edit

1 Answer

Sort by » oldest newest most voted

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

tfoote gravatar image

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

edit flag offensive delete link more

Question Tools



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

Seen: 338 times

Last updated: Aug 21 '19