Thread: Code problems
View Single Post
  #11   Spotlight this post!  
Unread 02-20-2016, 11:14 PM
Justin Buist Justin Buist is offline
Registered User
FRC #4003 (TriSonics)
Team Role: Mentor
 
Join Date: Feb 2015
Rookie Year: 2015
Location: Allendale, MI
Posts: 18
Justin Buist is an unknown quantity at this point
Re: Code problems

Quote:
Originally Posted by EmileH View Post
It looks like where you are setting an inverted motor (line 706 of your robot drive class), you are referencing a motor or some object that doesn't exist. NullPointerExceptions are errors that get thrown when you are trying to call something but it returns null.
RobotDrive is part of WPILibJ so it isn't "their" class. Line 706 in that class references the front right motor. In the posted code from Robot.java line 61 references the rear left motor so there might be a discrepancy between what was posted and what was actually run.

Either way the problem is in this line:

DriveTrain41 = new RobotDrive(0,1,2,3);

One of those pins doesn't actually map to a Talon. That could be a programming or wiring error.
Reply With Quote