-
This commit is contained in:
@@ -76,7 +76,7 @@ class AGVController:
|
||||
if rc != 0:
|
||||
logger.warning(f"发布 cmd_vel 失败: {err}")
|
||||
|
||||
def move_forward(self, speed: float = 0.5, duration: float = None):
|
||||
def move_forward(self, speed: float = 1.0, duration: float = None):
|
||||
"""前进"""
|
||||
if not self.is_connected():
|
||||
return
|
||||
@@ -85,7 +85,7 @@ class AGVController:
|
||||
time.sleep(duration)
|
||||
self.stop()
|
||||
|
||||
def move_backward(self, speed: float = 0.5, duration: float = None):
|
||||
def move_backward(self, speed: float = 1.0, duration: float = None):
|
||||
"""后退"""
|
||||
if not self.is_connected():
|
||||
return
|
||||
@@ -94,7 +94,7 @@ class AGVController:
|
||||
time.sleep(duration)
|
||||
self.stop()
|
||||
|
||||
def turn_left(self, speed: float = 0.5, duration: float = None):
|
||||
def turn_left(self, speed: float = 1.0, duration: float = None):
|
||||
"""左转"""
|
||||
if not self.is_connected():
|
||||
return
|
||||
@@ -103,7 +103,7 @@ class AGVController:
|
||||
time.sleep(duration)
|
||||
self.stop()
|
||||
|
||||
def turn_right(self, speed: float = 0.5, duration: float = None):
|
||||
def turn_right(self, speed: float = 1.0, duration: float = None):
|
||||
"""右转"""
|
||||
if not self.is_connected():
|
||||
return
|
||||
@@ -112,7 +112,7 @@ class AGVController:
|
||||
time.sleep(duration)
|
||||
self.stop()
|
||||
|
||||
def move_left_lateral(self, speed: float = 0.5, duration: float = None):
|
||||
def move_left_lateral(self, speed: float = 1.0, duration: float = None):
|
||||
"""向左横向移动"""
|
||||
if not self.is_connected():
|
||||
return
|
||||
@@ -121,7 +121,7 @@ class AGVController:
|
||||
time.sleep(duration)
|
||||
self.stop()
|
||||
|
||||
def move_right_lateral(self, speed: float = 0.5, duration: float = None):
|
||||
def move_right_lateral(self, speed: float = 1.0, duration: float = None):
|
||||
"""向右横向移动"""
|
||||
if not self.is_connected():
|
||||
return
|
||||
@@ -176,7 +176,7 @@ class AGVController:
|
||||
return self._position
|
||||
return None
|
||||
|
||||
def go_to_point(self, x: float, y: float, rz: float = None, speed: float = 0.5) -> bool:
|
||||
def go_to_point(self, x: float, y: float, rz: float = None, speed: float = 1.0) -> bool:
|
||||
"""移动到目标点(需要 ROS2 导航栈)"""
|
||||
logger.warning("go_to_point 需要 ROS2 Nav2 支持,当前仅记录目标")
|
||||
return True
|
||||
|
||||
Reference in New Issue
Block a user