-
Notifications
You must be signed in to change notification settings - Fork 141
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Introduce 2D Obstacles, handling for sensors and the Visibility Informed Bernoulli Filter #1096
base: main
Are you sure you want to change the base?
Introduce 2D Obstacles, handling for sensors and the Visibility Informed Bernoulli Filter #1096
Conversation
…ertance for RadarBearing and RadarBearingRange
…ertance for RadarBearing and RadarBearingRange
…and relative edge caching
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #1096 +/- ##
==========================================
+ Coverage 94.19% 94.25% +0.06%
==========================================
Files 207 207
Lines 13465 13626 +161
Branches 2740 2237 -503
==========================================
+ Hits 12683 12843 +160
- Misses 530 533 +3
+ Partials 252 250 -2
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
stonesoup/plotter.py
Outdated
@@ -1508,6 +1508,34 @@ def plot_sensors(self, sensors, mapping=[0, 1], sensor_label="Sensors", **kwargs | |||
sensor_xy = np.array([sensor.position[mapping, 0] for sensor in sensors]) | |||
self.fig.add_scatter(x=sensor_xy[:, 0], y=sensor_xy[:, 1], **sensor_kwargs) | |||
|
|||
def plot_obstacles(self, obstacles, mapping=[0, 1], obstacle_label='obstacles', **kwargs): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Similar to other methods in this class, a short docstring explaining the method and the parameters and their datatypes would be useful
Co-authored-by: Henry Pritchett <87075245+hpritchett-dstl@users.noreply.github.com>
…s_clutter_detectable return
Docs appear to have failed due to an exception raised with an unrelated example |
Co-authored-by: James Wright <69153443+jswright-dstl@users.noreply.github.com>
This pull request introduces a number of new features, focussed around the idea of obstacles in the environment and the impact that this has on blocking sensor line of sight to targets. The contributions are categorised below:
Obstacle
platform. A new basePlatform
type,Obstacle
, is introduced. The class is designed to allow the user to place obstacles in the environment by specifying the shape of the obstacle as polygon vertices, the position and orientation of the obstacle and any otherPlatform
related properties for the obstacle. Moving obstacles should be possible with this implementation but this has not been tested at this stage.Obstacle
also calculates some properties that are relevant for estimating visibility of targets and does so by caching the property and only recalculating it when necessary (i.e. obstacle position and orientation changes). Afrom_obstacle
class method has also been created that allows for creating multiple obstacles that share properties, such as shape data, and redefining others, such as position or orientation.VisibilityInformed2DSensor
is a new base sensor class that inherits fromSimpleSensor
and is intended to be inherited by 2D sensors (such as those adopting range-bearing and bearing-only sensor models) such that they can call the methodis_visible
, which evaluates the visibility of states by checking whether the line of sight intersects anyObstacle
edges. This sensor base class allows the user to specify an obstacle list which is used for this purpose, but can be left undefined to resume the original functionality of the sensors before introducing this new base class.RadarBearing
,RadarBearingRange
,RadarRotatingBearing
andRadarRotatingBearingRange
have all been modified to inherit from this base class and each callis_visible
from withinis_detectable
meaning that there are no changes to how these sensors are implemented. In order to evaluate the visibility of multiple states at the same time (relevant for the next point),is_detectable
has been modified to handle arrays of states as well as single states.VisibilityInformedBernoulliParticlePredictor
andVisibilityInformedBernoulliParticleUpdater
have been introduced and modify thepredict_log_weights
andget_detection_probability
methods ofBernoulliParticlePredictor
andBernoulliParticleUpdater
respectively. This filter modifies the transition likelihood, birth likelihood and detection probability according to whether particles are inside obstacles or in not visible free space, which prevents the estimated existence from decaying quickly when a target travels behind andObstacle
and improves the resulting estimation performance when compared to the original Bernoulli filter.plot_obstacles
is a method introduced forPlotterly
andAnimatedPlotterly
to allow the user to plot lists of, or single,Obstacle
. The plotting of obstacles assumes that they are closed polygons which are filled accordingly, however, it is possible to specify open obstacles.