Crabmodus OK

This commit is contained in:
2026-05-20 08:47:10 +02:00
parent e0cbed612a
commit ced9da92a5
8 changed files with 2314 additions and 23 deletions
+11 -17
View File
@@ -159,10 +159,10 @@ class Rover():
if(self.locomotion_mode == LocomotionMode.CRABBING.value):
if(driving_command != 0):
wheel_direction = 0
if(steering_command > 0):
if(steering_command >= 0):
wheel_direction = steering_command - 90
elif(steering_command <= 0):
elif(steering_command < 0):
wheel_direction = steering_command + 90
wheel_direction = np.clip(wheel_direction, -75, 75)
@@ -279,20 +279,14 @@ class Rover():
return motor_speeds
if(self.locomotion_mode == LocomotionMode.CRABBING.value):
if(driving_command > 0):
if(steering_command > 0):
motor_speeds[self.FL] = 50
motor_speeds[self.FR] = 50
motor_speeds[self.CL] = 50
motor_speeds[self.CR] = 50
motor_speeds[self.RL] = 50
motor_speeds[self.RR] = 50
elif(steering_command <= 0):
motor_speeds[self.FL] = -50
motor_speeds[self.FR] = -50
motor_speeds[self.CL] = -50
motor_speeds[self.CR] = -50
motor_speeds[self.RL] = -50
motor_speeds[self.RR] = -50
v = driving_command
if(steering_command < 0):
v *= -1
motor_speeds[self.FL] = v
motor_speeds[self.FR] = v
motor_speeds[self.CL] = v
motor_speeds[self.CR] = v
motor_speeds[self.RL] = v
motor_speeds[self.RR] = v
return motor_speeds