Need sudo right in RosLaunch [closed]

asked 2019-12-03 06:26:52 -0600

Thierry gravatar image

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

edit retag flag offensive reopen merge delete

Closed for the following reason duplicate question by mgruhler
close date 2019-12-03 08:13:26.190314

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.

mgruhler gravatar imagemgruhler ( 2019-12-03 08:16:50 -0600 )edit

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.

Thierry gravatar imageThierry ( 2019-12-04 03:22:10 -0600 )edit

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 the pigpio_if2 library from userland (without sudo) to interface with it.

mgruhler gravatar imagemgruhler ( 2019-12-04 04:05:18 -0600 )edit

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.

Thierry gravatar imageThierry ( 2019-12-04 05:23:08 -0600 )edit

There is also a C library...

mgruhler gravatar imagemgruhler ( 2019-12-04 05:54:32 -0600 )edit

I think, i found my solution. With pigpiod_if2 library, that seem good .... Give you result later.

Thierry gravatar imageThierry ( 2019-12-04 08:35:57 -0600 )edit
1

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

Thierry gravatar imageThierry ( 2019-12-10 06:23:53 -0600 )edit