Executing a system shutdown will require root privileges (I think). Since ROS processes generally execute non-root, and since shutdown is a separate function from ROS anyway, I'd suggest using systemd to launch a service with root privileges which monitors for a button press, I2C message, or CAN message (however we end up wiring it). When the signal is detected, execute a graceful shutdown of ROS, then shutdown the pi.
Executing a system shutdown will require root privileges (I think). Since ROS processes generally execute non-root, and since shutdown is a separate function from ROS anyway, I'd suggest using systemd to launch a service with root privileges which monitors for a button press, I2C message, or CAN message (however we end up wiring it). When the signal is detected, execute a graceful shutdown of ROS, then shutdown the pi.
This page has some useful info: https://github.com/TonyLHansen/raspberry-pi-safe-off-switch/