Robotics StackExchange | Archived questions

How to rosrun a node as sudo or edit roslaunch file?

Hi, I create a package which is about using multi VL53L0X sensors on Jetson TK1.

Click me to blog

Click me to Github

Because of using GPIO and I2C, I have to rosrun this node as super user.

Here is my rosrun steps:

termianl 1

roscore

terminal 2

sudo su
rosrun ranged_finder measure1sensor_node

How can I do to edit in a launch file or create a shell script to make steps less?

Thanks :)

Asked by YingHua on 2017-01-09 00:56:55 UTC

Comments

in general, you should avoid having a node run as sudo. Can't you change the permissions of GPIO and I2C to have read rights there? There are many similar questions about GPIOs (click the tag) and one about GPIO with jetson

Asked by mgruhler on 2017-01-09 02:54:55 UTC

GPIO is not used when I only use one sensor.I think my question is more about rosrun i2c at super user.Thanks for your response :)

Asked by YingHua on 2017-01-09 03:37:05 UTC

Well, the same holds there: can't you get read access on the I2C?

Asked by mgruhler on 2017-01-09 03:44:56 UTC

Yes,my node works. I just want to make my steps less :)

Asked by YingHua on 2017-01-09 03:58:51 UTC

Answers