feat: 增加base64传入动作指令

feat: 换用 deepseek 大模型
pref: 修改应急避险2停车条件
This commit is contained in:
bmy
2024-08-04 10:04:27 +08:00
parent 55f5b13d8c
commit f3bb720bed
7 changed files with 278 additions and 130 deletions

16
app.py
View File

@@ -10,7 +10,8 @@ import os
import time
import subprocess
import signal
import importlib
import base64
import json
from main_upper import main_func
server_command = [
{"path": "/home/evan/Workplace/project_capture/build/", "script": "./capture"},
@@ -51,7 +52,7 @@ logger.add(handler, format="{time:MM-DD HH:mm:ss} {message}", level="DEBUG")
fileOptions_path = '/home/evan/Workplace/project_main'
fileOptions_list = ['cfg_args.toml','cfg_main.toml', 'cfg_subtask.toml']
cfg_args_path = os.path.join(fileOptions_path, 'cfg_args.toml')
cfg_move_area_path = os.path.join(fileOptions_path, 'cfg_move_area.json')
@app.route('/')
def index():
@@ -64,6 +65,17 @@ def run():
config_args['lane_mode']['mode_index'] = int(mode_index)
with open(cfg_args_path, 'w') as config_file:
toml.dump(config_args, config_file)
try:
action_base64 = request.args.get('action')
decoded_bytes = base64.b64decode(action_base64)
decoded_str = decoded_bytes.decode('utf-8')
json_data = json.loads(decoded_str)
with open(cfg_move_area_path, 'w') as json_file:
json.dump(json_data, json_file)
except:
# 当该字段没有传入参数时 清空配置文件 该任务按照正常流程去做
with open(cfg_move_area_path, 'w') as json_file:
pass
return render_template('index2.html')
# @app.route('/csdn')