Compare commits
4 Commits
527fa4b04b
...
v1
| Author | SHA1 | Date | |
|---|---|---|---|
| 34504d9ff9 | |||
| 211b4767c1 | |||
| de8012a590 | |||
| 6205fabf34 |
37
app.py
37
app.py
@@ -1,4 +1,4 @@
|
|||||||
from flask import Flask, render_template
|
from flask import Flask, render_template, request
|
||||||
from flask_socketio import SocketIO
|
from flask_socketio import SocketIO
|
||||||
import toml
|
import toml
|
||||||
from loguru import logger
|
from loguru import logger
|
||||||
@@ -23,6 +23,8 @@ processes = []
|
|||||||
|
|
||||||
time_record = None
|
time_record = None
|
||||||
|
|
||||||
|
task_run_flag = False
|
||||||
|
|
||||||
# 日志队列
|
# 日志队列
|
||||||
queue = Queue()
|
queue = Queue()
|
||||||
# 跳过任务 干预任务调度
|
# 跳过任务 干预任务调度
|
||||||
@@ -49,14 +51,25 @@ logger.add(handler, format="{time:MM-DD HH:mm:ss} {message}", level="DEBUG")
|
|||||||
|
|
||||||
fileOptions_path = '/home/evan/Workplace/project_main'
|
fileOptions_path = '/home/evan/Workplace/project_main'
|
||||||
fileOptions_list = ['cfg_args.toml','cfg_main.toml', 'cfg_subtask.toml']
|
fileOptions_list = ['cfg_args.toml','cfg_main.toml', 'cfg_subtask.toml']
|
||||||
|
cfg_args_path = os.path.join(fileOptions_path, 'cfg_args.toml')
|
||||||
|
|
||||||
|
|
||||||
@app.route('/')
|
@app.route('/')
|
||||||
def index():
|
def index():
|
||||||
return render_template('index.html')
|
return render_template('index.html')
|
||||||
|
|
||||||
@app.route('/csdn')
|
@app.route('/run')
|
||||||
def csdn():
|
def run():
|
||||||
return render_template('csdn.html')
|
mode_index = request.args.get('mode')
|
||||||
|
config_args = toml.load(cfg_args_path)
|
||||||
|
config_args['lane_mode']['mode_index'] = int(mode_index)
|
||||||
|
with open(cfg_args_path, 'w') as config_file:
|
||||||
|
toml.dump(config_args, config_file)
|
||||||
|
return render_template('index2.html')
|
||||||
|
|
||||||
|
# @app.route('/csdn')
|
||||||
|
# def csdn():
|
||||||
|
# return render_template('csdn.html')
|
||||||
|
|
||||||
@socketio.on('operate')
|
@socketio.on('operate')
|
||||||
def operate_handle(data):
|
def operate_handle(data):
|
||||||
@@ -64,6 +77,7 @@ def operate_handle(data):
|
|||||||
global task_process
|
global task_process
|
||||||
global processes
|
global processes
|
||||||
global time_record
|
global time_record
|
||||||
|
global task_run_flag
|
||||||
if data['type'] == 'save_config':
|
if data['type'] == 'save_config':
|
||||||
f = open(os.path.join(fileOptions_path,data['file_name']), 'w')
|
f = open(os.path.join(fileOptions_path,data['file_name']), 'w')
|
||||||
ret = toml.dump(data['content'], f)
|
ret = toml.dump(data['content'], f)
|
||||||
@@ -99,6 +113,7 @@ def operate_handle(data):
|
|||||||
elif data['type'] == 'operate_task':
|
elif data['type'] == 'operate_task':
|
||||||
# 任务函数
|
# 任务函数
|
||||||
if data['content'] == 'run':
|
if data['content'] == 'run':
|
||||||
|
task_run_flag = True
|
||||||
if task_process != None:
|
if task_process != None:
|
||||||
task_process.terminate()
|
task_process.terminate()
|
||||||
time_record = time.perf_counter()
|
time_record = time.perf_counter()
|
||||||
@@ -106,6 +121,7 @@ def operate_handle(data):
|
|||||||
task_process.start()
|
task_process.start()
|
||||||
logger.info("开启 task")
|
logger.info("开启 task")
|
||||||
elif data['content'] == 'stop':
|
elif data['content'] == 'stop':
|
||||||
|
task_run_flag = False
|
||||||
task_process.terminate()
|
task_process.terminate()
|
||||||
logger.info(f"任务结束 用时{time.perf_counter() - time_record}s")
|
logger.info(f"任务结束 用时{time.perf_counter() - time_record}s")
|
||||||
logger.info("关闭 task")
|
logger.info("关闭 task")
|
||||||
@@ -125,6 +141,12 @@ def operate_handle(data):
|
|||||||
elif data['type'] == 'skip_task':
|
elif data['type'] == 'skip_task':
|
||||||
logger.info(data)
|
logger.info(data)
|
||||||
skip_task_queue.put(1)
|
skip_task_queue.put(1)
|
||||||
|
# elif data['type'] == 'save_target_person':
|
||||||
|
# config_path = os.path.join(fileOptions_path, 'cfg_args.toml')
|
||||||
|
# config_args = toml.load(config_path)
|
||||||
|
# config_args['lane_mode']['mode_index'] = int(data['content'])
|
||||||
|
# with open(config_path, 'w') as config_file:
|
||||||
|
# toml.dump(config_args, config_file)
|
||||||
|
|
||||||
@socketio.on('connect')
|
@socketio.on('connect')
|
||||||
def test_connect():
|
def test_connect():
|
||||||
@@ -134,6 +156,7 @@ def test_connect():
|
|||||||
for item in fileOptions_list:
|
for item in fileOptions_list:
|
||||||
config_data[item] = toml.load(os.path.join(fileOptions_path,item))
|
config_data[item] = toml.load(os.path.join(fileOptions_path,item))
|
||||||
socketio.emit('config_data', {'type': 'config_data', 'content': config_data})
|
socketio.emit('config_data', {'type': 'config_data', 'content': config_data})
|
||||||
|
socketio.emit('task_status', {'type': 'task_status', 'content': int(task_run_flag)})
|
||||||
def thread_function():
|
def thread_function():
|
||||||
global queue
|
global queue
|
||||||
while True:
|
while True:
|
||||||
@@ -146,6 +169,12 @@ def thread_function():
|
|||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
|
|
||||||
|
config_path = os.path.join(fileOptions_path, 'cfg_args.toml')
|
||||||
|
config_args = toml.load(config_path)
|
||||||
|
config_args['lane_mode']['mode_index'] = 1
|
||||||
|
with open(config_path, 'w') as config_file:
|
||||||
|
toml.dump(config_args, config_file)
|
||||||
|
|
||||||
log_file = "server_processes.log"
|
log_file = "server_processes.log"
|
||||||
log = open(log_file, "w")
|
log = open(log_file, "w")
|
||||||
time.sleep(2)
|
time.sleep(2)
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
[kick_ass]
|
[lane_mode]
|
||||||
target_person = 3
|
mode_index = 1
|
||||||
|
|
||||||
[task]
|
[task]
|
||||||
Subtask_enable = true
|
Subtask_enable = true
|
||||||
|
|||||||
@@ -6,14 +6,14 @@ logger_format = "{time} {level} {message}"
|
|||||||
|
|
||||||
[find_counts]
|
[find_counts]
|
||||||
GetBlock_counts = 5
|
GetBlock_counts = 5
|
||||||
PutBlock_counts = 8
|
PutBlock_counts = 12
|
||||||
GetBBall_counts = 5
|
GetBBall_counts = 5
|
||||||
UpTower_counts = 3
|
UpTower_counts = 3
|
||||||
GetRBall_counts = 10
|
GetRBall_counts = 10
|
||||||
PutBBall_counts = 15
|
PutBBall_counts = 15
|
||||||
PutHanoi1_counts = 7
|
PutHanoi1_counts = 7
|
||||||
PutHanoi2_counts = 2
|
PutHanoi2_counts = 2
|
||||||
PutHanoi3_counts = 1
|
PutHanoi3_counts = 5
|
||||||
MoveArea1_counts = 6
|
MoveArea1_counts = 6
|
||||||
MoveArea2_counts = 1700
|
MoveArea2_counts = 1700
|
||||||
KickAss_counts = 10
|
KickAss_counts = 10
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
[get_block]
|
[get_block]
|
||||||
pid_kp = 1.2
|
pid_kp = 1.0
|
||||||
pid_ki = 0
|
pid_ki = 0
|
||||||
pid_kd = 0
|
pid_kd = 0
|
||||||
first_block = "blue"
|
first_block = "blue"
|
||||||
@@ -15,17 +15,17 @@ pid_ki = 0
|
|||||||
pid_kd = 0
|
pid_kd = 0
|
||||||
|
|
||||||
[up_tower]
|
[up_tower]
|
||||||
pid_kp = 1.1
|
pid_kp = 1.0
|
||||||
pid_ki = 0
|
pid_ki = 0
|
||||||
pid_kd = 0
|
pid_kd = 0
|
||||||
|
|
||||||
[get_rball]
|
[get_rball]
|
||||||
pid_kp = 0.8
|
pid_kp = 1.5
|
||||||
pid_ki = 0
|
pid_ki = 0
|
||||||
pid_kd = 0
|
pid_kd = 0
|
||||||
|
|
||||||
[put_bball]
|
[put_bball]
|
||||||
pid_kp = 1.6
|
pid_kp = 2.0
|
||||||
pid_ki = 0
|
pid_ki = 0
|
||||||
pid_kd = 0
|
pid_kd = 0
|
||||||
|
|
||||||
@@ -42,7 +42,7 @@ pos_gap = 160
|
|||||||
first_target = "mp"
|
first_target = "mp"
|
||||||
|
|
||||||
[put_hanoi3]
|
[put_hanoi3]
|
||||||
pid_kp = 1.3
|
pid_kp = 1.7
|
||||||
pid_ki = 0
|
pid_ki = 0
|
||||||
pid_kd = 0
|
pid_kd = 0
|
||||||
|
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ pid_ki = 0
|
|||||||
pid_kd = 0
|
pid_kd = 0
|
||||||
|
|
||||||
[put_hanoi2]
|
[put_hanoi2]
|
||||||
pid_kp = 1.0
|
pid_kp = 2.0
|
||||||
pid_ki = 0
|
pid_ki = 0
|
||||||
pid_kd = 0
|
pid_kd = 0
|
||||||
pos_gap = 160
|
pos_gap = 160
|
||||||
|
|||||||
61
cfg_subtask.toml.7154.bak
Normal file
61
cfg_subtask.toml.7154.bak
Normal file
@@ -0,0 +1,61 @@
|
|||||||
|
[get_block]
|
||||||
|
pid_kp = 1.2
|
||||||
|
pid_ki = 0
|
||||||
|
pid_kd = 0
|
||||||
|
first_block = "blue"
|
||||||
|
|
||||||
|
[put_block]
|
||||||
|
pid_kp = 1.2
|
||||||
|
pid_ki = 0
|
||||||
|
pid_kd = 0
|
||||||
|
|
||||||
|
[get_bball]
|
||||||
|
pid_kp = 1.2
|
||||||
|
pid_ki = 0
|
||||||
|
pid_kd = 0
|
||||||
|
|
||||||
|
[up_tower]
|
||||||
|
pid_kp = 1
|
||||||
|
pid_ki = 0
|
||||||
|
pid_kd = 0
|
||||||
|
|
||||||
|
[get_rball]
|
||||||
|
pid_kp = 1.2
|
||||||
|
pid_ki = 0
|
||||||
|
pid_kd = 0
|
||||||
|
|
||||||
|
[put_bball]
|
||||||
|
pid_kp = 2
|
||||||
|
pid_ki = 0
|
||||||
|
pid_kd = 0
|
||||||
|
|
||||||
|
[put_hanoi1]
|
||||||
|
pid_kp = 0.7
|
||||||
|
pid_ki = 0
|
||||||
|
pid_kd = 0
|
||||||
|
|
||||||
|
[put_hanoi2]
|
||||||
|
pid_kp = 1
|
||||||
|
pid_ki = 0
|
||||||
|
pid_kd = 0
|
||||||
|
pos_gap = 160
|
||||||
|
first_target = "mp"
|
||||||
|
|
||||||
|
[put_hanoi3]
|
||||||
|
pid_kp = 2.5
|
||||||
|
pid_ki = 0
|
||||||
|
pid_kd = 0
|
||||||
|
|
||||||
|
[move_area]
|
||||||
|
pid_kp = 1.2
|
||||||
|
pid_ki = 0
|
||||||
|
pid_kd = 0
|
||||||
|
llm_enable = false
|
||||||
|
|
||||||
|
[kick_ass]
|
||||||
|
pid_kp = 0.8
|
||||||
|
pid_ki = 0
|
||||||
|
pid_kd = 0
|
||||||
|
pos_gap1 = 150
|
||||||
|
pos_gap2 = 80
|
||||||
|
target_person = 1
|
||||||
61
cfg_subtask.toml.raw.bak
Normal file
61
cfg_subtask.toml.raw.bak
Normal file
@@ -0,0 +1,61 @@
|
|||||||
|
[get_block]
|
||||||
|
pid_kp = 1.2
|
||||||
|
pid_ki = 0
|
||||||
|
pid_kd = 0
|
||||||
|
first_block = "blue"
|
||||||
|
|
||||||
|
[put_block]
|
||||||
|
pid_kp = 1.2
|
||||||
|
pid_ki = 0
|
||||||
|
pid_kd = 0
|
||||||
|
|
||||||
|
[get_bball]
|
||||||
|
pid_kp = 1.2
|
||||||
|
pid_ki = 0
|
||||||
|
pid_kd = 0
|
||||||
|
|
||||||
|
[up_tower]
|
||||||
|
pid_kp = 1.0
|
||||||
|
pid_ki = 0
|
||||||
|
pid_kd = 0
|
||||||
|
|
||||||
|
[get_rball]
|
||||||
|
pid_kp = 1.2
|
||||||
|
pid_ki = 0
|
||||||
|
pid_kd = 0
|
||||||
|
|
||||||
|
[put_bball]
|
||||||
|
pid_kp = 1.8
|
||||||
|
pid_ki = 0
|
||||||
|
pid_kd = 0
|
||||||
|
|
||||||
|
[put_hanoi1]
|
||||||
|
pid_kp = 0.7
|
||||||
|
pid_ki = 0
|
||||||
|
pid_kd = 0
|
||||||
|
|
||||||
|
[put_hanoi2]
|
||||||
|
pid_kp = 1.0
|
||||||
|
pid_ki = 0
|
||||||
|
pid_kd = 0
|
||||||
|
pos_gap = 160
|
||||||
|
first_target = "mp"
|
||||||
|
|
||||||
|
[put_hanoi3]
|
||||||
|
pid_kp = 1.5
|
||||||
|
pid_ki = 0
|
||||||
|
pid_kd = 0
|
||||||
|
|
||||||
|
[move_area]
|
||||||
|
pid_kp = 1.2
|
||||||
|
pid_ki = 0
|
||||||
|
pid_kd = 0
|
||||||
|
llm_enable = false
|
||||||
|
|
||||||
|
[kick_ass]
|
||||||
|
pid_kp = 0.8
|
||||||
|
pid_ki = 0
|
||||||
|
pid_kd = 0
|
||||||
|
pos_gap1 = 150
|
||||||
|
pos_gap2 = 80
|
||||||
|
target_person = 1
|
||||||
30
main.py
30
main.py
@@ -27,21 +27,21 @@ act.axis.exec()
|
|||||||
|
|
||||||
# 向任务队列添加任务
|
# 向任务队列添加任务
|
||||||
task_queue = queue.Queue()
|
task_queue = queue.Queue()
|
||||||
if cfg_main['task']['Subtask_enable'] is True:
|
# if cfg_main['task']['Subtask_enable'] is True:
|
||||||
task_queue.put(sb.task("人员施救第一块", sb.get_block1, cfg_main['find_counts']['GetBlock_counts'], cfg_main['task']['GetBlock_enable']))
|
# task_queue.put(sb.task("人员施救第一块", sb.get_block1, cfg_main['find_counts']['GetBlock_counts'], cfg_main['task']['GetBlock_enable']))
|
||||||
task_queue.put(sb.task("人员施救第二块", sb.get_block2, cfg_main['find_counts']['GetBlock_counts'], cfg_main['task']['GetBlock_enable']))
|
# task_queue.put(sb.task("人员施救第二块", sb.get_block2, cfg_main['find_counts']['GetBlock_counts'], cfg_main['task']['GetBlock_enable']))
|
||||||
task_queue.put(sb.task("紧急转移", sb.put_block, cfg_main['find_counts']['PutBlock_counts'], cfg_main['task']['GetBlock_enable']))
|
# task_queue.put(sb.task("紧急转移", sb.put_block, cfg_main['find_counts']['PutBlock_counts'], cfg_main['task']['GetBlock_enable']))
|
||||||
task_queue.put(sb.task("整装上阵", sb.get_bball, cfg_main['find_counts']['GetBBall_counts'], cfg_main['task']['GetBBall_enable']))
|
# task_queue.put(sb.task("整装上阵", sb.get_bball, cfg_main['find_counts']['GetBBall_counts'], cfg_main['task']['GetBBall_enable']))
|
||||||
# TODO 添加一个空任务用于提前降 z 轴
|
# # TODO 添加一个空任务用于提前降 z 轴
|
||||||
task_queue.put(sb.task("通信抢修", sb.up_tower, cfg_main['find_counts']['UpTower_counts'], cfg_main['task']['UpTower_enable']))
|
# task_queue.put(sb.task("通信抢修", sb.up_tower, cfg_main['find_counts']['UpTower_counts'], cfg_main['task']['UpTower_enable']))
|
||||||
task_queue.put(sb.task("高控排险", sb.get_rball, cfg_main['find_counts']['GetRBall_counts'], cfg_main['task']['GetRBall_enable']))
|
# task_queue.put(sb.task("高控排险", sb.get_rball, cfg_main['find_counts']['GetRBall_counts'], cfg_main['task']['GetRBall_enable']))
|
||||||
task_queue.put(sb.task("派发物资", sb.put_bball, cfg_main['find_counts']['PutBBall_counts'], cfg_main['task']['GetBBall_enable'] and cfg_main['task']['PutBBall_enable']))
|
# task_queue.put(sb.task("派发物资", sb.put_bball, cfg_main['find_counts']['PutBBall_counts'], cfg_main['task']['GetBBall_enable'] and cfg_main['task']['PutBBall_enable']))
|
||||||
task_queue.put(sb.task("物资盘点一阶段", sb.put_hanoi1, cfg_main['find_counts']['PutHanoi1_counts'], enable = True)) # 无论是否进行任务,检测标识并转向都是必须进行的
|
# task_queue.put(sb.task("物资盘点一阶段", sb.put_hanoi1, cfg_main['find_counts']['PutHanoi1_counts'], enable = True)) # 无论是否进行任务,检测标识并转向都是必须进行的
|
||||||
task_queue.put(sb.task("物资盘点二阶段", sb.put_hanoi2, cfg_main['find_counts']['PutHanoi2_counts'], cfg_main['task']['PutHanoi_enable']))
|
# task_queue.put(sb.task("物资盘点二阶段", sb.put_hanoi2, cfg_main['find_counts']['PutHanoi2_counts'], cfg_main['task']['PutHanoi_enable']))
|
||||||
task_queue.put(sb.task("物资盘点三阶段", sb.put_hanoi3, cfg_main['find_counts']['PutHanoi3_counts'], enable = True))
|
# task_queue.put(sb.task("物资盘点三阶段", sb.put_hanoi3, cfg_main['find_counts']['PutHanoi3_counts'], enable = True))
|
||||||
task_queue.put(sb.task("应急避险一阶段", sb.move_area1, cfg_main['find_counts']['MoveArea1_counts'], cfg_main['task']['MoveArea_enable']))
|
# task_queue.put(sb.task("应急避险一阶段", sb.move_area1, cfg_main['find_counts']['MoveArea1_counts'], cfg_main['task']['MoveArea_enable']))
|
||||||
task_queue.put(sb.task("应急避险二阶段", sb.move_area2, cfg_main['find_counts']['MoveArea2_counts'], cfg_main['task']['MoveArea_enable']))
|
# task_queue.put(sb.task("应急避险二阶段", sb.move_area2, cfg_main['find_counts']['MoveArea2_counts'], cfg_main['task']['MoveArea_enable']))
|
||||||
task_queue.put(sb.task("扫黑除暴", sb.kick_ass, cfg_main['find_counts']['KickAss_counts'], cfg_main['task']['KickAss_enable']))
|
# task_queue.put(sb.task("扫黑除暴", sb.kick_ass, cfg_main['find_counts']['KickAss_counts'], cfg_main['task']['KickAss_enable']))
|
||||||
# 将任务队列传入调度模块中
|
# 将任务队列传入调度模块中
|
||||||
task_queuem_t = sb.task_queuem(task_queue)
|
task_queuem_t = sb.task_queuem(task_queue)
|
||||||
|
|
||||||
|
|||||||
@@ -40,6 +40,7 @@ def main_func(_queue, _skip_queue):
|
|||||||
|
|
||||||
# 配置日志输出
|
# 配置日志输出
|
||||||
logger.add(cfg_main['debug']['logger_filename'], format=cfg_main['debug']['logger_format'], retention = 5, level="INFO")
|
logger.add(cfg_main['debug']['logger_filename'], format=cfg_main['debug']['logger_format'], retention = 5, level="INFO")
|
||||||
|
logger.info(cfg_args)
|
||||||
|
|
||||||
act.axis.camera(0)
|
act.axis.camera(0)
|
||||||
act.axis.x2(140)
|
act.axis.x2(140)
|
||||||
@@ -59,7 +60,7 @@ def main_func(_queue, _skip_queue):
|
|||||||
task_queue.put(sb.task("整装上阵", sb.get_bball, cfg_main['find_counts']['GetBBall_counts'], cfg_args['task']['GetBBall_enable']))
|
task_queue.put(sb.task("整装上阵", sb.get_bball, cfg_main['find_counts']['GetBBall_counts'], cfg_args['task']['GetBBall_enable']))
|
||||||
# # TODO 添加一个空任务用于提前降 z 轴
|
# # TODO 添加一个空任务用于提前降 z 轴
|
||||||
task_queue.put(sb.task("通信抢修", sb.up_tower, cfg_main['find_counts']['UpTower_counts'], cfg_args['task']['UpTower_enable']))
|
task_queue.put(sb.task("通信抢修", sb.up_tower, cfg_main['find_counts']['UpTower_counts'], cfg_args['task']['UpTower_enable']))
|
||||||
task_queue.put(sb.task("高控排险", sb.get_rball, cfg_main['find_counts']['GetRBall_counts'], cfg_args['task']['GetRBall_enable']))
|
task_queue.put(sb.task("高空排险", sb.get_rball, cfg_main['find_counts']['GetRBall_counts'], cfg_args['task']['GetRBall_enable']))
|
||||||
task_queue.put(sb.task("派发物资", sb.put_bball, cfg_main['find_counts']['PutBBall_counts'], cfg_args['task']['GetBBall_enable'] and cfg_args['task']['PutBBall_enable']))
|
task_queue.put(sb.task("派发物资", sb.put_bball, cfg_main['find_counts']['PutBBall_counts'], cfg_args['task']['GetBBall_enable'] and cfg_args['task']['PutBBall_enable']))
|
||||||
task_queue.put(sb.task("物资盘点一阶段", sb.put_hanoi1, cfg_main['find_counts']['PutHanoi1_counts'], enable = True)) # 无论是否进行任务,检测标识并转向都是必须进行的
|
task_queue.put(sb.task("物资盘点一阶段", sb.put_hanoi1, cfg_main['find_counts']['PutHanoi1_counts'], enable = True)) # 无论是否进行任务,检测标识并转向都是必须进行的
|
||||||
task_queue.put(sb.task("物资盘点二阶段", sb.put_hanoi2, cfg_main['find_counts']['PutHanoi2_counts'], cfg_args['task']['PutHanoi_enable']))
|
task_queue.put(sb.task("物资盘点二阶段", sb.put_hanoi2, cfg_main['find_counts']['PutHanoi2_counts'], cfg_args['task']['PutHanoi_enable']))
|
||||||
|
|||||||
@@ -67,6 +67,7 @@ class main_task():
|
|||||||
error_abs = abs(self.lane_error)
|
error_abs = abs(self.lane_error)
|
||||||
|
|
||||||
if error_abs > 50:
|
if error_abs > 50:
|
||||||
|
# speed = 11
|
||||||
speed = 13
|
speed = 13
|
||||||
elif error_abs > 45:
|
elif error_abs > 45:
|
||||||
speed = 15
|
speed = 15
|
||||||
|
|||||||
43
subtask.py
43
subtask.py
@@ -546,7 +546,7 @@ class put_block():
|
|||||||
ret, box = filter.get(tlabel.HOSPITAL)
|
ret, box = filter.get(tlabel.HOSPITAL)
|
||||||
if ret > 0:
|
if ret > 0:
|
||||||
width = box[0][2] - box[0][0]
|
width = box[0][2] - box[0][0]
|
||||||
if width > 130:
|
if width > 135:
|
||||||
return True
|
return True
|
||||||
return False
|
return False
|
||||||
def exec(self):
|
def exec(self):
|
||||||
@@ -557,7 +557,7 @@ class put_block():
|
|||||||
by_cmd.send_distance_x(10, 100)
|
by_cmd.send_distance_x(10, 100)
|
||||||
by_cmd.send_position_axis_z(30, 0)
|
by_cmd.send_position_axis_z(30, 0)
|
||||||
time.sleep(0.5)
|
time.sleep(0.5)
|
||||||
by_cmd.send_position_axis_x(1, 20)
|
by_cmd.send_position_axis_x(1, 50) # 20
|
||||||
time.sleep(1)
|
time.sleep(1)
|
||||||
by_cmd.send_angle_claw(63)
|
by_cmd.send_angle_claw(63)
|
||||||
time.sleep(1)
|
time.sleep(1)
|
||||||
@@ -582,7 +582,7 @@ class put_block():
|
|||||||
time.sleep(1)
|
time.sleep(1)
|
||||||
by_cmd.send_position_axis_z(30, 0)
|
by_cmd.send_position_axis_z(30, 0)
|
||||||
time.sleep(0.5)
|
time.sleep(0.5)
|
||||||
by_cmd.send_position_axis_x(1, 20)
|
by_cmd.send_position_axis_x(1, 50)
|
||||||
time.sleep(1.5)
|
time.sleep(1.5)
|
||||||
by_cmd.send_angle_claw(45)
|
by_cmd.send_angle_claw(45)
|
||||||
time.sleep(1)
|
time.sleep(1)
|
||||||
@@ -702,12 +702,12 @@ class up_tower():
|
|||||||
by_cmd.send_distance_x(-10, 120)
|
by_cmd.send_distance_x(-10, 120)
|
||||||
time.sleep(1)
|
time.sleep(1)
|
||||||
# 上古參數
|
# 上古參數
|
||||||
# by_cmd.send_distance_y(-10, 50)
|
by_cmd.send_distance_y(-10, 80)
|
||||||
# 6_9 模型參數
|
# 6_9 模型參數
|
||||||
by_cmd.send_distance_y(-10, 40)
|
# by_cmd.send_distance_y(-10, 40)
|
||||||
# 7_12_3 模型參數
|
# 7_12_3 模型參數
|
||||||
# by_cmd.send_distance_y(-10, 50)
|
# by_cmd.send_distance_y(-10, 50)
|
||||||
# time.sleep(1)
|
time.sleep(2)
|
||||||
car_stop()
|
car_stop()
|
||||||
# FIXME 如果下發 distance 後直接 car_stop,則 distance 執行時間僅由指令間處理延時決定
|
# FIXME 如果下發 distance 後直接 car_stop,則 distance 執行時間僅由指令間處理延時決定
|
||||||
# time.sleep(3)
|
# time.sleep(3)
|
||||||
@@ -758,21 +758,23 @@ class get_rball():
|
|||||||
# 靠近塔
|
# 靠近塔
|
||||||
by_cmd.send_angle_scoop(20)
|
by_cmd.send_angle_scoop(20)
|
||||||
# 上古參數
|
# 上古參數
|
||||||
# by_cmd.send_distance_y(-15, 45) # 50
|
by_cmd.send_distance_y(-15, 70) # 50
|
||||||
# 6_9 參數
|
# 6_9 參數
|
||||||
by_cmd.send_distance_y(-15, 35)
|
# by_cmd.send_distance_y(-15, 35)
|
||||||
time.sleep(2)
|
# time.sleep(2)
|
||||||
# 7_12_3 參數
|
# 7_12_3 參數
|
||||||
# by_cmd.send_distance_y(-15, 45)
|
# by_cmd.send_distance_y(-15, 45)
|
||||||
# time.sleep(2)
|
time.sleep(2)
|
||||||
car_stop()
|
car_stop()
|
||||||
calibrate_new(tlabel.RBALL,offset = 44, run = True)
|
calibrate_new(tlabel.RBALL,offset = 44, run = True)
|
||||||
time.sleep(1)
|
time.sleep(1)
|
||||||
logger.info("抓红球")
|
logger.info("抓红球")
|
||||||
# by_cmd.send_angle_scoop(15)
|
# by_cmd.send_angle_scoop(12)
|
||||||
time.sleep(0.5)
|
time.sleep(0.5)
|
||||||
by_cmd.send_position_axis_z(30, 170)
|
by_cmd.send_position_axis_z(30, 170)
|
||||||
time.sleep(2.5)
|
time.sleep(2.5)
|
||||||
|
by_cmd.send_angle_scoop(12)
|
||||||
|
time.sleep(0.5)
|
||||||
by_cmd.send_angle_scoop(7)
|
by_cmd.send_angle_scoop(7)
|
||||||
time.sleep(0.5)
|
time.sleep(0.5)
|
||||||
by_cmd.send_speed_y(15)
|
by_cmd.send_speed_y(15)
|
||||||
@@ -811,7 +813,7 @@ class put_bball():
|
|||||||
calibrate_new(tlabel.BASKET,offset = -40, run = True, run_speed = 6)
|
calibrate_new(tlabel.BASKET,offset = -40, run = True, run_speed = 6)
|
||||||
# by_cmd.send_distance_x(10, 10)
|
# by_cmd.send_distance_x(10, 10)
|
||||||
# 向左运动
|
# 向左运动
|
||||||
# by_cmd.send_distance_y(-10, 35)
|
by_cmd.send_distance_y(-10, 35)
|
||||||
# by_cmd.send_angle_storage(10)
|
# by_cmd.send_angle_storage(10)
|
||||||
# time.sleep(1)
|
# time.sleep(1)
|
||||||
|
|
||||||
@@ -944,7 +946,7 @@ class put_hanoi1():
|
|||||||
def after(self):
|
def after(self):
|
||||||
# var.switch_lane_model = True
|
# var.switch_lane_model = True
|
||||||
if utils.direction == tlabel.RMARK:
|
if utils.direction == tlabel.RMARK:
|
||||||
var.pid_turning.set(cfg["put_hanoi1"]["pid_kp"] - 0.3, cfg["put_hanoi1"]["pid_ki"], cfg["put_hanoi1"]["pid_kd"])
|
var.pid_turning.set(cfg["put_hanoi1"]["pid_kp"] - 0.2, cfg["put_hanoi1"]["pid_ki"], cfg["put_hanoi1"]["pid_kd"])
|
||||||
else:
|
else:
|
||||||
var.pid_turning.set(cfg["put_hanoi1"]["pid_kp"], cfg["put_hanoi1"]["pid_ki"], cfg["put_hanoi1"]["pid_kd"])
|
var.pid_turning.set(cfg["put_hanoi1"]["pid_kp"], cfg["put_hanoi1"]["pid_ki"], cfg["put_hanoi1"]["pid_kd"])
|
||||||
pass
|
pass
|
||||||
@@ -1184,7 +1186,7 @@ class put_hanoi2():
|
|||||||
# while True:
|
# while True:
|
||||||
# pass
|
# pass
|
||||||
by_cmd.send_speed_x(12)
|
by_cmd.send_speed_x(12)
|
||||||
time.sleep(1.5)
|
time.sleep(1.2)
|
||||||
def nexec(self):
|
def nexec(self):
|
||||||
pass
|
pass
|
||||||
def after(self):
|
def after(self):
|
||||||
@@ -1194,6 +1196,7 @@ class put_hanoi2():
|
|||||||
else:
|
else:
|
||||||
var.pid_turning.set(cfg["put_hanoi2"]["pid_kp"], cfg["put_hanoi2"]["pid_ki"], cfg["put_hanoi2"]["pid_kd"])
|
var.pid_turning.set(cfg["put_hanoi2"]["pid_kp"], cfg["put_hanoi2"]["pid_ki"], cfg["put_hanoi2"]["pid_kd"])
|
||||||
# time.sleep(2)
|
# time.sleep(2)
|
||||||
|
var.task_speed = 13
|
||||||
pass
|
pass
|
||||||
|
|
||||||
class put_hanoi3():
|
class put_hanoi3():
|
||||||
@@ -1439,7 +1442,7 @@ class kick_ass():
|
|||||||
logger.info("扫黑除暴初始化")
|
logger.info("扫黑除暴初始化")
|
||||||
self.pos_gap1 = cfg['kick_ass']['pos_gap1']
|
self.pos_gap1 = cfg['kick_ass']['pos_gap1']
|
||||||
self.pos_gap2 = cfg['kick_ass']['pos_gap2']
|
self.pos_gap2 = cfg['kick_ass']['pos_gap2']
|
||||||
self.target_person = cfg_args['kick_ass']['target_person']
|
self.target_person = cfg_args['lane_mode']['mode_index']
|
||||||
|
|
||||||
# by_cmd.send_angle_claw(15)
|
# by_cmd.send_angle_claw(15)
|
||||||
by_cmd.send_position_axis_x(1, 160)
|
by_cmd.send_position_axis_x(1, 160)
|
||||||
@@ -1477,6 +1480,16 @@ class kick_ass():
|
|||||||
by_cmd.send_position_axis_x(1, 120)
|
by_cmd.send_position_axis_x(1, 120)
|
||||||
time.sleep(1)
|
time.sleep(1)
|
||||||
logger.debug("結束任務,前進四")
|
logger.debug("結束任務,前進四")
|
||||||
|
|
||||||
|
filter.switch_camera(2)
|
||||||
|
for _ in range(3):
|
||||||
|
by_cmd.send_speed_x(15)
|
||||||
|
while True:
|
||||||
|
ret, box = filter.get(tlabel.BASE)
|
||||||
|
if ret:
|
||||||
|
error = (box[0][2] + box[0][0] - 320) / 2
|
||||||
|
by_cmd.send_speed_omega(-error * 0.8)
|
||||||
|
time.sleep(0.02)
|
||||||
# by_cmd.send_speed_x(25)
|
# by_cmd.send_speed_x(25)
|
||||||
# time.sleep(4)
|
# time.sleep(4)
|
||||||
pass
|
pass
|
||||||
|
|||||||
268
subtask_69.py
268
subtask_69.py
@@ -118,7 +118,7 @@ def calibrate_right_new(label, offset, run = True, run_speed = 3.5):
|
|||||||
logger.info(f"calibrate_right_new:停车后的误差是{error}")
|
logger.info(f"calibrate_right_new:停车后的误差是{error}")
|
||||||
if abs(error) > 8:
|
if abs(error) > 8:
|
||||||
logger.info(f"calibrate_right_new:停车后的误差大于 8 使用 distance 校准")
|
logger.info(f"calibrate_right_new:停车后的误差大于 8 使用 distance 校准")
|
||||||
error = error * 3
|
error = error * 1.5
|
||||||
if error > 0:
|
if error > 0:
|
||||||
by_cmd.send_distance_x(-10, int(error))
|
by_cmd.send_distance_x(-10, int(error))
|
||||||
else:
|
else:
|
||||||
@@ -241,6 +241,49 @@ def explore_calibrate_new(label, offset, run_direc ,run_speed = 3.5):
|
|||||||
break
|
break
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
# 对准应知道是左还是右,右侧需在过滤器中进行翻转
|
||||||
|
# flipv 为垂直翻转标志,转右侧开启
|
||||||
|
def hanoi_calibrate(target_label, error_label, offset, run_direc ,run_speed = 3.5):
|
||||||
|
stop_error = 0
|
||||||
|
error_record = CountRecord(10)
|
||||||
|
if run_direc == 1:
|
||||||
|
by_cmd.send_speed_x(run_speed)
|
||||||
|
else:
|
||||||
|
by_cmd.send_speed_x(-run_speed)
|
||||||
|
|
||||||
|
if target_label == tlabel.TPLATFORM:
|
||||||
|
stop_error = 8
|
||||||
|
else:
|
||||||
|
stop_error = 15
|
||||||
|
while True:
|
||||||
|
ret1, ret2, box = filter.get_two_hanoi(target_label, error_label, utils.direction == tlabel.RMARK)
|
||||||
|
while not ret1:
|
||||||
|
# 如果找不到目标且跳过任务队列非空 (即指令跳过)
|
||||||
|
if not global_skip_queue.empty():
|
||||||
|
_ = global_skip_queue.get()
|
||||||
|
logger.error("跳过 hanoi_calibrate")
|
||||||
|
return False
|
||||||
|
# 如果找不到目标且发现错误目标 (上次放置任务失败)
|
||||||
|
if ret2:
|
||||||
|
# 如果连续计数超过阈值,则直接返回
|
||||||
|
if error_record(ret2):
|
||||||
|
return False
|
||||||
|
ret1, ret2, box = filter.get_two_hanoi(target_label, error_label, utils.direction == tlabel.RMARK)
|
||||||
|
|
||||||
|
error = (box[0][2] + box[0][0] - 320) / 2 + offset
|
||||||
|
if ret1:
|
||||||
|
# 校准速度越大 停车的条件越宽泛 20 15
|
||||||
|
if abs(error) <= stop_error:
|
||||||
|
car_stop()
|
||||||
|
logger.info("explore_calibrate_new:行进时 误差小于 15 直接停车")
|
||||||
|
|
||||||
|
ret, box = filter.get(target_label)
|
||||||
|
while not ret:
|
||||||
|
ret, box = filter.get(target_label)
|
||||||
|
error = (box[0][2] + box[0][0] - 320) / 2 + offset
|
||||||
|
logger.info(f"停车后像素误差:{error}")
|
||||||
|
break
|
||||||
|
return True
|
||||||
# 任务类
|
# 任务类
|
||||||
class task:
|
class task:
|
||||||
def __init__(self, name, task_template, find_counts=10, enable=True):
|
def __init__(self, name, task_template, find_counts=10, enable=True):
|
||||||
@@ -372,8 +415,8 @@ class task_queuem(task):
|
|||||||
class get_block1():
|
class get_block1():
|
||||||
def init(self):
|
def init(self):
|
||||||
var.task_speed = 15
|
var.task_speed = 15
|
||||||
act.cmd.camera(0)
|
while (by_cmd.send_angle_camera(0) == -1):
|
||||||
act.cmd.z2(20, 60, 0)
|
pass
|
||||||
filter.switch_camera(1)
|
filter.switch_camera(1)
|
||||||
# if cfg['get_block']['first_block'] == "blue":
|
# if cfg['get_block']['first_block'] == "blue":
|
||||||
# self.target_label = tlabel.BBLOCK
|
# self.target_label = tlabel.BBLOCK
|
||||||
@@ -396,8 +439,7 @@ class get_block1():
|
|||||||
if any(ret):
|
if any(ret):
|
||||||
return True
|
return True
|
||||||
return False
|
return False
|
||||||
|
|
||||||
|
|
||||||
def exec(self):
|
def exec(self):
|
||||||
car_stop()
|
car_stop()
|
||||||
if self.target_counts[0] > self.target_counts[1]:
|
if self.target_counts[0] > self.target_counts[1]:
|
||||||
@@ -406,7 +448,7 @@ class get_block1():
|
|||||||
else:
|
else:
|
||||||
var.first_block = tlabel.BBLOCK
|
var.first_block = tlabel.BBLOCK
|
||||||
var.second_block = tlabel.RBLOCK
|
var.second_block = tlabel.RBLOCK
|
||||||
calibrate_new(var.first_block, offset = 15, run = True, run_speed = 5)
|
calibrate_new(var.first_block, offset = 16, run = True, run_speed = 5)
|
||||||
logger.info("抓取块")
|
logger.info("抓取块")
|
||||||
|
|
||||||
by_cmd.send_position_axis_z(30, 60)
|
by_cmd.send_position_axis_z(30, 60)
|
||||||
@@ -421,20 +463,21 @@ class get_block1():
|
|||||||
|
|
||||||
by_cmd.send_angle_claw_arm(175)
|
by_cmd.send_angle_claw_arm(175)
|
||||||
time.sleep(0.1)
|
time.sleep(0.1)
|
||||||
by_cmd.send_position_axis_x(1, 120)
|
by_cmd.send_position_axis_x(1, 100)
|
||||||
time.sleep(1)
|
time.sleep(1)
|
||||||
by_cmd.send_position_axis_z(30, 70)
|
by_cmd.send_position_axis_z(30, 70)
|
||||||
time.sleep(0.1)
|
time.sleep(0.5)
|
||||||
by_cmd.send_angle_claw(63)
|
by_cmd.send_angle_claw(63)
|
||||||
time.sleep(0.5)
|
time.sleep(0.5)
|
||||||
|
|
||||||
by_cmd.send_position_axis_z(30, 130)
|
by_cmd.send_position_axis_z(30, 130)
|
||||||
time.sleep(1)
|
time.sleep(1)
|
||||||
by_cmd.send_position_axis_x(1, 140)
|
by_cmd.send_position_axis_x(1, 140)
|
||||||
by_cmd.send_angle_claw_arm(220)
|
by_cmd.send_angle_claw_arm(225)
|
||||||
time.sleep(0.5)
|
time.sleep(0.5)
|
||||||
by_cmd.send_angle_storage(55)
|
# by_cmd.send_angle_storage(55)
|
||||||
time.sleep(1)
|
# time.sleep(1)
|
||||||
|
by_cmd.send_position_axis_z(30, 60)
|
||||||
|
|
||||||
pass
|
pass
|
||||||
def nexec(self):
|
def nexec(self):
|
||||||
@@ -463,13 +506,12 @@ class get_block2():
|
|||||||
return False
|
return False
|
||||||
def exec(self):
|
def exec(self):
|
||||||
car_stop()
|
car_stop()
|
||||||
calibrate_new(var.second_block, offset = 15, run = True, run_speed = 5)
|
calibrate_new(var.second_block, offset = 16, run = True, run_speed = 5)
|
||||||
logger.info("抓取块")
|
logger.info("抓取块")
|
||||||
time.sleep(0.5)
|
time.sleep(0.5)
|
||||||
by_cmd.send_angle_claw_arm(220)
|
by_cmd.send_angle_claw_arm(225)
|
||||||
by_cmd.send_angle_claw(63)
|
by_cmd.send_angle_claw(63)
|
||||||
by_cmd.send_position_axis_z(30, 60)
|
time.sleep(0.1)
|
||||||
time.sleep(1)
|
|
||||||
by_cmd.send_position_axis_x(1, 20)
|
by_cmd.send_position_axis_x(1, 20)
|
||||||
time.sleep(1)
|
time.sleep(1)
|
||||||
by_cmd.send_angle_claw(25)
|
by_cmd.send_angle_claw(25)
|
||||||
@@ -521,7 +563,7 @@ class put_block():
|
|||||||
|
|
||||||
# 放置第二個塊
|
# 放置第二個塊
|
||||||
by_cmd.send_angle_storage(20)
|
by_cmd.send_angle_storage(20)
|
||||||
by_cmd.send_position_axis_x(1, 130)
|
by_cmd.send_position_axis_x(1, 110)
|
||||||
by_cmd.send_position_axis_z(30, 120)
|
by_cmd.send_position_axis_z(30, 120)
|
||||||
time.sleep(1.5)
|
time.sleep(1.5)
|
||||||
by_cmd.send_angle_claw_arm(180)
|
by_cmd.send_angle_claw_arm(180)
|
||||||
@@ -535,7 +577,7 @@ class put_block():
|
|||||||
time.sleep(1)
|
time.sleep(1)
|
||||||
by_cmd.send_position_axis_z(30, 110)
|
by_cmd.send_position_axis_z(30, 110)
|
||||||
time.sleep(1)
|
time.sleep(1)
|
||||||
by_cmd.send_angle_claw_arm(220)
|
by_cmd.send_angle_claw_arm(225)
|
||||||
time.sleep(1)
|
time.sleep(1)
|
||||||
by_cmd.send_position_axis_z(30, 0)
|
by_cmd.send_position_axis_z(30, 0)
|
||||||
time.sleep(0.5)
|
time.sleep(0.5)
|
||||||
@@ -554,7 +596,7 @@ class put_block():
|
|||||||
time.sleep(1)
|
time.sleep(1)
|
||||||
while by_cmd.send_position_axis_x(1, 0) == -1:
|
while by_cmd.send_position_axis_x(1, 0) == -1:
|
||||||
pass
|
pass
|
||||||
while by_cmd.send_angle_claw_arm(36) == -1:
|
while by_cmd.send_angle_claw_arm(45) == -1:
|
||||||
pass
|
pass
|
||||||
# 任务检查间隔
|
# 任务检查间隔
|
||||||
# time.sleep(2)
|
# time.sleep(2)
|
||||||
@@ -569,7 +611,7 @@ class get_bball():
|
|||||||
# time.sleep(0.5)
|
# time.sleep(0.5)
|
||||||
# by_cmd.send_position_axis_x(1, 0)
|
# by_cmd.send_position_axis_x(1, 0)
|
||||||
# time.sleep(2)
|
# time.sleep(2)
|
||||||
# by_cmd.send_angle_claw_arm(36)
|
# by_cmd.send_angle_claw_arm(45)
|
||||||
|
|
||||||
while (by_cmd.send_angle_storage(0) == -1):
|
while (by_cmd.send_angle_storage(0) == -1):
|
||||||
by_cmd.send_angle_storage(0)
|
by_cmd.send_angle_storage(0)
|
||||||
@@ -582,13 +624,14 @@ class get_bball():
|
|||||||
self.record = CountRecord(5)
|
self.record = CountRecord(5)
|
||||||
def find(self):
|
def find(self):
|
||||||
# 目标检测蓝球
|
# 目标检测蓝球
|
||||||
ret = filter.find(tlabel.BBALL)
|
# ret = filter.find(tlabel.BBALL)
|
||||||
|
ret = filter.find_mult([tlabel.BBALL, tlabel.YBALL])
|
||||||
# ret = filter.find(tlabel.BBALL) or filter.find(tlabel.YBALL)
|
# ret = filter.find(tlabel.BBALL) or filter.find(tlabel.YBALL)
|
||||||
# TODO 此处使用连续检出判断感觉不是很好,黄球放置远时停车较晚,可能跟请求速度相关
|
# TODO 此处使用连续检出判断感觉不是很好,黄球放置远时停车较晚,可能跟请求速度相关
|
||||||
# if ret:
|
# if ret:
|
||||||
# if self.record(tlabel.BBALL):
|
# if self.record(tlabel.BBALL):
|
||||||
# return True
|
# return True
|
||||||
if ret:
|
if ret[0] or ret[1]:
|
||||||
return True
|
return True
|
||||||
return False
|
return False
|
||||||
def exec(self):
|
def exec(self):
|
||||||
@@ -596,10 +639,10 @@ class get_bball():
|
|||||||
car_stop()
|
car_stop()
|
||||||
time.sleep(0.5)
|
time.sleep(0.5)
|
||||||
for _ in range(3):
|
for _ in range(3):
|
||||||
calibrate_right_new(tlabel.BBALL, offset = 16, run = True, run_speed = 5)
|
calibrate_right_new(tlabel.BBALL, offset = 18, run = True, run_speed = 5)
|
||||||
logger.info("抓蓝色球")
|
logger.info("抓蓝色球")
|
||||||
time.sleep(0.5)
|
time.sleep(0.5)
|
||||||
by_cmd.send_angle_claw_arm(36)
|
by_cmd.send_angle_claw_arm(45)
|
||||||
by_cmd.send_angle_claw(54)
|
by_cmd.send_angle_claw(54)
|
||||||
by_cmd.send_position_axis_x(1, 160)
|
by_cmd.send_position_axis_x(1, 160)
|
||||||
time.sleep(1.2)
|
time.sleep(1.2)
|
||||||
@@ -615,7 +658,7 @@ class get_bball():
|
|||||||
time.sleep(0.5)
|
time.sleep(0.5)
|
||||||
by_cmd.send_angle_claw(54)
|
by_cmd.send_angle_claw(54)
|
||||||
time.sleep(0.5)
|
time.sleep(0.5)
|
||||||
by_cmd.send_angle_claw_arm(36)
|
by_cmd.send_angle_claw_arm(45)
|
||||||
time.sleep(1)
|
time.sleep(1)
|
||||||
by_cmd.send_position_axis_z(30, 135)
|
by_cmd.send_position_axis_z(30, 135)
|
||||||
# 继续向前走
|
# 继续向前走
|
||||||
@@ -727,8 +770,8 @@ class get_rball():
|
|||||||
logger.info("抓红球")
|
logger.info("抓红球")
|
||||||
# by_cmd.send_angle_scoop(15)
|
# by_cmd.send_angle_scoop(15)
|
||||||
time.sleep(0.5)
|
time.sleep(0.5)
|
||||||
by_cmd.send_position_axis_z(30, 170)
|
by_cmd.send_position_axis_z(30, 190) #170
|
||||||
time.sleep(2.5)
|
time.sleep(3.5)
|
||||||
by_cmd.send_angle_scoop(7)
|
by_cmd.send_angle_scoop(7)
|
||||||
time.sleep(0.5)
|
time.sleep(0.5)
|
||||||
by_cmd.send_speed_y(15)
|
by_cmd.send_speed_y(15)
|
||||||
@@ -834,30 +877,40 @@ class put_hanoi1():
|
|||||||
logger.info("应该向左转")
|
logger.info("应该向左转")
|
||||||
|
|
||||||
|
|
||||||
# # 校准 omega
|
# 校准 omega
|
||||||
# if error > 0:
|
for _ in range(10):
|
||||||
# by_cmd.send_angle_omega(-20,abs(var.lane_error))
|
ret, box = filter.get(utils.direction)
|
||||||
# else:
|
if ret:
|
||||||
# by_cmd.send_angle_omega(20,abs(var.lane_error))
|
error = (box[0][2] + box[0][0] - 320) / 2
|
||||||
# time.sleep(0.5)
|
by_cmd.send_speed_omega(-error * 0.8)
|
||||||
# car_stop()
|
time.sleep(0.2)
|
||||||
# time.sleep(0.5)
|
|
||||||
# by_cmd.send_distance_x(10, 200)
|
|
||||||
|
|
||||||
# by_cmd.send_distance_x(10, 180)
|
|
||||||
by_cmd.send_distance_x(10, 250)
|
|
||||||
time.sleep(1)
|
|
||||||
car_stop()
|
car_stop()
|
||||||
|
|
||||||
|
|
||||||
|
# 前进
|
||||||
|
# by_cmd.send_distance_x(10, 200)
|
||||||
|
# by_cmd.send_distance_x(10, 180)
|
||||||
|
# by_cmd.send_distance_x(10, 180)
|
||||||
|
# time.sleep(1.5)
|
||||||
|
# car_stop()
|
||||||
|
|
||||||
|
while True:
|
||||||
|
by_cmd.send_speed_x(8.5)
|
||||||
|
ret, box = filter.get(utils.direction)
|
||||||
|
if ret:
|
||||||
|
if abs(box[0][2] - box[0][0]) > 41:
|
||||||
|
car_stop()
|
||||||
|
break
|
||||||
|
|
||||||
# 根据方向初始化执行器位置
|
# 根据方向初始化执行器位置
|
||||||
if utils.direction is tlabel.RMARK:
|
if utils.direction is tlabel.RMARK:
|
||||||
# FIXME 右侧的爪子会被 storage 挡住
|
# FIXME 右侧的爪子会被 storage 挡住
|
||||||
by_cmd.send_position_axis_x(1, 0)
|
by_cmd.send_position_axis_x(1, 0)
|
||||||
by_cmd.send_angle_claw_arm(36)
|
by_cmd.send_angle_claw_arm(45)
|
||||||
by_cmd.send_angle_storage(0)
|
by_cmd.send_angle_storage(0)
|
||||||
else:
|
else:
|
||||||
by_cmd.send_position_axis_x(1, 150)
|
by_cmd.send_position_axis_x(1, 150)
|
||||||
by_cmd.send_angle_claw_arm(220)
|
by_cmd.send_angle_claw_arm(225)
|
||||||
by_cmd.send_angle_storage(55)
|
by_cmd.send_angle_storage(55)
|
||||||
time.sleep(1)
|
time.sleep(1)
|
||||||
|
|
||||||
@@ -866,16 +919,20 @@ class put_hanoi1():
|
|||||||
if utils.direction_right > utils.direction_left:
|
if utils.direction_right > utils.direction_left:
|
||||||
utils.direction = tlabel.RMARK
|
utils.direction = tlabel.RMARK
|
||||||
# by_cmd.send_angle_omega(-25,430)
|
# by_cmd.send_angle_omega(-25,430)
|
||||||
by_cmd.send_angle_omega(-45,238)
|
|
||||||
# by_cmd.send_angle_omega(-55,194)
|
# by_cmd.send_angle_omega(-55,194)
|
||||||
|
# by_cmd.send_angle_omega(-45,238)
|
||||||
|
# by_cmd.send_angle_omega(-45,252)
|
||||||
|
by_cmd.send_angle_omega(-45,260)
|
||||||
time.sleep(2)
|
time.sleep(2)
|
||||||
while (by_cmd.send_angle_camera(90) == -1):
|
while (by_cmd.send_angle_camera(90) == -1):
|
||||||
by_cmd.send_angle_camera(90)
|
by_cmd.send_angle_camera(90)
|
||||||
else:
|
else:
|
||||||
utils.direction = tlabel.LMARK
|
utils.direction = tlabel.LMARK
|
||||||
# by_cmd.send_angle_omega(25,430)
|
# by_cmd.send_angle_omega(25,430)
|
||||||
by_cmd.send_angle_omega(45,238)
|
|
||||||
# by_cmd.send_angle_omega(55,194)
|
# by_cmd.send_angle_omega(55,194)
|
||||||
|
# by_cmd.send_angle_omega(45,238)
|
||||||
|
# by_cmd.send_angle_omega(45,252)
|
||||||
|
by_cmd.send_angle_omega(45,260)
|
||||||
time.sleep(2)
|
time.sleep(2)
|
||||||
while (by_cmd.send_angle_camera(0) == -1):
|
while (by_cmd.send_angle_camera(0) == -1):
|
||||||
by_cmd.send_angle_camera(0)
|
by_cmd.send_angle_camera(0)
|
||||||
@@ -884,11 +941,17 @@ class put_hanoi1():
|
|||||||
def nexec(self):
|
def nexec(self):
|
||||||
pass
|
pass
|
||||||
def after(self):
|
def after(self):
|
||||||
var.pid_turning.set(cfg["put_hanoi1"]["pid_kp"], cfg["put_hanoi1"]["pid_ki"], cfg["put_hanoi1"]["pid_kd"])
|
# var.switch_lane_model = True
|
||||||
|
if utils.direction == tlabel.RMARK:
|
||||||
|
var.pid_turning.set(cfg["put_hanoi1"]["pid_kp"] - 0.4, cfg["put_hanoi1"]["pid_ki"], cfg["put_hanoi1"]["pid_kd"])
|
||||||
|
else:
|
||||||
|
var.pid_turning.set(cfg["put_hanoi1"]["pid_kp"], cfg["put_hanoi1"]["pid_ki"], cfg["put_hanoi1"]["pid_kd"])
|
||||||
pass
|
pass
|
||||||
|
# time.sleep(1.5)
|
||||||
|
|
||||||
class put_hanoi2():
|
class put_hanoi2():
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
|
|
||||||
if cfg['put_hanoi2']['first_target'] == "lp":
|
if cfg['put_hanoi2']['first_target'] == "lp":
|
||||||
self.target_label = tlabel.LPILLER
|
self.target_label = tlabel.LPILLER
|
||||||
elif cfg['put_hanoi2']['first_target'] == "mp":
|
elif cfg['put_hanoi2']['first_target'] == "mp":
|
||||||
@@ -897,20 +960,25 @@ class put_hanoi2():
|
|||||||
self.target_label = tlabel.SPILLER
|
self.target_label = tlabel.SPILLER
|
||||||
def init(self):
|
def init(self):
|
||||||
logger.info("物资盘点 2 初始化")
|
logger.info("物资盘点 2 初始化")
|
||||||
|
var.task_speed = 8.5
|
||||||
if utils.direction == tlabel.RMARK:
|
if utils.direction == tlabel.RMARK:
|
||||||
# 15
|
# 15
|
||||||
self.offset = 19
|
self.offset = 14
|
||||||
# self.platform_offset = -25
|
# self.platform_offset = -25
|
||||||
self.platform_offset = -10
|
# self.platform_offset = -19
|
||||||
else:
|
|
||||||
self.offset = 10
|
|
||||||
#self.platform_offset = -30
|
|
||||||
self.platform_offset = -15
|
self.platform_offset = -15
|
||||||
|
else:
|
||||||
|
self.offset = 14
|
||||||
|
# self.platform_offset = -30
|
||||||
|
# self.platform_offset = -19
|
||||||
|
self.platform_offset = -15
|
||||||
|
# 延时,防止过早看到 tplatform(虽然此现象相当少见且诡异)
|
||||||
|
time.sleep(1.5)
|
||||||
|
|
||||||
def find(self):
|
def find(self):
|
||||||
# ret, box = filter.get(self.target_label)
|
# ret, box = filter.get(self.target_label)
|
||||||
ret, box = filter.get(tlabel.TPLATFORM)
|
ret, box = filter.get(tlabel.TPLATFORM)
|
||||||
if ret:
|
if ret:
|
||||||
var.task_speed = 8.5
|
|
||||||
error = (box[0][2] + box[0][0] - 320) / 2 + self.platform_offset
|
error = (box[0][2] + box[0][0] - 320) / 2 + self.platform_offset
|
||||||
if error > 0:
|
if error > 0:
|
||||||
return True
|
return True
|
||||||
@@ -935,12 +1003,12 @@ class put_hanoi2():
|
|||||||
logger.info("抓大平台")
|
logger.info("抓大平台")
|
||||||
if utils.direction is tlabel.RMARK:
|
if utils.direction is tlabel.RMARK:
|
||||||
by_cmd.send_position_axis_z(30, 10)
|
by_cmd.send_position_axis_z(30, 10)
|
||||||
by_cmd.send_position_axis_x(1, 130)
|
by_cmd.send_position_axis_x(1, 150)
|
||||||
by_cmd.send_angle_claw(63)
|
by_cmd.send_angle_claw(63)
|
||||||
time.sleep(2)
|
time.sleep(2)
|
||||||
by_cmd.send_angle_claw(40)
|
by_cmd.send_angle_claw(40)
|
||||||
time.sleep(0.5)
|
time.sleep(0.5)
|
||||||
by_cmd.send_distance_axis_z(30, 20)
|
by_cmd.send_distance_axis_z(30, 30)
|
||||||
time.sleep(0.5)
|
time.sleep(0.5)
|
||||||
by_cmd.send_position_axis_x(1, 10)
|
by_cmd.send_position_axis_x(1, 10)
|
||||||
time.sleep(1)
|
time.sleep(1)
|
||||||
@@ -952,7 +1020,7 @@ class put_hanoi2():
|
|||||||
time.sleep(2)
|
time.sleep(2)
|
||||||
by_cmd.send_angle_claw(40)
|
by_cmd.send_angle_claw(40)
|
||||||
time.sleep(0.5)
|
time.sleep(0.5)
|
||||||
by_cmd.send_distance_axis_z(30, 20)
|
by_cmd.send_distance_axis_z(30, 30)
|
||||||
time.sleep(0.5)
|
time.sleep(0.5)
|
||||||
by_cmd.send_position_axis_x(1, 160)
|
by_cmd.send_position_axis_x(1, 160)
|
||||||
time.sleep(1)
|
time.sleep(1)
|
||||||
@@ -964,15 +1032,15 @@ class put_hanoi2():
|
|||||||
time.sleep(0.5)
|
time.sleep(0.5)
|
||||||
logger.info("放大平台")
|
logger.info("放大平台")
|
||||||
if utils.direction is tlabel.RMARK:
|
if utils.direction is tlabel.RMARK:
|
||||||
by_cmd.send_position_axis_x(1, 130)
|
by_cmd.send_position_axis_x(1, 150)
|
||||||
time.sleep(1.5)
|
time.sleep(1.5)
|
||||||
by_cmd.send_distance_axis_z(30, -20)
|
by_cmd.send_distance_axis_z(30, -20)
|
||||||
time.sleep(1)
|
time.sleep(1)
|
||||||
by_cmd.send_angle_claw(81)
|
by_cmd.send_angle_claw(81)
|
||||||
time.sleep(0.5)
|
time.sleep(0.5)
|
||||||
by_cmd.send_angle_claw(63)
|
|
||||||
time.sleep(0.5)
|
|
||||||
by_cmd.send_position_axis_x(1, 10)
|
by_cmd.send_position_axis_x(1, 10)
|
||||||
|
time.sleep(0.5)
|
||||||
|
by_cmd.send_angle_claw(63)
|
||||||
time.sleep(1)
|
time.sleep(1)
|
||||||
pass
|
pass
|
||||||
else:
|
else:
|
||||||
@@ -982,9 +1050,9 @@ class put_hanoi2():
|
|||||||
time.sleep(1)
|
time.sleep(1)
|
||||||
by_cmd.send_angle_claw(81)
|
by_cmd.send_angle_claw(81)
|
||||||
time.sleep(0.5)
|
time.sleep(0.5)
|
||||||
by_cmd.send_angle_claw(63)
|
|
||||||
time.sleep(0.5)
|
|
||||||
by_cmd.send_position_axis_x(1, 160)
|
by_cmd.send_position_axis_x(1, 160)
|
||||||
|
time.sleep(0.5)
|
||||||
|
by_cmd.send_angle_claw(63)
|
||||||
time.sleep(1)
|
time.sleep(1)
|
||||||
|
|
||||||
ret = explore_calibrate_new(tlabel.MPILLER, offset = self.offset, run_direc = 1, run_speed = 5)
|
ret = explore_calibrate_new(tlabel.MPILLER, offset = self.offset, run_direc = 1, run_speed = 5)
|
||||||
@@ -995,8 +1063,8 @@ class put_hanoi2():
|
|||||||
logger.info("抓中平台")
|
logger.info("抓中平台")
|
||||||
if utils.direction is tlabel.RMARK:
|
if utils.direction is tlabel.RMARK:
|
||||||
by_cmd.send_position_axis_z(30, 10)
|
by_cmd.send_position_axis_z(30, 10)
|
||||||
by_cmd.send_position_axis_x(1, 130)
|
by_cmd.send_position_axis_x(1, 150)
|
||||||
by_cmd.send_angle_claw(63)
|
by_cmd.send_angle_claw(55)
|
||||||
time.sleep(2)
|
time.sleep(2)
|
||||||
by_cmd.send_angle_claw(35)
|
by_cmd.send_angle_claw(35)
|
||||||
time.sleep(0.5)
|
time.sleep(0.5)
|
||||||
@@ -1008,7 +1076,7 @@ class put_hanoi2():
|
|||||||
else:
|
else:
|
||||||
by_cmd.send_position_axis_z(30, 10)
|
by_cmd.send_position_axis_z(30, 10)
|
||||||
by_cmd.send_position_axis_x(1, 40)
|
by_cmd.send_position_axis_x(1, 40)
|
||||||
by_cmd.send_angle_claw(63)
|
by_cmd.send_angle_claw(55)
|
||||||
time.sleep(2)
|
time.sleep(2)
|
||||||
by_cmd.send_angle_claw(35)
|
by_cmd.send_angle_claw(35)
|
||||||
time.sleep(0.5)
|
time.sleep(0.5)
|
||||||
@@ -1017,32 +1085,33 @@ class put_hanoi2():
|
|||||||
by_cmd.send_position_axis_x(1, 160)
|
by_cmd.send_position_axis_x(1, 160)
|
||||||
time.sleep(1)
|
time.sleep(1)
|
||||||
pass
|
pass
|
||||||
ret = explore_calibrate_new(tlabel.LPILLER, offset = self.offset, run_direc = -1, run_speed = 5)
|
# ret = explore_calibrate_new(tlabel.LPILLER, offset = self.offset, run_direc = -1, run_speed = 5)
|
||||||
|
ret = hanoi_calibrate(tlabel.LPILLER, tlabel.TPLATFORM, offset = self.offset, run_direc = -1, run_speed = 5)
|
||||||
if not ret:
|
if not ret:
|
||||||
logger.error("跳过物资盘点 2 exec")
|
logger.error("在放中平台的时候出现问题 跳过物资盘点 2 exec")
|
||||||
return
|
return
|
||||||
time.sleep(0.5)
|
time.sleep(0.5)
|
||||||
logger.info("放中平台")
|
logger.info("放中平台")
|
||||||
if utils.direction is tlabel.RMARK:
|
if utils.direction is tlabel.RMARK:
|
||||||
by_cmd.send_position_axis_z(30, 100)
|
by_cmd.send_position_axis_z(30, 120)
|
||||||
time.sleep(2)
|
time.sleep(2)
|
||||||
by_cmd.send_position_axis_x(1, 130)
|
by_cmd.send_position_axis_x(1, 150)
|
||||||
time.sleep(2)
|
time.sleep(2)
|
||||||
by_cmd.send_distance_axis_z(30, -20)
|
by_cmd.send_distance_axis_z(30, -20)
|
||||||
time.sleep(0.5)
|
time.sleep(0.5)
|
||||||
by_cmd.send_angle_claw(65)
|
by_cmd.send_angle_claw(55)
|
||||||
time.sleep(0.5)
|
time.sleep(0.5)
|
||||||
by_cmd.send_position_axis_x(1, 10)
|
by_cmd.send_position_axis_x(1, 10)
|
||||||
time.sleep(1)
|
time.sleep(1)
|
||||||
pass
|
pass
|
||||||
else:
|
else:
|
||||||
by_cmd.send_position_axis_z(30, 100)
|
by_cmd.send_position_axis_z(30, 120)
|
||||||
time.sleep(2)
|
time.sleep(2)
|
||||||
by_cmd.send_position_axis_x(1, 40)
|
by_cmd.send_position_axis_x(1, 40)
|
||||||
time.sleep(2)
|
time.sleep(2)
|
||||||
by_cmd.send_distance_axis_z(30, -20)
|
by_cmd.send_distance_axis_z(30, -20)
|
||||||
time.sleep(0.5)
|
time.sleep(0.5)
|
||||||
by_cmd.send_angle_claw(65)
|
by_cmd.send_angle_claw(55)
|
||||||
time.sleep(0.5)
|
time.sleep(0.5)
|
||||||
by_cmd.send_position_axis_x(1, 160)
|
by_cmd.send_position_axis_x(1, 160)
|
||||||
time.sleep(1)
|
time.sleep(1)
|
||||||
@@ -1055,15 +1124,15 @@ class put_hanoi2():
|
|||||||
logger.info("抓小平台")
|
logger.info("抓小平台")
|
||||||
if utils.direction is tlabel.RMARK:
|
if utils.direction is tlabel.RMARK:
|
||||||
by_cmd.send_position_axis_z(30, 10)
|
by_cmd.send_position_axis_z(30, 10)
|
||||||
by_cmd.send_position_axis_x(1, 130)
|
by_cmd.send_position_axis_x(1, 150)
|
||||||
by_cmd.send_angle_claw(50)
|
by_cmd.send_angle_claw(50)
|
||||||
time.sleep(2)
|
time.sleep(2)
|
||||||
by_cmd.send_angle_claw(27)
|
by_cmd.send_angle_claw(27)
|
||||||
time.sleep(1)
|
time.sleep(1)
|
||||||
by_cmd.send_distance_axis_z(30, 10)
|
by_cmd.send_distance_axis_z(30, 10)
|
||||||
time.sleep(0.5)
|
time.sleep(0.5)
|
||||||
by_cmd.send_position_axis_x(1, 10)
|
by_cmd.send_position_axis_x(1, 0)
|
||||||
time.sleep(1)
|
time.sleep(2)
|
||||||
pass
|
pass
|
||||||
else:
|
else:
|
||||||
by_cmd.send_position_axis_z(30, 10)
|
by_cmd.send_position_axis_z(30, 10)
|
||||||
@@ -1074,19 +1143,20 @@ class put_hanoi2():
|
|||||||
time.sleep(1)
|
time.sleep(1)
|
||||||
by_cmd.send_distance_axis_z(30, 10)
|
by_cmd.send_distance_axis_z(30, 10)
|
||||||
time.sleep(0.5)
|
time.sleep(0.5)
|
||||||
by_cmd.send_position_axis_x(1, 160)
|
by_cmd.send_position_axis_x(1, 170)
|
||||||
time.sleep(1)
|
time.sleep(2)
|
||||||
pass
|
pass
|
||||||
ret = explore_calibrate_new(tlabel.MPILLER, offset = self.offset, run_direc = -1, run_speed = 5)
|
# ret = explore_calibrate_new(tlabel.MPILLER, offset = self.offset, run_direc = -1, run_speed = 5)
|
||||||
|
ret = hanoi_calibrate(tlabel.MPILLER, tlabel.LPILLER, offset = self.offset, run_direc = -1, run_speed = 5)
|
||||||
if not ret:
|
if not ret:
|
||||||
logger.error("跳过物资盘点 2 exec")
|
logger.error("在放小平台的时候出现问题 跳过物资盘点 2 exec")
|
||||||
return
|
return
|
||||||
time.sleep(0.5)
|
time.sleep(0.5)
|
||||||
logger.info("放小平台")
|
logger.info("放小平台")
|
||||||
if utils.direction is tlabel.RMARK:
|
if utils.direction is tlabel.RMARK:
|
||||||
by_cmd.send_position_axis_z(30, 170)
|
by_cmd.send_position_axis_z(30, 190) # 170
|
||||||
time.sleep(1.5)
|
time.sleep(1.5)
|
||||||
by_cmd.send_position_axis_x(1, 130)
|
by_cmd.send_position_axis_x(1, 150)
|
||||||
time.sleep(2)
|
time.sleep(2)
|
||||||
by_cmd.send_distance_axis_z(30, -20)
|
by_cmd.send_distance_axis_z(30, -20)
|
||||||
time.sleep(0.5)
|
time.sleep(0.5)
|
||||||
@@ -1094,12 +1164,13 @@ class put_hanoi2():
|
|||||||
time.sleep(0.5)
|
time.sleep(0.5)
|
||||||
by_cmd.send_position_axis_x(1, 10)
|
by_cmd.send_position_axis_x(1, 10)
|
||||||
time.sleep(1)
|
time.sleep(1)
|
||||||
by_cmd.send_speed_y(15)
|
|
||||||
time.sleep(0.1)
|
# by_cmd.send_speed_y(10)
|
||||||
car_stop()
|
# time.sleep(0.12)
|
||||||
|
# car_stop()
|
||||||
pass
|
pass
|
||||||
else:
|
else:
|
||||||
by_cmd.send_position_axis_z(30, 170)
|
by_cmd.send_position_axis_z(30, 190)
|
||||||
time.sleep(1.5)
|
time.sleep(1.5)
|
||||||
by_cmd.send_position_axis_x(1, 40)
|
by_cmd.send_position_axis_x(1, 40)
|
||||||
time.sleep(2)
|
time.sleep(2)
|
||||||
@@ -1111,11 +1182,18 @@ class put_hanoi2():
|
|||||||
time.sleep(1.5)
|
time.sleep(1.5)
|
||||||
# while True:
|
# while True:
|
||||||
# pass
|
# pass
|
||||||
|
by_cmd.send_speed_x(12)
|
||||||
|
time.sleep(1.5)
|
||||||
|
var.task_speed = 10
|
||||||
def nexec(self):
|
def nexec(self):
|
||||||
pass
|
pass
|
||||||
def after(self):
|
def after(self):
|
||||||
var.pid_turning.set(cfg["put_hanoi2"]["pid_kp"], cfg["put_hanoi2"]["pid_ki"], cfg["put_hanoi2"]["pid_kd"])
|
# var.switch_lane_model = False
|
||||||
|
if utils.direction is tlabel.RMARK:
|
||||||
|
var.pid_turning.set(cfg["put_hanoi2"]["pid_kp"], cfg["put_hanoi2"]["pid_ki"], cfg["put_hanoi2"]["pid_kd"])
|
||||||
|
else:
|
||||||
|
var.pid_turning.set(cfg["put_hanoi2"]["pid_kp"], cfg["put_hanoi2"]["pid_ki"], cfg["put_hanoi2"]["pid_kd"])
|
||||||
|
# time.sleep(2)
|
||||||
pass
|
pass
|
||||||
|
|
||||||
class put_hanoi3():
|
class put_hanoi3():
|
||||||
@@ -1130,10 +1208,10 @@ class put_hanoi3():
|
|||||||
while by_cmd.send_position_axis_x(1, 0) == -1:
|
while by_cmd.send_position_axis_x(1, 0) == -1:
|
||||||
pass
|
pass
|
||||||
time.sleep(1)
|
time.sleep(1)
|
||||||
# while by_cmd.send_angle_claw_arm(220) == -1:
|
# while by_cmd.send_angle_claw_arm(225) == -1:
|
||||||
# pass
|
|
||||||
# while by_cmd.send_angle_claw(90) == -1:
|
|
||||||
# pass
|
# pass
|
||||||
|
while by_cmd.send_angle_claw(85) == -1:
|
||||||
|
pass
|
||||||
def find(self):
|
def find(self):
|
||||||
time.sleep(1)
|
time.sleep(1)
|
||||||
return True
|
return True
|
||||||
@@ -1144,6 +1222,7 @@ class put_hanoi3():
|
|||||||
def nexec(self):
|
def nexec(self):
|
||||||
pass
|
pass
|
||||||
def after(self):
|
def after(self):
|
||||||
|
var.task_speed = 0
|
||||||
by_cmd.send_position_axis_x(1, 150)
|
by_cmd.send_position_axis_x(1, 150)
|
||||||
var.pid_turning.set(cfg["put_hanoi3"]["pid_kp"], cfg["put_hanoi3"]["pid_ki"], cfg["put_hanoi3"]["pid_kd"])
|
var.pid_turning.set(cfg["put_hanoi3"]["pid_kp"], cfg["put_hanoi3"]["pid_ki"], cfg["put_hanoi3"]["pid_kd"])
|
||||||
|
|
||||||
@@ -1209,7 +1288,7 @@ class move_area1():
|
|||||||
# 任务检查间隔
|
# 任务检查间隔
|
||||||
by_cmd.send_position_axis_x(1, 150)
|
by_cmd.send_position_axis_x(1, 150)
|
||||||
# time.sleep(1)
|
# time.sleep(1)
|
||||||
by_cmd.send_angle_claw_arm(220)
|
by_cmd.send_angle_claw_arm(225)
|
||||||
|
|
||||||
pass
|
pass
|
||||||
|
|
||||||
@@ -1361,7 +1440,7 @@ class kick_ass():
|
|||||||
logger.info("扫黑除暴初始化")
|
logger.info("扫黑除暴初始化")
|
||||||
self.pos_gap1 = cfg['kick_ass']['pos_gap1']
|
self.pos_gap1 = cfg['kick_ass']['pos_gap1']
|
||||||
self.pos_gap2 = cfg['kick_ass']['pos_gap2']
|
self.pos_gap2 = cfg['kick_ass']['pos_gap2']
|
||||||
self.target_person = cfg_args['kick_ass']['target_person']
|
self.target_person = cfg_args['lane_mode']['mode_index']
|
||||||
|
|
||||||
# by_cmd.send_angle_claw(15)
|
# by_cmd.send_angle_claw(15)
|
||||||
by_cmd.send_position_axis_x(1, 160)
|
by_cmd.send_position_axis_x(1, 160)
|
||||||
@@ -1387,17 +1466,28 @@ class kick_ass():
|
|||||||
else:
|
else:
|
||||||
target_distance = self.pos_gap1 + (self.target_person - 1) * self.pos_gap2 + (self.target_person - 1) * 10
|
target_distance = self.pos_gap1 + (self.target_person - 1) * self.pos_gap2 + (self.target_person - 1) * 10
|
||||||
by_cmd.send_distance_x(10, target_distance)
|
by_cmd.send_distance_x(10, target_distance)
|
||||||
|
|
||||||
logger.info(f"target distance {target_distance}")
|
logger.info(f"target distance {target_distance}")
|
||||||
time.sleep(1.5 + (self.target_person - 1) * 0.7 )
|
time.sleep(1.5 + (self.target_person - 1) * 0.7 )
|
||||||
car_stop()
|
car_stop()
|
||||||
|
|
||||||
# by_cmd.send_angle_claw_arm(220)
|
# by_cmd.send_angle_claw_arm(225)
|
||||||
# time.sleep(0.5)
|
# time.sleep(0.5)
|
||||||
by_cmd.send_position_axis_x(1, 20)
|
by_cmd.send_position_axis_x(1, 20)
|
||||||
time.sleep(3)
|
time.sleep(3)
|
||||||
by_cmd.send_position_axis_x(1, 120)
|
by_cmd.send_position_axis_x(1, 120)
|
||||||
time.sleep(1)
|
time.sleep(1)
|
||||||
logger.debug("結束任務,前進四")
|
logger.debug("結束任務,前進四")
|
||||||
|
|
||||||
|
filter.switch_camera(2)
|
||||||
|
for _ in range(3):
|
||||||
|
by_cmd.send_speed_x(15)
|
||||||
|
while True:
|
||||||
|
ret, box = filter.get(tlabel.BASE)
|
||||||
|
if ret:
|
||||||
|
error = (box[0][2] + box[0][0] - 320) / 2
|
||||||
|
by_cmd.send_speed_omega(-error * 0.8)
|
||||||
|
time.sleep(0.02)
|
||||||
# by_cmd.send_speed_x(25)
|
# by_cmd.send_speed_x(25)
|
||||||
# time.sleep(4)
|
# time.sleep(4)
|
||||||
pass
|
pass
|
||||||
|
|||||||
@@ -1367,7 +1367,7 @@ class kick_ass():
|
|||||||
logger.info("扫黑除暴初始化")
|
logger.info("扫黑除暴初始化")
|
||||||
self.pos_gap1 = cfg['kick_ass']['pos_gap1']
|
self.pos_gap1 = cfg['kick_ass']['pos_gap1']
|
||||||
self.pos_gap2 = cfg['kick_ass']['pos_gap2']
|
self.pos_gap2 = cfg['kick_ass']['pos_gap2']
|
||||||
self.target_person = cfg_args['kick_ass']['target_person']
|
self.target_person = cfg_args['lane_mode']['mode_index']
|
||||||
|
|
||||||
# by_cmd.send_angle_claw(15)
|
# by_cmd.send_angle_claw(15)
|
||||||
by_cmd.send_position_axis_x(1, 160)
|
by_cmd.send_position_axis_x(1, 160)
|
||||||
|
|||||||
@@ -1360,7 +1360,7 @@ class kick_ass():
|
|||||||
logger.info("扫黑除暴初始化")
|
logger.info("扫黑除暴初始化")
|
||||||
self.pos_gap1 = cfg['kick_ass']['pos_gap1']
|
self.pos_gap1 = cfg['kick_ass']['pos_gap1']
|
||||||
self.pos_gap2 = cfg['kick_ass']['pos_gap2']
|
self.pos_gap2 = cfg['kick_ass']['pos_gap2']
|
||||||
self.target_person = cfg_args['kick_ass']['target_person']
|
self.target_person = cfg_args['lane_mode']['mode_index']
|
||||||
|
|
||||||
# by_cmd.send_angle_claw(15)
|
# by_cmd.send_angle_claw(15)
|
||||||
by_cmd.send_position_axis_x(1, 160)
|
by_cmd.send_position_axis_x(1, 160)
|
||||||
|
|||||||
1487
subtask_7154.py
Normal file
1487
subtask_7154.py
Normal file
File diff suppressed because it is too large
Load Diff
1497
subtask_raw.py
Normal file
1497
subtask_raw.py
Normal file
File diff suppressed because it is too large
Load Diff
@@ -109,7 +109,7 @@
|
|||||||
</el-col>
|
</el-col>
|
||||||
<el-col :xs="24" :sm="8">
|
<el-col :xs="24" :sm="8">
|
||||||
<el-button @click="skipTask" type="success" style="width: 100%">
|
<el-button @click="skipTask" type="success" style="width: 100%">
|
||||||
强制跳转
|
关闭
|
||||||
</el-button>
|
</el-button>
|
||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
@@ -128,12 +128,16 @@
|
|||||||
</el-button> -->
|
</el-button> -->
|
||||||
|
|
||||||
<el-form v-if="showConfigForm && config" class="config-form">
|
<el-form v-if="showConfigForm && config" class="config-form">
|
||||||
|
<el-button @click="saveConfig" type="primary" style="margin-top: 20px;">保存配置</el-button>
|
||||||
|
<el-button v-if="showConfigForm" @click="toggleConfigForm" type="primary" style="margin-bottom: 20px;">
|
||||||
|
{{ showConfigForm ? '关闭' : '打开' }} 配置
|
||||||
|
</el-button>
|
||||||
<div v-for="(section, sectionName) in config" :key="sectionName">
|
<div v-for="(section, sectionName) in config" :key="sectionName">
|
||||||
<h3>{{ sectionName }}</h3>
|
<h3>{{ sectionName }}</h3>
|
||||||
<el-row :gutter="20">
|
<el-row :gutter="20">
|
||||||
<el-col v-for="(value, key) in section" :key="key" :xs="24" :sm="12" :md="8" :lg="6">
|
<el-col v-for="(value, key) in section" :key="key" :xs="24" :sm="12" :md="8" :lg="6">
|
||||||
<el-form-item :label="key">
|
<el-form-item :label="key">
|
||||||
<el-select v-if="sectionName === 'kick_ass'" v-model="config[sectionName][key]">
|
<el-select v-if="sectionName === 'lane_mode'" v-model="config[sectionName][key]">
|
||||||
<el-option
|
<el-option
|
||||||
v-for="item in target_person_options"
|
v-for="item in target_person_options"
|
||||||
:key="item.value"
|
:key="item.value"
|
||||||
@@ -162,10 +166,7 @@
|
|||||||
</el-col>
|
</el-col>
|
||||||
</el-row>
|
</el-row>
|
||||||
</div>
|
</div>
|
||||||
<el-button @click="saveConfig" type="primary" style="margin-top: 20px;">保存配置</el-button>
|
|
||||||
<el-button v-if="showConfigForm" @click="toggleConfigForm" type="primary" style="margin-bottom: 20px;">
|
|
||||||
{{ showConfigForm ? '关闭' : '打开' }} 配置
|
|
||||||
</el-button>
|
|
||||||
</el-form>
|
</el-form>
|
||||||
|
|
||||||
<h2 class="section-title">Log Display</h2>
|
<h2 class="section-title">Log Display</h2>
|
||||||
@@ -197,16 +198,16 @@
|
|||||||
timer: null,
|
timer: null,
|
||||||
target_person_options: [{
|
target_person_options: [{
|
||||||
value: 1,
|
value: 1,
|
||||||
label: '模式 1'
|
label: '6_9'
|
||||||
}, {
|
}, {
|
||||||
value: 2,
|
value: 2,
|
||||||
label: '模式 2'
|
label: '7_10_2'
|
||||||
}, {
|
}, {
|
||||||
value: 3,
|
value: 3,
|
||||||
label: '模式 3'
|
label: '7_14_2'
|
||||||
}, {
|
}, {
|
||||||
value: 4,
|
value: 4,
|
||||||
label: '模式 4'
|
label: '7_15_4'
|
||||||
}],
|
}],
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
|||||||
139
templates/index1.html
Normal file
139
templates/index1.html
Normal file
@@ -0,0 +1,139 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
<title>btl143</title>
|
||||||
|
<link rel="stylesheet" href="static/index.css">
|
||||||
|
<script src="static/vue.js"></script>
|
||||||
|
<script src="static/index.js"></script>
|
||||||
|
<script src="static/socket.io.js"></script>
|
||||||
|
|
||||||
|
<style>
|
||||||
|
body {
|
||||||
|
font-family: Arial, sans-serif;
|
||||||
|
margin: 0;
|
||||||
|
padding: 0;
|
||||||
|
background-color: #f5f7fa;
|
||||||
|
}
|
||||||
|
.app-container {
|
||||||
|
padding: 20px;
|
||||||
|
max-width: 1200px;
|
||||||
|
margin: 0 auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
.button-group {
|
||||||
|
margin-bottom: 20px;
|
||||||
|
}
|
||||||
|
.full-screen-background {
|
||||||
|
background-color: #f0f0f0;
|
||||||
|
position: fixed;
|
||||||
|
top: 60px; /* Adjust based on button height and margin */
|
||||||
|
left: 0;
|
||||||
|
right: 0;
|
||||||
|
bottom: 0;
|
||||||
|
z-index: -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
.counter-display {
|
||||||
|
padding: 20px;
|
||||||
|
text-align: center;
|
||||||
|
position: fixed;
|
||||||
|
top: 80px; /* Adjust based on your requirements */
|
||||||
|
left: 50%;
|
||||||
|
transform: translateX(-50%);
|
||||||
|
z-index: 1;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div id="app">
|
||||||
|
<el-container class="app-container">
|
||||||
|
<el-main>
|
||||||
|
<h1 class="section-title">btl143 upper</h1>
|
||||||
|
|
||||||
|
|
||||||
|
<el-row :gutter="20" class="button-group">
|
||||||
|
<el-col :xs="24" :sm="8">
|
||||||
|
<el-button
|
||||||
|
@click="toggleTask"
|
||||||
|
:type="taskActive ? 'success' : 'danger'"
|
||||||
|
style="width: 100%">
|
||||||
|
{{ taskActive ? `开启 task ${counter}` : `关闭 task ${counter}` }}
|
||||||
|
</el-button>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
<div class="full-screen-background" @click="incrementCounter">
|
||||||
|
<div class="counter-display">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
</el-main>
|
||||||
|
</el-container>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
new Vue({
|
||||||
|
el: '#app',
|
||||||
|
data: {
|
||||||
|
taskActive: true,
|
||||||
|
counter: 1
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
toggleTask() {
|
||||||
|
if (this.taskActive) {
|
||||||
|
this.socket.emit('operate', {type: 'operate_task', content: 'run'});
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
this.socket.emit('operate', {type: 'operate_task', content: 'stop'});
|
||||||
|
}
|
||||||
|
this.taskActive = !this.taskActive;
|
||||||
|
},
|
||||||
|
incrementCounter() {
|
||||||
|
this.counter += 1;
|
||||||
|
if (this.counter == 5) {
|
||||||
|
this.counter = 1;
|
||||||
|
}
|
||||||
|
this.socket.emit('operate', {type: 'save_target_person', content: this.counter});
|
||||||
|
},
|
||||||
|
startServer() {
|
||||||
|
this.socket.emit('operate', {type: 'operate_server', content: 'run'});
|
||||||
|
},
|
||||||
|
stopServer() {
|
||||||
|
this.socket.emit('operate', {type: 'operate_server', content: 'stop'});
|
||||||
|
},
|
||||||
|
restartServer() {
|
||||||
|
this.socket.emit('operate', {type: 'operate_server', content: 'restart'});
|
||||||
|
},
|
||||||
|
startTask() {
|
||||||
|
this.socket.emit('operate', {type: 'operate_task', content: 'run'});
|
||||||
|
},
|
||||||
|
stopTask() {
|
||||||
|
this.socket.emit('operate', {type: 'operate_task', content: 'stop'});
|
||||||
|
},
|
||||||
|
restartTask() {
|
||||||
|
this.socket.emit('operate', {type: 'operate_task', content: 'restart'});
|
||||||
|
},
|
||||||
|
skipTask() {
|
||||||
|
this.socket.emit('operate', { type: 'skip_task', content: '' });
|
||||||
|
}
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
this.socket = io('http://' + document.domain + ':5001');
|
||||||
|
this.socket.on('connect', () => {
|
||||||
|
console.log('Connected to server');
|
||||||
|
});
|
||||||
|
this.socket.on('task_status', (data) => {
|
||||||
|
if (data.content == 0) {
|
||||||
|
this.taskActive = true
|
||||||
|
} else {
|
||||||
|
this.taskActive = false
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
128
templates/index2.html
Normal file
128
templates/index2.html
Normal file
@@ -0,0 +1,128 @@
|
|||||||
|
<!DOCTYPE html>
|
||||||
|
<html lang="en">
|
||||||
|
<head>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||||
|
<title>btl143</title>
|
||||||
|
<link rel="stylesheet" href="static/index.css">
|
||||||
|
<script src="static/vue.js"></script>
|
||||||
|
<script src="static/index.js"></script>
|
||||||
|
<script src="static/socket.io.js"></script>
|
||||||
|
|
||||||
|
<style>
|
||||||
|
body {
|
||||||
|
font-family: Arial, sans-serif;
|
||||||
|
margin: 0;
|
||||||
|
padding: 0;
|
||||||
|
background-color: #f5f7fa;
|
||||||
|
}
|
||||||
|
.app-container {
|
||||||
|
padding: 20px;
|
||||||
|
max-width: 1200px;
|
||||||
|
margin: 0 auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
.button-group {
|
||||||
|
margin-bottom: 20px;
|
||||||
|
}
|
||||||
|
.full-screen-background {
|
||||||
|
background-color: #f0f0f0;
|
||||||
|
position: fixed;
|
||||||
|
top: 60px; /* Adjust based on button height and margin */
|
||||||
|
left: 0;
|
||||||
|
right: 0;
|
||||||
|
bottom: 0;
|
||||||
|
z-index: -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
.counter-display {
|
||||||
|
padding: 20px;
|
||||||
|
text-align: center;
|
||||||
|
position: fixed;
|
||||||
|
top: 80px; /* Adjust based on your requirements */
|
||||||
|
left: 50%;
|
||||||
|
transform: translateX(-50%);
|
||||||
|
z-index: 1;
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
</head>
|
||||||
|
<body>
|
||||||
|
<div id="app">
|
||||||
|
<el-container class="app-container">
|
||||||
|
<el-main>
|
||||||
|
<h1 class="section-title">btl143 upper</h1>
|
||||||
|
|
||||||
|
|
||||||
|
<el-row :gutter="20" class="button-group">
|
||||||
|
<el-col :xs="24" :sm="8">
|
||||||
|
<el-button
|
||||||
|
@click="toggleTask"
|
||||||
|
:type="taskActive ? 'success' : 'danger'"
|
||||||
|
style="width: 100%">
|
||||||
|
{{ taskActive ? `开启 task` : `关闭 task` }}
|
||||||
|
</el-button>
|
||||||
|
</el-col>
|
||||||
|
</el-row>
|
||||||
|
|
||||||
|
</el-main>
|
||||||
|
</el-container>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
new Vue({
|
||||||
|
el: '#app',
|
||||||
|
data: {
|
||||||
|
taskActive: true,
|
||||||
|
counter: 1
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
toggleTask() {
|
||||||
|
if (this.taskActive) {
|
||||||
|
this.socket.emit('operate', {type: 'operate_task', content: 'run'});
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
this.socket.emit('operate', {type: 'operate_task', content: 'stop'});
|
||||||
|
}
|
||||||
|
this.taskActive = !this.taskActive;
|
||||||
|
},
|
||||||
|
startServer() {
|
||||||
|
this.socket.emit('operate', {type: 'operate_server', content: 'run'});
|
||||||
|
},
|
||||||
|
stopServer() {
|
||||||
|
this.socket.emit('operate', {type: 'operate_server', content: 'stop'});
|
||||||
|
},
|
||||||
|
restartServer() {
|
||||||
|
this.socket.emit('operate', {type: 'operate_server', content: 'restart'});
|
||||||
|
},
|
||||||
|
startTask() {
|
||||||
|
this.socket.emit('operate', {type: 'operate_task', content: 'run'});
|
||||||
|
},
|
||||||
|
stopTask() {
|
||||||
|
this.socket.emit('operate', {type: 'operate_task', content: 'stop'});
|
||||||
|
},
|
||||||
|
restartTask() {
|
||||||
|
this.socket.emit('operate', {type: 'operate_task', content: 'restart'});
|
||||||
|
},
|
||||||
|
skipTask() {
|
||||||
|
this.socket.emit('operate', { type: 'skip_task', content: '' });
|
||||||
|
}
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
this.socket = io('http://' + document.domain + ':5001');
|
||||||
|
this.socket.on('connect', () => {
|
||||||
|
console.log('Connected to server');
|
||||||
|
});
|
||||||
|
this.socket.on('task_status', (data) => {
|
||||||
|
if (data.content == 0) {
|
||||||
|
this.taskActive = true
|
||||||
|
} else {
|
||||||
|
this.taskActive = false
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
@@ -34,15 +34,16 @@ def signal_handler(sig, frame):
|
|||||||
|
|
||||||
offset = 0
|
offset = 0
|
||||||
signal.signal(signal.SIGTERM, signal_handler)
|
signal.signal(signal.SIGTERM, signal_handler)
|
||||||
|
cmd_py_obj.send_speed_x(15)
|
||||||
while True:
|
while True:
|
||||||
time.sleep(0.2)
|
|
||||||
ret, box = filter.get(tlabel.LMARK)
|
time.sleep(0.02)
|
||||||
if ret:
|
ret, box = filter.get(tlabel.BASE)
|
||||||
# 宽度大于 41 停车
|
|
||||||
print(f"width: {box[0][2] - box[0][0]} height: {box[0][3] - box[0][1]}")
|
|
||||||
# if ret:
|
# if ret:
|
||||||
# error = (box[0][2] + box[0][0] - 320) / 2 + offset
|
# 宽度大于 41 停车
|
||||||
# print(error)
|
# print(f"width: {box[0][2] - box[0][0]} height: {box[0][3] - box[0][1]}")
|
||||||
|
if ret:
|
||||||
# cmd_py_obj.send_speed_omega(-error * 0.8)
|
error = (box[0][2] + box[0][0] - 320) / 2 + offset
|
||||||
|
print(error)
|
||||||
|
cmd_py_obj.send_speed_omega(-error * 0.8)
|
||||||
car_stop()
|
car_stop()
|
||||||
@@ -16,18 +16,18 @@ socket.connect("tcp://localhost:6667")
|
|||||||
logger.info("subtask yolo client init")
|
logger.info("subtask yolo client init")
|
||||||
|
|
||||||
filter = label_filter(socket)
|
filter = label_filter(socket)
|
||||||
filter.switch_camera(1)
|
filter.switch_camera(2)
|
||||||
|
|
||||||
|
|
||||||
find_counts = 0
|
# find_counts = 0
|
||||||
offset = 19
|
# offset = 19
|
||||||
label = [tlabel.LPILLER, tlabel.MPILLER, tlabel.SPILLER]
|
# label = [tlabel.LPILLER, tlabel.MPILLER, tlabel.SPILLER]
|
||||||
label = tlabel.TPLATFORM
|
# label = tlabel.TPLATFORM
|
||||||
while True:
|
while True:
|
||||||
time.sleep(0.2)
|
time.sleep(0.2)
|
||||||
ret, box = filter.get(tlabel.TPLATFORM)
|
ret, box = filter.get(tlabel.BASE)
|
||||||
if ret:
|
if ret:
|
||||||
error = (box[0][2] + box[0][0] - 320) / 2 + offset
|
error = (box[0][2] + box[0][0] - 320) / 2
|
||||||
logger.error(error)
|
logger.error(error)
|
||||||
|
|
||||||
# label = tlabel.HOSPITAL
|
# label = tlabel.HOSPITAL
|
||||||
|
|||||||
@@ -9,7 +9,8 @@ task_speed = 0
|
|||||||
pid_argv = {"kp" : 1.2, "ki" : 0, "kd" : 0} # 1.2
|
pid_argv = {"kp" : 1.2, "ki" : 0, "kd" : 0} # 1.2
|
||||||
|
|
||||||
# 转向 pid 对象
|
# 转向 pid 对象
|
||||||
pid_turning = PidWrap(pid_argv["kp"], pid_argv["ki"], pid_argv["kd"], output_limits=60) # FIXME 6_9 模型为 50
|
# pid_turning = PidWrap(pid_argv["kp"], pid_argv["ki"], pid_argv["kd"], output_limits=70) # FIXME 6_9 模型为 60
|
||||||
|
pid_turning = PidWrap(pid_argv["kp"], pid_argv["ki"], pid_argv["kd"], output_limits=60) # FIXME 6_9 模型为 60
|
||||||
|
|
||||||
llm_text = ''
|
llm_text = ''
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user