Place the entire joystick code in periodic tasks.
There's only two main differences between Teleop and a loop in Periodic tasks:
- Teleop should be able to execute in less than 20ms, whereas a loop in Periodic Tasks can take as long as you like.
- The loop in Periodic tasks will execute regardless of what mode the Robot is in. (teleop, autonomous, disabled, etc.) With autonomous, this isn't a problem, because the robot does not receive updated joystick data during autonomous. (With Disabled it does, but all the outputs will be disabled. Depending on whether you use a time-based or sensor-based sequence, this might simply make the robot wait until it is re-enabled before kicking.)