AutonomyModel class

A view model for the autonomy page to render a grid map.

Shows a bird's-eye map of where the rover is, what's around it, where the goal is, and the path to get there. This class uses AutonomyData to keep track of the data as reported by the rover. The grid is a 2D map of width and height gridSize that keeps the roverPosition in the center (by keeping track of its centerPosition) and filling the other cells with AutonomyCells.

Mixed-in types

Constructors

AutonomyModel()
Listens for incoming autonomy or position data.

Properties

badAppleAudioPlayer AudioPlayer
The audio player for the Bad Apple music
finalinherited
badAppleFrame ↔ int
Which frame in the Bad Apple video we are up to right now
getter/setter pairinherited
centerPosition UTMCoordinates
The offset to add to all other coordinates, based on roverPosition. See recenterRover.
getter/setter pair
commandBuilder AutonomyCommandBuilder
Builder for autonomy commands
final
data AutonomyData
The autonomy data as received from the rover.
getter/setter pair
empty AutonomyGrid
An empty grid of size gridSize.
no setter
grid AutonomyGrid
The grid of size gridSize with the rover in the center, ready to draw on the UI.
no setter
gridSize ↔ int
The amount of blocks in the width and height of the grid.
getter/setter pair
hashCode → int
The hash code for this object.
no setterinherited
hasListeners → bool
Whether any listeners are currently registered.
no setterinherited
imagesArchive Archive?
The decompressed archive of the bad apple images
getter/setter pairinherited
isPlayingBadApple ↔ bool
Whether the UI is currently playing Bad Apple
getter/setter pairinherited
markerBuilder GpsBuilder
The view model to edit the coordinate of the marker.
getter/setter pair
markers ↔ List<GpsCoordinates>
A list of markers manually placed by the user. Useful for the Extreme Retrieval Mission.
getter/setter pair
precisionMeters → double
The precision of the grid
no setter
roverCellType AutonomyCell
The cell type of the rover that isn't AutonomyCell.rover
no setter
roverHeading → double
The rover's heading
no setter
roverPosition GpsCoordinates
The rover's current position.
no setter
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
snapToGrid ↔ bool
Whether or not to place all of the rover's surroundings on a grid
getter/setter pair

Methods

addListener(VoidCallback listener) → void
Register a closure to be called when the object changes.
inherited
clearMarkers() → void
Deletes all the markers in markers.
dispose() → void
Discards any resources used by the object. After this is called, the object is not in a usable state and should be discarded (calls to addListener will throw after the object is disposed).
override
disposeBadApple() → void
Cleans up any resources used by Bad Apple.
inherited
handleDrag(AutonomyCell data, MapCellData cell) → void
Handles when a specific tile was dropped onto a grid cell.
init() → Future<void>
Initializes the view model.
markCell(AutonomyGrid grid, GpsCoordinates gps, AutonomyCell value) → void
Calculates a new position for gps based on centerPosition and adds it to the grid.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
notifyListeners() → void
Call all the registered listeners.
inherited
onNewData(AutonomyData value) → void
A handler to call when new data arrives. Updates data and the UI.
placeMarker(GpsCoordinates coordinates) → void
Places the marker at coordinates.
placeMarkerOnRover() → void
Places a marker at the rover's current position.
recenterRover() → void
Determines the new centerPosition based on the current roverPosition.
removeListener(VoidCallback listener) → void
Remove a previously registered closure from the list of closures that are notified when the object changes.
inherited
removeMarker(GpsCoordinates gps) → void
Removes a marker from gps
startBadApple() → Future<void>
Starts playing Bad Apple.
inherited
stopBadApple() → void
Stops playing Bad Apple and resets the UI.
inherited
toggleMarker(MapCellData cell) → void
Adds or removes a marker at the given location.
toString() → String
A string representation of this object.
inherited
zoom(int newSize) → void
Sets the zoom of the map.

Operators

operator ==(Object other) → bool
The equality operator.
inherited