fix(base_move): correct side velocity direction in follow_left_side_track
- Reverse the sign of side_velocity to move in the correct direction - Uncomment run_task_1 and comment out run_task_test in main.py - Update task_left_line.py to turn 90 degrees before following the left side track
This commit is contained in:
parent
e77d5655ae
commit
e869b4d891
@ -1373,7 +1373,7 @@ def follow_left_side_track(ctrl, msg, target_distance=150, speed=0.3, max_time=3
|
||||
# 设置速度命令 - [前进速度, 侧向速度, 角速度]
|
||||
# 侧向速度为正表示向左移动,为负表示向右移动
|
||||
# 前进速度保持为0,只进行侧向移动
|
||||
msg.vel_des = [0, side_velocity, 0]
|
||||
msg.vel_des = [0, -side_velocity, 0]
|
||||
|
||||
# 使用轨迹线斜率进行小角度调整,确保机器人方向与轨迹线平行
|
||||
if not track_info["is_vertical"]: # 对于非垂直线,进行角度校正
|
||||
|
4
main.py
4
main.py
@ -39,13 +39,13 @@ def main():
|
||||
Ctrl.base_msg.stop() # BUG 垃圾指令 for eat
|
||||
|
||||
# time.sleep(100) # TEST
|
||||
# run_task_1(Ctrl, msg)
|
||||
run_task_1(Ctrl, msg)
|
||||
|
||||
# run_task_2_5(Ctrl, msg)
|
||||
|
||||
# run_task_4(Ctrl, msg)
|
||||
|
||||
run_task_test(Ctrl, msg)
|
||||
# run_task_test(Ctrl, msg)
|
||||
|
||||
# time.sleep(100)
|
||||
|
||||
|
@ -13,5 +13,6 @@ from utils.log_helper import LogHelper, get_logger, section, info, debug, warnin
|
||||
logger = get_logger("任务-test")
|
||||
|
||||
def run_task_test(ctrl, msg):
|
||||
# follow_left_side_track(ctrl, msg)
|
||||
time.sleep(100)
|
||||
turn_degree(ctrl, msg, 90, absolute=True)
|
||||
follow_left_side_track(ctrl, msg)
|
||||
# time.sleep(100)
|
Loading…
x
Reference in New Issue
Block a user