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

Rclpy with sudo [closed]

asked 2019-04-04 18:14:22 -0500

MathSqrt2 gravatar image

I have a Raspberry Pi 3b+ with Ubuntu ARM and ROS2 installed. I have a python package that writes to a topic every two seconds and it works fine when I run it without sudo the thing is that i need to run it as sudo since i have to send messages of my I2C sensor to that topic making SMBUS not work without it. The message that i get is the following: "No module named 'rclpy'"

edit retag flag offensive reopen merge delete

Closed for the following reason question is not relevant or outdated by tfoote
close date 2022-10-12 04:35:59.314003

Comments

If possible: try to see whether there is a way to give your current $USER write access to the hw (ie: file in /dev) instead. In most cases sudo is not needed, just access to the device file.

gvdhoorn gravatar image gvdhoorn  ( 2019-04-05 07:23:34 -0500 )edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2019-04-04 18:51:03 -0500

William gravatar image

You most likely need to source the setup file after escalating to a new shell with root privileges.

Or use -E perhaps: https://stackoverflow.com/questions/8...

edit flag offensive delete link more

Comments

Sadly the -E on the sudo is giving me the same error. You did you meant with the first thing you said? I'm kind newby to this :/

MathSqrt2 gravatar image MathSqrt2  ( 2019-04-05 04:16:46 -0500 )edit

Question Tools

Stats

Asked: 2019-04-04 18:14:22 -0500

Seen: 389 times

Last updated: Apr 04 '19