Skip to content

Instantly share code, notes, and snippets.

@jmbarr
jmbarr / highlysimplesensormanagement.ipynb
Created November 1, 2020 15:57
Sensor management example 1
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@jmbarr
jmbarr / 01_smoother_notebook.ipynb
Last active August 10, 2021 17:46
Kalman smoother
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
def choose_actions(sensors, predicted_tracks, reward_function, smapping=[0,2], tmapping=[0,2]):
"""Work out which action to take. Sensors must be able to return actions, a collection which is either
iterable or testable for membership. Tracks have been predicted to a time of interest in advance (this
logic could exist inside choose actions with the addition of a :class:`Predictor`. A reward function is
passed - or could be accessed from the parent state. Mappings to the x,y position of sensor and track are
provided - it's assumed that the angle to target is in x,y on a flat earth.)"""
# Firstly, can a sensor see a target? Create a dictionary of those
sensor_target_pair = dict()
for sensor in sensors: