Writing to GPIO pins on Raspberry Pi from ROS2 node
I'm trying to write to my RPi's GPIO pins using the pigpio
library (http://abyz.me.uk/rpi/pigpio/index.html) from within a ROS2 node. The problem is, that in order to use a pigpio
program you need sudo
rights. If I try running my node as sudo with sudo ros2 run package node
I get an error saying sudo: ros2: command not found
. It is definitely not because I forgot to source my workspace. So can anyone tell me how to run my node with sudo? Or does anyone know about a workaround?