Different Control Patterns

I was curious If you are able to swap control patterns out for different ones. For example, If person a uses a “Tank Drive” control pattern with a logitech controller. And person B wants to use a thrustmaster joystick to control robot motion. Would they be able to work alongside each other, or would you have to reprogram every time you change platforms.

it’s entirely possible to have a dropdown selector using a dashboard to choose control schemes. Combining the example code for a sendablechooser from WPILib Docs with what function is called for your “drive” command would achieve this result.

That being said, I’m of the opinion it’s better to establish good control patterns for everyone involved and let the drive team’s competence of choice guide others, rather than the other way around and potentially hurting on-field performance.

2 Likes

You could also require the operator to hold a button down to “select their joystick” and drive the robot. Something like this:

if (joystick1.getRawButton(1)) {
    // Code to drive with Joystick 1
} else if (joystick2.getRawButton(1)) {
    // Code to drive with Joystick 2
}
1 Like

Even better, use a joystick button to toggle between the two modes, and print to the console when the transition occurs. We used this to give our off-season drivers flexibility between control schemes on our robots, since some kids prefer tank, while others prefer curvature.

Whats curvature? I may have not heard it with that name

You might have heard it called Cheesy Drive or Differential Drive though there’s some minor differences to how the Cheesy Poofs implement.

1 Like

CurvatureDrive is a drive method implemented in WPILib to approximate a specific response curve for driving arcade-style inspired by 254’s CheesyDrive methods for the past several seasons. @jlmcmchl is correct in that there are some minor differences, but it’s essentially just an alternate curve to an arcade-style drive scheme. Really only applicable for DifferentialDrive (aka Tank) though.

I can do this with two whole different Input mediums right? Such as a Console style controller and a Flight joystick as they are whole separate entities. Will the system recognize this the same way? I’m not much of a programmer so I wouldn’t know.

Yes. Here’s an example where the same functions were mapped to both an xbox and a joystick controller. There was also a “low power” drive mode for demos because that tiny robot accelerated so quickly at full throttle, and low power intake commands to support a demo trick where Gavin would build the pyramid with the robot.

1 Like

All unique USB joystick devices on a Driver Station show up as different devices, and can be re-ordered in the DS to match the order in the code (or vice versa, but it’s significantly easier to re-order.)

1 Like

Awesome. Thanks Everyone!