We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
No description provided.
The text was updated successfully, but these errors were encountered:
A python module will be added for this case.
like:
import sys # source a bash script, # and get the environment variables in that environemnt def source(script, update=True): """ http://pythonwise.blogspot.fr/2010/04/sourcing-shell-script.html (Miki Tebeka) http://stackoverflow.com/questions/3503719/#comment28061110_3505826 (ahal) https://stackoverflow.com/a/20669683 """ import subprocess import os proc = subprocess.Popen( ['bash', '-c', 'set -a && source {} && env -0'.format(script)], stdout=subprocess.PIPE, shell=False) output, err = proc.communicate() output = output.decode('utf8') env = dict((line.split("=", 1) for line in output.split('\x00') if line)) if update: os.environ.update(env) return env def import_ros_ws(ws_path, update=True): env = source(os.path.expanduser(ws_path) + "/devel/setup.bash") sys.path.append(os.environ["PYTHONPATH"]) def import_ros(ros_path=None, update=True): default_ros_path="/opt/ros/kinetic" if ros_path is None: env = source(os.path.expanduser(default_ros_path) + "/setup.bash") else: env = source(os.path.expanduser(ros_path) + "/setup.bash") sys.path.append(os.environ["PYTHONPATH"])
Sorry, something went wrong.
No branches or pull requests
No description provided.
The text was updated successfully, but these errors were encountered: