mirror of
https://github.com/6-robot/wpr_simulation.git
synced 2025-09-15 12:59:01 +08:00
update follow.py
This commit is contained in:
parent
943b3db0da
commit
25db4cef52
@ -69,8 +69,8 @@ def Cam_RGB_Callback(msg):
|
|||||||
cv2.line(cv_image, (target_x, target_y-10), (target_x, target_y+10), (255, 0, 0), 3)
|
cv2.line(cv_image, (target_x, target_y-10), (target_x, target_y+10), (255, 0, 0), 3)
|
||||||
|
|
||||||
# 计算机器人运动速度
|
# 计算机器人运动速度
|
||||||
vel_forward = (image_height/2 - target_y) * 0.002
|
vel_forward = (image_height/2 - target_y) * 0.001
|
||||||
vel_turn = (image_width/2 - target_x) * 0.003
|
vel_turn = (image_width/2 - target_x) * 0.0005
|
||||||
vel_cmd.linear.x = vel_forward
|
vel_cmd.linear.x = vel_forward
|
||||||
vel_cmd.angular.z = vel_turn
|
vel_cmd.angular.z = vel_turn
|
||||||
else:
|
else:
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user