Thread: Code Failing
View Single Post
  #3   Spotlight this post!  
Unread 19-01-2012, 14:27
abrightwell abrightwell is offline
Lead Software Engineer
FRC #0342 (Burning Magnetos)
Team Role: Mentor
 
Join Date: Feb 2011
Rookie Year: 2010
Location: Charleston, SC
Posts: 20
abrightwell is an unknown quantity at this point
Re: Code Failing

I agree with nick. First check your DIO channels for your speed controllers, though this shouldn't throw an exception. Also verify that you are indeed using CAN Jaguar. We have not used CAN in the past and therefore have not seen this specific issue, but the stacktrace would indicate that it is expecting CAN.

Also, as a matter of what we consider to be best practice, we explicitly declare and configure our speed controllers. This way we know without a doubt what we are handing to the RobotDrive.

Code:
SpeedController leftFront = new Jaguar(1, 1);
...
SpeedController rightRear = new Jaguar(1, 4);

RobotDrive robotDrive = new RobotDrive(leftFront, ..., rightRear);
Don't worry too much about being "verbose/explicit" the compiler will optimize as necessary. Remember, programming languages are for people.
Reply With Quote