android-robocar icon indicating copy to clipboard operation
android-robocar copied to clipboard

Wrong differential steering behavior

Open cammace opened this issue 7 years ago • 2 comments

As mentioned on Wikipedia,

If both the wheels are driven in the same direction and speed, the robot will go in a straight line. If both wheels are turned with equal speed in opposite directions, as is clear from the diagram shown, the robot will rotate about the central point of the axis

You are currently only turning on one side of the wheels to turn instead of reversing the other side.

cammace avatar May 06 '17 18:05 cammace

@cammace Thanks. We actually had that behavior in the past but https://github.com/zugaldia/android-robocar/pull/16 changed it to correct a few issues of the implementation at the time.

What I'd like to see is an abstract WheelsBehavior interface (or similar name) that developers could easily override, while providing 2-3 default implementations, including the one you link to.

zugaldia avatar May 07 '17 16:05 zugaldia

@zugaldia @cammace in #16 I only changed it such that if you press UP+LEFT or UP+RIGHT simultaneously, it will rotate that side at a lower speed than the other side to get the wide turn effect. But if you only press LEFT or RIGHT, without the UP arrow, it still works as before by reversing the other side. So basically it is still working as described in that wikipedia link @cammace mentioned.

hsalameh avatar May 07 '17 17:05 hsalameh