Victors lose communications in Autonomous.

Hey all,

So after a few success in getting the motors to follow the target in vision processing, and running it time after time off of a Victor Motor Controller successfully in both Teleop and Autonomous mode, we decided to code it for the drive motors, so the robot could turn and follow the target. Well, we coded it in Teleop just fine, and it worked as expected. However, when we replicated the code in Autonomous, the Victors would begin blinking randomly, and completely lose communications.

I am posting pictures of my code hoping someone can show me in the error of my ways.

Thanks in advance!

-Chandler Douglas



Vision Processing

A small run down of my code:
In Vision Processing we process the image and find the “X” and “Y” value as well as the center of the object (this was accomplished from the 2013 Rectangular target Processing example put out). We then call for the global variable “Target Info” in Teleop and Autonomous. Then, we unbundle down to find the X value, and make X a local variable (it wouldn’t work any other way.) We then feed one X value to each axis, and negate another to ensure that the motor turns.

Your loop in Autonomous that creates the “X” variable is running unthrottled. It’s possible that it’s starving the other loops (and communication tasks) for CPU time.

You know that your code ensures the motors will only run for 1.5 seconds maximum, right?

(While using X and -X as the left and right inputs to Tank Drive works, you could instead use an Arcade Drive block and feed it a single X axis value to make the robot turn.)

Worked like a charm, Alan! Good thing too, because I was getting mad at my simplistic mistakes!