0
$\begingroup$

Rosanswers logo

Hello smart people,

I have made a ROS node that makes use of an FTDI library that requires that I run the executable as root to have access to the usb device that the node reads data from. The trouble with running the executable as a super user is that it prevents me from being able to see the roscore master because root uses a different environment and I can't seem to export the ROS master URI location to root's environment variables. Has anyone figured out how to publish/subscribe to rostopics when running a node as a super user?

P.S. Changing permissions on the usb device is not something I think I can do to solve this because FTDI's instructions for use of this library is that I remove the modules that would have the device show up in the /dev/ folder (i.e. rmmod ftdi_sio & rmmod usbserial)

Thanks for the help!


Originally posted by wmrifenb on ROS Answers with karma: 1 on 2016-07-08

Post score: 0


Original comments

Comment by spmaniato on 2016-07-08:
If that's an option, just source the ROS installation and workspaces (as superuser), so that the environment variables will be set. The easiest way would be to actually login as superuser (e.g. sudo su in Ubuntu) and then source the normal user's .bashrc (if it's set up with ROS stuff)

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

Yes, that should work.

However, setting the permissions is the better way. udev should work, or just adding yourself to the dialout group.


Originally posted by dornhege with karma: 31395 on 2016-07-08

This answer was ACCEPTED on the original site

Post score: 0


Original comments

Comment by wmrifenb on 2016-07-08:
This doesn't really answer my question. Adding myself to the dialout group wont work because the device is removed from the /dev/ folder upon removal of the modules I mentioned. What I really want to know is how to get a node that is running under root to talk to the ros master

Comment by dornhege on 2016-07-11:
There shouldn't be any difference. Just treat root as another ros user.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.