We’re having issues getting our 2011 robot to run.
We’ve got our digital sidecar in slot 2, as the instructions say.
If we use the SimpleTemplate sample, it will drive the Jaguars on PWM 1 and 2 (green lights and the motors turn).
If we modify the SimpleTemplate sample to drive PWMs 3 and 4, it will happily drive those motors (green lights and the motors turn).
If we modify the SimpleTemplate sample to use the RobotDrive constructor that takes PWMs 1, 2, 3, and 4 (as our 2011 robot used 4 drive motors), it fails to send signals to any Jaguar - they give us a slow orange blink.
If we remove the RobotDrive class and manually declare Jaguars attached to various PWMs, it will only work if we use 3 or fewer Jaguars. As soon as we construct the 4th Jaguar (whether or not we call the Set() function on it), the program fails to send a signal to the Jaguars.
To summarize:
-All 4 Jaguars have power and PWMs going to them - we can successfully drive any of them if we set our program to use those PWMs.
-As soon as we attempt to use 4 motors, whether via RobotDrive or via Jaguar class instances, it fails.
-We get no error messages in the console
-If we put a printf in the main operator control loop, it gets called continuously, indicating that the loop is running properly.
I noticed some “syncgroup” parameters in the Jaguar class header that default to 0 - is there something we’re supposed to do with that?
Here’s the 4-Jaguar code that fails - can someone try it on their robot and confirm whether it works or not?
#include "WPILib.h"
class RobotDemo : public SimpleRobot
{
Joystick stick; // only joystick
Jaguar frontRight;
Jaguar backRight;
Jaguar frontLeft;
Jaguar backLeft;
public:
RobotDemo(void):
frontRight(1),
backRight(2),
frontLeft(3),
backLeft(4),
stick(1) // as they are declared above.
{
}
void Autonomous(void)
{
}
void OperatorControl(void)
{
while (IsOperatorControl())
{
frontLeft.Set(0.3);
frontRight.Set(0.3);
backLeft.Set(0.3);
backRight.Set(0.3);
Wait(0.005); // wait for a motor update time
}
}
};
START_ROBOT_CLASS(RobotDemo);