![]() |
Code problems
Hi Everyone,
if someone has time can you please take a look at our code. When we compile this the driver station shows no robot code. Currently we are only trying to use the drivetrain41 and the shootermotors. The other code is written so that we can test those items when they are ready. Do I need to comment them out when they are not connected? For example the servos are not plugged into the rio yet will that cause a problem? Thank you very much Code:
package org.usfirst.frc.team5676.robot; |
Re: Code problems
After you send your code to the robot, is there a message or error code that appears in the message window at the right of the DS? If so, it could be an exception or code crash, and the robot is trying to give you details about it. If there is anything there, post it here and we could try to help you understand it.
|
Re: Code problems
I am away from the ds currently but I will try to run it again when I can and look at the error report then post that error.
|
Re: Code problems
Great. Also, when deploying from Eclipse, check and see if there is a message in the Eclipse console that states whether or not the code deployed correctly (this should be the blue and orange text that appears at the bottom of Eclipse when deploying code). That could tell you if the code even made it to the robot in the first place.
|
Re: Code problems
|
Re: Code problems
we have been able to run a code on the robot i.e. the getting started but we are having trouble with our current code that we are trying to use.
Thank you though |
Re: Code problems
So the build is successful in eclipse then when we look at the DS there is no robot code. The error as far as I can tell is in the robotmain and it reads an unhandled exception.
|
Re: Code problems
Can you copy and paste the entire error message? We need to know what the exception was and where it happened to be able to help you.
|
Re: Code problems
here is the error.
unhandled exception: Java.lang.nullpointer exception @ edu.wpi.RobotDrive.set invertedMotor(robot drive.java:706 org.us.first.robotinit(robot.java:61 edu.wpi first interativerobot.startCompetition(iterititiveRobot. java:72 edu.wpi RobotBase.main(RobotBase.java:241 |
Re: Code problems
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.
|
Re: Code problems
Quote:
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. |
| All times are GMT -5. The time now is 08:58 AM. |
Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
Copyright © Chief Delphi