17 """This launcher simply start Webots.""" 24 optParser = optparse.OptionParser()
25 optParser.add_option(
"--world", dest=
"world", default=
"", help=
"Path to the world to load.")
26 optParser.add_option(
"--mode", dest=
"mode", default=
"realtime", help=
"Startup mode.")
27 optParser.add_option(
"--no-gui", dest=
"noGui", default=
"false", help=
"Start Webots with minimal GUI.")
28 options, args = optParser.parse_args()
30 if 'WEBOTS_HOME' not in os.environ:
31 sys.exit(
'WEBOTS_HOME environment variable not defined.')
32 command = [os.path.join(os.environ[
'WEBOTS_HOME'],
'webots'),
'--mode=' + options.mode, options.world]
33 if options.noGui ==
'true':
34 command.append(
'--stdout')
35 command.append(
'--stderr')
36 command.append(
'--batch')
37 command.append(
'--no-sandbox')
38 command.append(
'--minimize')
40 subprocess.call(command)