Need sudo right in RosLaunch [closed]
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
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.
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.
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.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.
There is also a C library...
I think, i found my solution. With pigpiod_if2 library, that seem good .... Give you result later.
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
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 <pigpio_if2.h> instead of <pigpio.h>, right? Sorry for the very basic question. I just started with ROS and RP4.