-
Notifications
You must be signed in to change notification settings - Fork 2
Controls
If you're not sure on how to do something, chances are the first thing that pops in your mind will work.
Simply click on any blank space and drag the mouse around.
Scrolling the mouse will zoom in and out. On a trackpad you can simply use a two-finger scroll to zoom in and out. On some devices pinch-to-zoom should even work too.
Click on the "plus" towards the bottom right corner.
Simply click on a point and drag it around.
Right clicking on a point will delete it. On a trackpad you can perform a two finger click.
Right clicking on a path (but not on another point) will create a new point. On a trackpad you can perform a two finger click.
If two paths that execute sequentially don't have the same start and end points you will get weird behavior. To ensure that two paths have the same end and start points you can connect them. To do this drag start of one path near the end of path that executes before it. Drop the path down and click again. The two paths should now have the same end and start point.
If you need to switch which point is selected when they are connected you can click in the same area again to switch between them
The autonomous timeline represents how the auto will run. On the robot each step (different colored section) will be executed from top to bottom.
In the above picture the robot will first sleep for 500ms, then drive the green path, then the blue path, and then finally the orange path.
Sometimes the Auto Timeline can get quite cluttered. You can close and open each step by clicking on the colored heading.
Open Step
Closed Step
Sometimes it is desirable to manually input a position into a path. To do this click on the point to highlight it. Then, find the row in the Auto Timeline that has a dark background. You can then edit the numbers in the textbox to change the location of that point.
The text boxes are ordered left to right X
, Y
, Rotation (degrees)
To reorder items in the Auto Timeline simply drag the step, using the colored section, to the desired position.
Sometimes the robot will need to execute other parts of the robot code during auto.
The script step allows you easily execute these commands from the GUI.
It has a basic syntax that can be used to execute robot code.
Each new line is a new command. Each command contains a Class followed by a .
and then a method and (optional) arguments that are separated by spaces.
Arguments must either be a primitive type, a String, or an Enum.
Comments can be added by starting a line with a #
.
There is no support for semicolons, brackets, or another control loop logic.
An example of a script is shown below.
sleep 500
print printing something yay!
Shooter.setShooterSpeed 5000
Intake.setDeployState DEPLOY
This system uses reflection, so it requires all methods that want to be called to be either static
, for the class that contains it to be a singleton that has a public static getInstance()
method, or for a method to be supplied using the @AutoBuilderInstance
Annotation. Apart from making sure that the methods can be invoked there is no other configuration that you need to do on your robot for this to work!
NOTE: The fist 2 method call are actually not executed using reflection, but are instead hardcoded in.
Caution: Do NOT catch any interrupted exceptions if you're sleeping ect... Just have your method throw the interrupted exception. The code executing your method will catch the exception for you. The exception is used to kill the auto when it is ended early. (Like when you disable the robot before the auto is completed). If you must catch it for some reason, be sure to rethrow it!
Likewise if you have any while/for loops in methods being executed by the auto you need to check if the current thread has been interrupted and throw an interrupted exception if it is! The easiest way to do this is to add a short Thead.sleep()
to your loops or you can add if (Thread.interrupted()) throw new InterruptedException();
If you want to test out the scripting functionality in the GUI, but haven't implemented the robot side yet you can download this sample file and put it into the folder that stores your config file.
If you see a warning icon that means something is probably wrong.
On a trajectory it means that the current path does not start at the end of the last path.
On a script it means that it failed to parse and will not execute properly on the robot code.
If you see the warning symbol on a path step it means that first point on that path is not the same as the last point on the previous path. Click here to learn how to fix this.
If you see the warning symbol on a script step it means that your script is invalid. The method you are trying to call is probably not a valid method that you can call or your arguments have been deemed invalid. You should be able to hover over the text underlined in red to see exactly what the error is.
Undo and redo are supported. Simply press Ctrl + Z
to undo and Ctrl + Shift + Z
to redo