# To get a list of build commands ./apollo.sh # To make sure you start clean ./apollo.sh clean # This will build the full system and requires that you have an nVidia GPU with nVidia drivers loaded bash apollo.sh build
dfunction start() { ./scripts/monitor.sh start ./scripts/dreamview.sh start if [ $? -eq 0 ]; then http_status="$(curl -o -I -L -s -w '%{http_code}' ${DREAMVIEW_URL})" if [ $http_status -eq 200 ]; then echo"Dreamview is running at"$DREAMVIEW_URL else echo"Failed to start Dreamview. Please check /apollo/data/log or /apollo/data/core for more information" fi fi } #case $1 in ...
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" #获取脚本的绝对路径 cd "${DIR}/.." source "${DIR}/apollo_base.sh" # run function from apollo_base.sh # run command_name module_name run dreamview "$@" #$@对应为start(命令行参数)
stop_parser = subparsers.add_parser( 'stop', help='stop all the module in launch file') stop_parser.add_argument('file', nargs='?', action='store', help='launch file, default stop all the launcher')
# restart_parser = subparsers.add_parser('restart', help='restart the module') # restart_parser.add_argument('file', nargs='?', action='store', help='launch file, # default is cyber.launch')
defstart(launch_file = ''): # ... process_list = [] root = tree.getroot() for env in root.findall('environment'): for var in env.getchildren(): os.environ[var.tag] = str(var.text) # 对应.launch文件的编写规则 for module in root.findall('module'): module_name = module.find('name').text dag_conf = module.find('dag_conf').text process_name = module.find('process_name').text sched_name = module.find('sched_name') # 分为binary与library,不设定默认为binary process_type = module.find('type') # 异常处理程序 exception_handler = module.find('exception_handler') # ... if process_name notin process_list: if process_type == 'binary': if len(process_name) == 0: logger.error('Start binary failed. Binary process_name is null') continue # <type>是binary时的启动程序(只看到dreamview与v2x的type是binary,无dag文件) # 此时传入的是可执行文件的路径(process_name.split()[0]) pw = ProcessWrapper(process_name.split()[0], 0, [""], process_name, process_type, exception_handler) # default is library else: # <type>是library时的binary_path是mainboard pw = ProcessWrapper(g_binary_name, 0, dag_dict[str(process_name)], process_name, process_type, sched_name, exception_handler) result = pw.start() if result != 0: logger.error('Start manager [%s] failed. Stop all!' % process_name) stop() pmon.register(pw) process_list.append(process_name)
# no module in xml ifnot process_list: logger.error("No module was found in xml config.") return all_died = pmon.run() ifnot all_died: logger.info("Stop all processes...") stop() logger.info("Cyber exit.")