StopState implementation

Prevent hard Servo movements to Idle Position
This commit is contained in:
2026-10-24 22:15:34 +02:00
parent 7e2c6d86ac
commit 8f93f90fb8
5 changed files with 64 additions and 3 deletions
+10 -1
View File
@@ -73,7 +73,7 @@ class WalkingState(State):
and abs(omega) < 0.01
and self.current_tick == 0
):
return "idle"
return "stopping"
t = self.current_tick / float(self.ticks)
tick_pos_temp = []
@@ -165,6 +165,15 @@ class WalkingFourState(State):
self.start_pos = dt.PosArray(np.copy(robot.current_pos.data))
def execute(self, robot: Robot) -> Optional[str]:
vx, vy, omega = robot.vector_dirmov
if (
abs(vx) < 0.01
and abs(vy) < 0.01
and abs(omega) < 0.01
and self.current_tick == 0
):
return "stopping"
t = self.current_tick / float(self.ticks)
tick_pos_temp = []
dirmov = robot.vector_dirmov