Rocket Drive - A drive system based on Rocket League!

For Gamers, BY Gamers
Do you struggle to drive forward?
Does Tank Drive make it harder for you to control your robot?
Tired of your parents disliking you?
This is the code that will solve all of your problems!!

It sure can be difficult to drive, especially if you use Tank Drive to control your robot. Using Tank Drive can make it hard to drive in a straight line, leading to swervy robots and missed points.

Our code fixes this! We developed a handy VI that emulates the feel of controlling a car from Rocket League.
The Best Part? The Icon! I made it myself. I’m very proud of it. Also Justin and Wyatt made the sans one which is pretty cool too.
Download the VI’s here!!
It’s on GitHub. Sick.

Edit: Thanks to polyether for suggesting this bottom part here:
Differences between Rocket Drive and Arcade Drive are as follows:

  1. Rocket Drive uses the right trigger of a controller to go forward, and the left trigger to go backward. Pointing the left joystick left or right changes the direction your robot will turn. Arcade drive only uses the left joystick for movement. This allows for greater precision when driving your robot in a straight line.
  2. Turning the stick left and right while not using a trigger allows you to turn in place. Turning while using the acceleration or reverse trigger move the robot forward or backward while moving in the direction the stick is pointed.

Rocket Drive allows you to move forward straight easily, because you do not need to touch the joystick when moving. This should let your robot move in a straight line without you swerving.

8 Likes

Can you elaborate on the mechanical difference between this and arcade drive (forward/reverse + turn left/right on same joystick) and/or tank drive? I’m curious what it actually entails.

Additionally, a screenshot of the VI for those that don’t run LabView would be great.

Of course! Thank you for the suggestion.

Differences between Rocket Drive and Arcade Drive are as follows:

  1. Rocket Drive uses the right trigger of a controller to go forward, and the left trigger to go backward. Pointing the left joystick left or right changes the direction your robot will turn. Arcade drive only uses the left joystick for movement. This allows for greater precision when driving your robot in a straight line.
  2. Turning the stick left and right while not using a trigger allows you to turn in place. Turning while using the acceleration or reverse trigger move the robot forward or backward while moving in the direction the stick is pointed.

Rocket Drive allows you to move forward straight easily, because you do not need to touch the joystick when moving. This should let your robot move in a straight line without you swerving.
Thanks!

1 Like

Definitely an interesting schema! How do you feel this compares to split stick arcade drive, where the left joystick is purely for forwards and backwards movement, and the right stick is for turning?

Wasn’t this called differential drive? We’re using it since last year, we think it’s great!

Differential drive is not a control scheme, but the system used by a device with two independently driven and concentric wheels, or with two independent drive units split as “left” and “right”, to maneuver a 2D plane. Basically, what the community considers to be “tank drive”, “parallel plate”, “WCD”, etc when referring to the robot.

The tank drive control scheme would be best described as being differential drive controls if any of them.

1 Like

Thank you for the clarification, I’ll be able to say we use rocket drive then!

Team 2791 has been using this for a few years now, and 5254 more recently as well; although we originally called it GTA drive. If you want a Java or C++ implementation, you can copy this. You can take out the squaring of the turning if you want.

public void GTADrive(double leftTrigger, double rightTrigger, double turn) {
    if (-DriveConstants.kJoystickTurnDeadzone <= turn
        && turn <= DriveConstants.kJoystickTurnDeadzone) {
        turn = 0.0;
    }

    turn = turn * turn * Math.signum(turn);

    double left = rightTrigger - leftTrigger + turn;
    double right = rightTrigger - leftTrigger - turn;
    left = Math.min(1.0, Math.max(-1.0, left));
    right = Math.max(-1.0, Math.min(1.0, right));

    rightSide.set(right);
    leftSide.set(left);
}

We’ve found this to be far easier for new drivers to pick up and understand, as most kids have played games like Rocket League or GTA.

8 Likes

Not to rain on your code, but pro tip for people copying. To check if a value is between a maximum value and its negative, you can use Math.abs(Val)<maxVal

And in WPILIB MathUtil.clamp(Val,low,high) exists as of 2020
Just some pointers for cleaner code

1 Like

I know this form of drive as Forza Drive

2 Likes

This has been around forever and is more commonly known as GTA drive. We’ve been using this setup since atleast 2012.

4 Likes

We call this Curvature drive and used it this year and in 2019

Thanks! I haven’t played rocket league, this looks like a nice control scheme. Solves the issue of driving straight without needing to resort to angular joystick deadzones/filtering. While other teams have discovered it (as mentioned above), as a counterpoint, I hadn’t heard of it until now under any of those names, so more exposure is always good!

For several years now we’ve been using a similar thing, except the left stick does forwards/backwards and the triggers control rotation. Makes it really easy for the driver to switch to field centric Swerve, with the left stick controlling xy movement, and the triggers still controlling rotation

Still working on my 8 speed drivetrain so I can use forza drive w/ manual clutch and shitfting.

6 Likes

First year using GTA drive (with curvature turning option) and it felt great. I drove much better than i did last year (arcade). The only issue for me is I’m not quite up to speed yet, so im still driving in reduced speed mode (theoretical top speed 22ft/s).

When i said we have and option for curvature, i meant that i have 2 turning joysticks. Left joystick = turn in place at all times. Right joystick = 2 things: turns in place slow when the throttle is not on; curves when the throttle is on.

I use the DPad up/down to go between speeds. Technically, it’s possible to have 1 button as an on/off switch but since it’s a super important button, I rather be able to press it many times to be certain it’s set.

Unfortunately, we do not think our team will be competing, but there’s the pinned thread for that.

Our team has for the past 4 years been using the left stick to both control turn and speed while driving. This year we have changed to GTA drive and we have already seen a great increase in the accuracy of the robot when driving through tight gaps (such as under the control panel). This drive is a game changer, highly recommend for any teams not sure of their own controls or looking for a change!

279 started using that control scheme in 2014 when we built our first WCD; we called it “Need For Speed.” Holding down the “x” button (We we’re driving with PS4 controllers) would shift into high gear as a sort of “boost” and would shift back to low gear when you let go of the button. Worked great!

6032 is using a similar setup this year with the more common “GTA drive” name. The driver seems to really enjoy this style.

+1 for more teams to try it. Driving the robot just feels more intuitive

Rocket Drive Java implementation: https://github.com/thecodeweaver/RocketDrive (this hasn’t been tested on an actual robot yet…)

Our team used something very similar, in terms of acceleration at least.