Robot lag?

So recently we discovered that whenever we tried to drive our robot, there was some lag time between the time we moved the joystick to the time the robot moved. Also, the robot continued to move even when we were not holding the joystick down. There was no change in code and we did not do anything different to the robot. Any ideas?

Try checking a few things:

  1. On the driver station, check your robot CPU usage. If it’s high (over 30%) something funny might be going on with your code.
  2. Check task manager for your computer’s CPU usage. If it’s high, check to make sure there are no other unnecessary process running on your computer.
  3. Check your network connection. Look in the diagnostics tab of the driver station and look for packet loss and round trip time (they might not be callled exactly that, but something like that). If they are high, that could be a problem. Switch to a tethered connection (USB or network cable) and see if that’s the problem.
  4. Check that your joystick is not broken. You can see some raw diagnostics about the joystick on the USB tab of the driver station.

As far as the robot moving while the joystick is not being moved you may want to check the trims on your joysticks if they have them. Play around with the X and Y trims. If the problem still persists you may want to try setting a dead band in the code.

Are you using multithreading?

We had this issue when some vision code was implemented, but not refined or tested, causing a good 1 to 2 second lag. Like others have said, I would look for something that is using more resources than it should be. Or it’s just a network/wireless issue.