Issue 84 - Simplify engine and executor #85
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This change does not remove or change any public API methods, and therefore no robot code needs to be changed. However, a few of the Strongback configuration options available in previous versions are no longer supported, so the corresponding methods in
Strongbackand its configurator are now deprecated and may no longer have any affect.This PR corrects a number of errors and simplifies the engine by rewrites how the
Strongback.javaclass is implemented. All of the existing public methods are still available, though quite a few have been deprecated and now may no longer do anything. For example, the different timer modes and clocks only complicated how to configure Strongback, yet really didn’t offer any advantages and may have made the code worse by making the execution period less consistent. In short, robot code can continue to use these deprecated methods, but the methods may have no effect and could be removed from the robot’s codebase. Note that the deprecated methods will be removed in the next major release of Strongback for 2017.This change also corrects and simplifies how the executor thread operates. Now, Strongback measures the time required to run all executables (e.g., the switch reactor, command scheduler, data recorder, event recorder, etc.), and uses this time to determine if the executor did not complete in the specified amount of time. This should improve the accuracy of the error messages about taking too long to execute each cycle. And Strongback only uses the “busy” timer mode and the system clock, which simplified the executor implementation.
Finally, Strongback now supports priorities for its executables:
Currently, the command scheduler (through with all commands are run) will operate at HIGH priority, while the data recorder (if used) and the switch reactor will operate at the MEDIUM priority. The event recorder still records the time at which events occurred, but events are written out at LOW priority.
Fixes #84.