diff --git a/src/pc/steering/ts_pd_control.py b/src/pc/steering/ts_pd_control.py index e940694..67f3bc5 100644 --- a/src/pc/steering/ts_pd_control.py +++ b/src/pc/steering/ts_pd_control.py @@ -114,7 +114,8 @@ position_error = (center_x - bottom_x) / center_x # 操舵量: P 項(位置偏差)+ Heading 項(傾き) - error = p.kp * position_error + p.kh * slope + # 符号反転: 偏差正(線が左)→ steer 負(左へ曲がる) + error = -(p.kp * position_error + p.kh * slope) # 時間差分の計算 now = time.time()