Crabmodus OK
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user