More motors cause joystick to get slow

When we try to create more than 5 motor objects (RobotDrive, Jaguar, Victor using C++), our joystick starts responding very slowly so the ArcadeDrive doesn’t move the robot until a half second or more after the joystick is moved. This is only our second year, so we could easily be doing things wrong, but we can’t find a problem like this mentioned anywhere else. We’ve tried increasing the Wait time in our main and task loops to 20 and 50 ms but that hasn’t helped much. We’ve seen teams talk about using 10 or more drives, so it seems like we shouldn’t be having these problems.

Any help with be greatly appreciated!

Are your motors too close to you radio? Are you tethered or wireless? Does it still lag when tethered?

Yes it was still lagging while we were tethered, and no our motors aren’t too close to the radio

Are you using any Wait()s in your code? as any time you spend waiting is time that you aren’t reading your inputs and updating your outputs.

Also, if you have image processing running continuously that can cause alot of processing to take place which needs to finish when before you process inputs and outputs again.

Were not using the axis camera or image processing at all. We are going to check the wait statements, but I don’t think that’s the problem.

Does it cause a problem creating a new Jaguar or Victor object for a motor that is not yet connected to the robot?

It shouldn’t add any more load than actually having that Jaguar present, unless perhaps you use CAN to connect your Jaguars (but I don’t know much about CAN); but the standard case is using PWMs to drive the motor, which is not a bidirectional communication, so it has no way to know if you have the Jag present or not.