Log in

View Full Version : requires() error


therealdavier
31-01-2015, 14:29
While trying to include a new elevator object in our command based robot, we receive errors specifically with the requires tag. Any ideas?

RufflesRidge
31-01-2015, 14:30
Any ideas?

Idea #1, post more information, preferably a link to an online location containing your code. There is not nearly enough information here to help.

Jalerre
31-01-2015, 23:40
I agree, there is not enough information to conclude what the problem is. However I can tell you a solution to a problem we had with the requires statement. Because CommandBase does not exist anymore for you to make instances of all your subsystems, you now have to use requires(Robot.subsystem_instance). If this does happen to be your problem also note that you have to import you commands and subsystems manually now.

Fauge7
01-02-2015, 21:34
Try putting the requires method inside the constructor of the command. If you don't know what a constructor is: it's a method that is called at the time of instantiation or whenever you say new command. To declare a constructor, after the class declaration type "public" and the class name then () and a set of {}

joshmill229
02-02-2015, 21:22
You must put it in the robot.java file if using command base
Ex. Elevator = new elevator

Then in the requires(robot.elevator)