Please Help

I have been having trouble programming my drive train. If there out there that can walk me through programming drive train.

Thanks,

Cameron Richardson, 8160

Phone 7089049367

GitHub

What kind of problems?

I get errors sometimes it stops the motor doesn’t move and i get emergency stopped .

Could you share a link to your code in GitHub or somewhere similar?

Emergency Stopped happens when you hit the PC’s space bar.
Buttons to avoid or be aware of on your PC while the Driver Station is running:

  • Space bar - estop (robot power must be cycled to restore operation)
  • Enter key - Disable robot
  • []\ all at once - Enable Robot
1 Like

I am not sure why it is not moving, however, there are a number of non-standard constructs in your code that could be throwing me off. Here are a few suggestions if you are still having issues after considering Mark’s post.

First, the change the motor controller and TankDrive method static declarations in Drivesubsystem to non-static.

Second, remove the setDefualtcomand method from Drivesubsystem. You are getting default command set because this is misspelled. If someone fixes the spelling, its implementation that does nothing is going to cause you mysterious grief.

Third, in RobotContainer change line 35 to:

DriveSub.setDefaultCommand(new RunCommand(() -> DriveSub.TankDrive(joy.getRawAxis(1), joy.getRawAxis(5)), DriveSub));

I did all of that its giving me this error

ERROR  1  Unhandled exception: java.lang.NullPointerException  java.base/java.util.Objects.requireNonNull(Unknown Source) 
ERROR  1  The startCompetition() method (or methods called by it) should have handled the exception above.  edu.wpi.first.wpilibj.RobotBase.runRobot(RobotBase.java:293) 
Warning at edu.wpi.first.wpilibj.RobotBase.runRobot(RobotBase.java:291): Robots should not quit, but yours did!

It means you are passing a null object somewhere. I can’t tell where though.

Yea looked through the whole thing and still cant find it

Found it:

You need to change this to drive sub or instantiate example subsystem.

how i dont understand

Change line 26 to:

private ExampleSubsystem m_exampleSubsystem = new ExampleSubsystem();

If you get another exception like this that you want to ask about, please post the stack trace you see in the driver station log. It should point right to the failing line.

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.