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

can't use sudo rosbag

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

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

Comments

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

PapaG gravatar image PapaG  ( 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

Question Tools

2 followers

Stats

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

Seen: 339 times

Last updated: Aug 21 '19