|
|
|
![]() |
|
|||||||
|
||||||||
![]() |
| Thread Tools | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
requires() error
While trying to include a new elevator object in our command based robot, we receive errors specifically with the requires tag. Any ideas?
|
|
#2
|
|||
|
|||
|
Re: requires() error
Idea #1, post more information, preferably a link to an online location containing your code. There is not nearly enough information here to help.
|
|
#3
|
||||
|
||||
|
Re: requires() error
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.
Last edited by Jalerre : 01-02-2015 at 19:21. |
|
#4
|
|||
|
|||
|
Re: requires() error
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 {}
|
|
#5
|
|||
|
|||
|
You must put it in the robot.java file if using command base
Ex. Elevator = new elevator Then in the requires(robot.elevator) |
![]() |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|