Skip to content

Carter_V1 DifferentialController sim2real #2473

Discussion options

You must be logged in to vote

Thank you for posting this. It seems the issue arises because the DifferentialController's kinematic equations allow one wheel to rotate backward even with non-negative action inputs, depending on the ratio of linear and angular velocities. Also, training may be overfitting.

A couple of possible solutions are as follows:

1. Clamp Wheel Velocities

Modify the controller to enforce non-negative wheel speeds:

def forward(self, command):
    V, ω = command
    ω_R = (2 * V + ω * self.wheel_base) / (2 * self.wheel_radius)
    ω_L = (2 * V - ω * self.wheel_base) / (2 * self.wheel_radius)
    ω_R = max(ω_R, 0.0)  # Prevent negative velocities
    ω_L = max(ω_L, 0.0)
    return [ω_R, ω_L]

Trade-o…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by giangdao1402
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants