What are some clever programs that your team use to make your driver control more efficient? (eg. raise lift to tower height by pressing one button).
Well I know we (and lots of others) have 1 button that backs our robot up and runs the intakes slowly so we can stack
Nice. Our intake get pushed out by the tray when we push so we donāt have that
Decreasing sensitivity for the drive helps make driving smoother without removing itās max speed
How? In our recent comp we have this problem and what I did is just decreasing the joystick value by 3/4
Thatās one way to do it, another popular method is to cube the joystick values (taking āthe joystick valueā as a float between -1 and 1 in each axis), that way you get more sensitivity at low motor powers for precise movement while still being able to use 100% power when you want it.
Do you put the axis value into the float? (Something like this?)
float axisone = Controller1.Axis1.value();
I plan on having a sensor know when my tray is full, and drive slowly when it is so that I donāt accidentally spill cubes
So if youāre getting joystick values as a percent (int from -100 to 100), then the easiest thing to do is probably to divide the controller value by 100, then cube it, then scale the cubed result back by 100 (because you probably want it scaled back up to feed as a power value to motors):
int cube_joystick_val(int input){
return pow(input/100.0, 3.0)*100.0;
}
note that you will likely need to #include <math.h>
to get the pow
function.
This is really good. With a drfb I increase the value of the exponent as the drfb gets higher so itās less likely to tip
With some algebraic thinking, you should be able to simplify that even further: cube, then divide by 10000. Not that it will make any noticeable difference in performance, just an observation.
Ohhh so like the value slowly builds up more and more when you move the joystick
No, that would be called slew rate/acceleration. The cube joystick basically remaps all the value (80% joystick would be 51.2% motor power).
I have buttons for running intake at full speed, and at half speed. That way if I want to fine tune the position of a cube in the intake, you can use the slower buttons. The full speed buttons toggle on, but the half speed buttons run as long as you press the button.
For a bot with a tall lift, reduce the motor speed based on the lift height to make it less prone to falling over, and more precise when trying to stack.
If you need to zero the position of a pid based motors, hold a button for manual control that, when released, resets the position of that motor.
Hold a button for low-speed/precise drive train control.
Select different braking options using buttons.
Have a partner controller pre-select stack or tower height so that the driver can just press a single button and the lift goes to the correct height for stacks or buckets.
Button for small adjustments to the left/right motors of a lift to level it out.
Toggle a drive straight function if your drive train gets messed up and your robot is turning when you try to drive straight.
Check out our robot showcase:
There we show how we automated our flywheel angler in driver control, and made ourselves some higher level controls.
From personal experience, also think about partner controls. Our driver last year was also our main programmer, while I was the secondary programmer to help ease the load of him driving by taking over some things like intake control and aiming.
Like a lot of people say, combine commonly paired inputs or sequences together. At nationals our programmer mapped a ādouble shotā function to our ball launcher, which would automatically aim, shoot, re-aim, and shoot again with just 1 button press.
Macros and directional x-drive