From 39f548a79d321f5cf1d9c99be4dfe540e2d9c74c Mon Sep 17 00:00:00 2001 From: havoc420ubuntu <2993167370@qq.com> Date: Wed, 28 May 2025 06:01:57 +0000 Subject: [PATCH] Refactor task_3.py: rename and restructure functions for clarity and improved execution flow. Introduced pass_up_down function and redefined run_task_3 to enhance task management. --- task_3/task_3.py | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/task_3/task_3.py b/task_3/task_3.py index 614e485..3432722 100644 --- a/task_3/task_3.py +++ b/task_3/task_3.py @@ -35,12 +35,7 @@ robot_cmd = { 'value':0, 'duration':0 } -def run_task_3(ctrl, msg): - section('任务3:步态切换', "启动") - info('开始执行任务3...', "启动") - - turn_degree_v2(ctrl, msg, 90, absolute=True) - +def pass_up_down(ctrl, msg): usergait_msg = file_send_lcmt() lcm_usergait = lcm.LCM("udpm://239.255.76.67:7671?ttl=255") @@ -335,3 +330,16 @@ def run_task_3(ctrl, msg): msg.life_count += 1 ctrl.Send_cmd(msg) pass + + +def run_task_3(ctrl, msg): + section('任务3:步态切换', "启动") + info('开始执行任务3...', "启动") + + turn_degree_v2(ctrl, msg, 90, absolute=True) + + # section('任务3-1:up', "开始") + # pass_up_down(ctrl, msg) + + section('任务3-2:yellow stop', "开始") +