Need sudo right in RosLaunch
Hello, I try to launch a node which contain a pigpio library command (init, read, write, handler ...) But roslaunch resend me :
±----------------------------------------------------------------------------+
|Sorry, you don’t have permission to run this program. |
|Try running as root, e.g. precede the command with sudo. |
±----------------------------------------------------------------------------+
It's pigpio access who need sudo right to initialise and so on. Have you an idea, how to get around that need ??
Thx, Thierry
Asked by Thierry on 2019-12-03 07:25:48 UTC
Comments
There are many questions about this, e.g. #q216441, #q229435, #q232819, to name a few. Please check those and search around this site a little bit. Feel free to reopen if none of those answers help, but please explain which answers you found, which did not apply to you and which didn't work.
Thank you.
Asked by mgruhler on 2019-12-03 09:16:50 UTC
I readden these links but anyone not give me a solution, they don't use pigpio but olders gpio version and they code in python not c++. PiGpio is the best library for me to manage interrupts with good result, others are dependent of cpu load.
Asked by Thierry on 2019-12-04 04:22:10 UTC
This seems to me to be more of a
pigpio
question then.The suggested approach seems to start the
pigpiod
daemon (with sudo) and use thepigpio_if2
library from userland (without sudo) to interface with it.Asked by mgruhler on 2019-12-04 05:05:18 UTC
Yes i seen that and i have tried to code in python to test, but i'm not python expert !!! I give you news when good results.
Asked by Thierry on 2019-12-04 06:23:08 UTC
There is also a C library...
Asked by mgruhler on 2019-12-04 06:54:32 UTC
I think, i found my solution. With pigpiod_if2 library, that seem good .... Give you result later.
Asked by Thierry on 2019-12-04 09:35:57 UTC
YES, i confirm. Declared pigpiod_if2 library in CMakelist.txt and used pigpio_if2.h in C or CPP file and launch pigpiod daemon at startup and no need to use sudo law. THAT'S OK
Asked by Thierry on 2019-12-10 07:23:53 UTC
Hey, I am facing the same issue with ROS Noetic on a RP4 and Ubuntu 20.04. Just to make sure. Did you just link the pigpiod_if2 in the CMakeslist.txt to the Node which needs the pigpiod? My current approach: target_link_libraries(node_name pigpio) Do I need to change it to pigpio_if2 when i understand that correct? In cpp file you include instead of , right?
Sorry for the very basic question. I just started with ROS and RP4.
Asked by nicmcgurck on 2021-12-23 02:42:14 UTC