ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange |
1 | initial version |
So, I figure out how to make this work.
The reason why it wasn't working was: The option -E (preserve environment) of Sudo present the environment except for variable like PATH, LD_LIBRARY_PATH etc are not preserved.
In my case, LD_LIBRARY_PATH was needed (to find libroscpp.so). So I fixed it by explicitely sending this variable to the sudo environement:
<node name="bb_pigpio_node" pkg="bb_pigpio" type="bb_pigpio_node" launch-prefix="sudo -E LD_LIBRARY_PATH=$(optenv LD_LIBRARY_PATH)">
<rosparam command="load" file="$(find bb_pigpio)/config/bb_encoder.yaml" />
</node>
There is still a question. Why it was working without this using the devel/build directory and not the install one.