Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Please use the search first in the future, this has been asked multiple times already. That sounds harsh, and we do want to help you, but with almost 35000 questions on this site it gets more and more important to avoid duplicates.

As to your question: yes, this is possible, you'll just have to make sure that the environment in which you run your Python script has already been setup with the appropriate environment variables. In other words: run it from a terminal in which you have sourced the correct setup.bash, and make sure your Popen call inherits the environment from its caller.

As an alternative: do not start roslaunch .. directly in your Popen call, but use a small wrapper script that first sources the setup.bash and then executes roslaunch.

Please use the search first in the future, this has been asked multiple times already. That sounds harsh, and we do want to help you, but with almost 35000 questions on this site it gets more and more increasingly important to avoid duplicates.

As to your question: yes, this is possible, you'll just have to make sure that the environment in which you run your Python script has already been setup with the appropriate environment variables. In other words: run it from a terminal in which you have sourced the correct setup.bash, and make sure your Popen call inherits the environment from its caller.

As an alternative: do not start roslaunch .. directly in your Popen call, but use a small wrapper script that first sources the setup.bash and then executes roslaunch.