Scripts don't see ROS if executed by ProcessBuilder()

asked 2019-06-14 09:56:48 -0500

Cipek gravatar image

I want to execute a script with a ProcessBuilder(). My code is:

new ProcessBuilder().inheritIO().command("/bin/bash", "-c", "./deploy.sh").start();

In the bash script I have:

#!/bin/bash
rosrun my_package ardrone_test_1.py

It works if I run the bash script manually in the terminal, but if I do with the ProcessBuilder I got an error:

rosrun: command not found

The same if I run python scripts which uses ROS. There are errors that some package are not found, whereas it works fine if run via terminal.

edit retag flag offensive close merge delete