|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
|
|
Thread Tools | Rate Thread | Display Modes |
|
|
|
#1
|
|||
|
|||
|
operatorControl() not being called
For some reason operatorControl() is not being called. robotInit() is, but not operatorControl(). So as a secondary problem it was continuously saying "Output not updated enough", which through research I came to realize was a functionality of MotorSafety, which can be disabled with drive.setSafetyEnabled(false). Unfortunately that didn't work because it was in operatorControl() and operatorControl() was not being called when we switched to Teleoperated.
Code: http://pastebin.com/6BzKXXVA Unfortunately the stack trace isn't available to me right now. |
|
#2
|
||||||
|
||||||
|
Re: operatorControl() not being called
I suspect that your code is crashing, prior to operatorControl, which is the cause of the motor safety messages. Please provide the entire netbeans output, there should be a stack trace in there.
|
|
#3
|
|||
|
|||
|
Re: operatorControl() not being called
Quote:
|
|
#4
|
||||||
|
||||||
|
Re: operatorControl() not being called
Are you enabling the robot on the driver station?
|
|
#5
|
|||
|
|||
|
Re: operatorControl() not being called
Yes.
|
|
#6
|
|||
|
|||
|
Re: operatorControl() not being called
One problem is that you are allocating a bunch of PWMs to the same channel (0).
Code:
// Motor constants
int FRONT_LEFT_MOTOR_PWM = 1;
int REAR_LEFT_MOTOR_PWM = 2;
int FRONT_RIGHT_MOTOR_PWM = 3;
int REAR_RIGHT_MOTOR_PWM = 4;
int LAUNCH_PWM;
int RIGHT_WINCH_PWM;
int LEFT_WINCH_PWM;
int LINE_ACTUATOR_PWM;
// Motor controller configurations
Jaguar frontLeft = new Jaguar(FRONT_LEFT_MOTOR_PWM);
Jaguar rearLeft = new Jaguar(REAR_LEFT_MOTOR_PWM);
Jaguar frontRight = new Jaguar(FRONT_RIGHT_MOTOR_PWM);
Jaguar rearRight = new Jaguar(REAR_RIGHT_MOTOR_PWM);
Jaguar launch = new Jaguar(LAUNCH_PWM);
Jaguar rightWinch = new Jaguar(RIGHT_WINCH_PWM);
Jaguar leftWinch = new Jaguar(LEFT_WINCH_PWM);
You might want to assign them unique values and try again. Brad |
|
#7
|
|||
|
|||
|
Re: operatorControl() not being called
Tried commenting them out nothing changed.
Another programmer on the team discovered that the movement code worked fine on its own, but once the Camera code was added the motors fail to run, even in teleop. |
|
#8
|
|||
|
|||
|
Re: operatorControl() not being called
Bump. The situation has not changed. I've tried placing the camera code in a different class, nothing changed. My mentor believes that the camera is sending too much data for the cRio to handle, but even when recording at 1 FPS the situation has not changed.
|
|
#9
|
|||
|
|||
|
Re: operatorControl() not being called
Well we've figured it out. Apparently your while loops should run at 10Hz to stay synced with the cRio. Locking.
crap how do i lock this aaaaaa |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|