Ask Your Question

Revision history [back]

You can make one node of your launch run as root - using launch-prefix - while keeping the rest running as user. Here is an example launch file:

<launch>
<node pkg="i2cpwm_board" name="i2cpwm_board_node" type="i2cpwm_board" output="screen" launch-prefix="sudo -E ">
</node>
</launch>

You can make one node of your launch run as root - using launch-prefix - while keeping the rest running as user. Here is an example launch file:

<launch>
<node pkg="i2cpwm_board" name="i2cpwm_board_node" type="i2cpwm_board" output="screen" launch-prefix="sudo -E ">
</node>
</launch>

In this example, we need root access for the I2C device on a Raspberry Pi.