Steering Wheel and Throttle programming

Hi, I’m trying to modify the default code so that I can drive our bot using a steeting wheel and throttle. I would like the robot to react as if I was driving a car. The turning rate would be dependent on how far I’ve turned the steering to one side or the other. How fast the bot would travel would be depended on how far I press the pedal.

Is there any example code that you might know of?

Thanks,
Windell
#2477

Actually…I’m writing that code right now, except we’re using joysticks.

If the left joystick is pressed forward, the robot will use encoders to drive straight. When the right joystick is moved side to side, the encoder PID will be turned off and one motor will be slowed while the other is increased, depending on which direction you’re turning.

Hopefully it’ll be done by friday… I’ll post it when I have it :slight_smile:

We were thinking of doing the same. So we got to work determining what values the steering wheel would output when we turn it right and left. We never figured it out but if we have time I would like to figure it out.

After you figure out the values. You just have to convert them to the values you used to use.

Ours right now is based on a tank drive. Pretty much like what John said. One joystick to go forward and back and the other to turn. So by using the wheel we would have to determine some sort of equation.

If you need help with that let me know,
Sravan

We have gotten a single joystick drive working previously, and to make things easy with the steering wheel and throttle, i immediately thought of merging the two. I thought you could just put in the steering wheel analog in as the joystick X and the throttle as the Joystick Y. Then, to make it a little smarter, put in some other logic as to not make it turn even when the throttle is not on. (ours spins in place if the joystick reads all X).

Thats just my thought, Have Fun.

We have two joysticks every year. It makes it much easier to control especially the turning

We usually have tank drive (2 joysticks), but we saw how hard it is to do arcs well with two joysticks. However, we experimented with single joystick drive in 05, and found it did arcs well, but it didn’t fit the game until now. We saw the need for more arcs in driving, especially after seeing that one team that’s basically done (121 i think, right?) go around the turn.

The combining should work fine. I was thinking just use the steering wheel as joystick X and the throttle as Y. So pretty much the same lines. It only depends upon your code to read both the values and then do whatever they tell you. It’ll def. produce more complicated code than if you just use two joysticks.

However, we experimented with single joystick drive in 05, and found it did arcs well, but it didn’t fit the game until now. We saw the need for more arcs in driving, especially after seeing that one team that’s basically done (121 i think, right?) go around the turn.

Why is it better with one joystick? I don’t see the difference.
Oh, never mind, it could just be that the driver is just a little bit slower when he/she uses the second joystick to turn. NEVER MIND.