FIRST Robot Simulator - SimulationPanel


What Is Simulated

SimuationPanel doesn't itself simulate anything. It is the control interface for the overall simulation.


Where Used

SimuationPanel.tcl is called from the standard code and should not need to be modified when implementing a typical robot. When RoboSystem.tcl is executed, SimuationPanel.tcl defines the root graphic window. It's window takes the name RoboSystem.tcl.


GUI View

Click on a thumbnail sketch to see the full size picture.

SimulationPanel is made up of several child objects. I will not detail the details of the design. Instead I will describe how the resulting SimulationPanel is used when running a simulation.


Instructions For Use

At the bottom right you can see the SimControl part of the panel. By clicking on the buttons you can Run/Stop/Step the simulation. You can also Exit the simulation with a button click.

In the green window of the SimControl part of the panel the cycle count and time are displayed. This same information is also presented in the text log window.

The lower number, "0:0.007" in this example, is elapsed time in minutes:seconds. Fractional seconds are shown.

The upper number, "0.1" in this example, is the cycle counts. Since there are both fast and slow cycles, it enumerates them separately. The first number is the slow cycle count. The second number is the number of fast cycles since the last slow cycle.

The simulator doesn't have a good idea of how long it will really take to run your code. As a result it is impossible to accurately predict the number of fast cycles that you will see between slow cycles.

The simulator avoids this problem by putting you in control. You select the FastRatio. With a value of 2, there will be two fast cycles between each slow cycle. I recommend that your code be written so that it doesn't depend on this ratio being a particular number. Instead you should write your code so that it is robust over several FastRatio values.

The SimSpeed slider tells the simulation how fast to run when you click "Run". The default value, 1, is about 1 cycle per real second. That is hundreds of times slower than how the robot will behave.

These buttons allow you to switch the mode the same as with a competition port dongle.

The simulation creates a text log file when run. This text window contains much the same information, but colorized. With it you can scan back from an event to see what the port values were that led up to that event.

Sometimes it is more convenient to see a real-time view of the port values. The ByteMonitor does that for you. Of course, this is the same information as is presented in the TextLog window above.

Event Triggers are provided. At this point they have not been fully tested.

Report will be connected to a function in the simulator that inserts into the log a count of the errors, warnings, and notes that have occurred up to this point.

Interrupt will trigger an interrupt.


Caveats

Due to a bug, you should click on one of the three buttons "Auto", "Manual", or "Disable" before starting a simulation.



Last modified 4 Apr 2004