Coding the drive system? (Arcade?)

Maybe this is a dumb question but… what EXACTLY is Arcade Drive? I know tank drive is when you use just the vertical axes of two joysticks and blah blah blah. Is Arcade Drive for teams with mechanum wheels?

The way I had imagined our drive system was to use the left stick to move and the right stick to turn (using a controller), but the Arcade Drive vi only has an x and a y plugin so the two ideas dont really line up

Arcade Drive uses one axis for “throttle” (y) and one axis for rotation (x). These axes do not have to come from the same joytick. Nor do they actually have to be the x and y axis of any joystick used.

Arcade drive is named around how arcade games would operate. A single stick would move you forward, backward, or rotate you clockwise or counterclockwise. Perhaps the easiest way to experience it is to run it in the simulator.

Then to understand how it works. A simple version of it sums the X and Y axis and sends that to side’s motors and subtracts the two and sends that to the other side’s motors. To understand a few example points, consider just the Y axis with an X of zero. The output to the motors is Y to one side and -Y to the other. Seems like that works to move the robot in a straight line. Now plot out the X axis with Y at zero. We end upsending X to both motors, and since the motors on one side of the robot are flipped, this results in the robot spinning in place at the given speed of X.

Combine the two vectors we’ve just mapped, and take a corner as an example. Full X and Full Y give all power to one motor and none to the other leading to a rotation about one wheel.

This simple arcade mapping will work and is probably pretty common, but it is also useful to scale the values or map the values first to make it easier to drive straight and in gentle arcs and making less of the XY space about spinning.

The default dashboard shows the motor outputs and joystick inputs, and you may find it useful to connect to a cRIO or simulated robot and pay attention to the plots as you move the joystick around and think about the X, Y, and outputL and outputR values that it generates.

Greg McKaskle

Here’s our drive system class:

I know it’s titled TankDrive, but there’s an arcadeDrive function in there too.

Arcade drive is normally controlled with one stick, with Y being backwards/forwards, and X being left/right. It’s kind of like video games in the arcade, hence arcade drive. Compare it to Pacman.

We use a field oriented (not robot oriented) custom drive system based on the mecanum drive system, using a gyro.