I’m a first year programmer so I might have a lot of wrong ideas and false concepts of how to execute this but please bear with me
So my team wants to implement two individual drive systems: One to use on the bridge in which the bot’s maximum speed is reduced to 1/3 the maximum speed for easier control, and another which is used normally on the field that will be run at full speed. The reason why I need two individual drive systems is that on the field we want to use a holonomic drive system for control, but on the bridge we want to use a tank drive, with the tank drive driving at 1/3 speed. We’re planning on using an Xbox controller for the holonomic drive, one joystick for forward/backward and turning, and another for strafes. For the tank drive, we want to use a joystick that will be forward/backward and turning constituting the tank drive.
Now this leads me to two questions. How might I reduce the maximum speed of the drive systems in only ONE of the drive systems and will both drive systems work cooperatively if executed within the same teleop.vi?
To reduce the speed to 1/3 power, simply take the joystick axis and divide it by .66. this will scale the joystick to only output a third of its normal power. For the 2 drive systems, i would assign a joystick button to where, when held down, would change a case statement to use the tank drive code, and when it is released, use the normal holonomic code.
How exactly would something like that look? I currently have it where, in teleop, it opens the joystick and unbundles the buttons that control the case statement. Inside the case statement would be the normal teleop code for a drive system, including getting the motors and joystick and connecting them to the tank drive vi. Would something like that work? Thanks
You don’t necessarily have to put the entire thing inside that case statement. Call the motor refnum and joystick refnums outside, and have one side that passes straight into the tank drive for one side (so there is only the tank drive vi in the statement), and on the other side, have the same thing, only with your math statement too to scale it down.