init: rough companion app stub
This commit is contained in:
@@ -0,0 +1,17 @@
|
||||
/// Single particle in a particle filter cloud snapshot.
|
||||
class Particle {
|
||||
const Particle({required this.x, required this.y, required this.weight});
|
||||
|
||||
/// Normalised 0..1 coordinates (same space as [Position]).
|
||||
final double x;
|
||||
final double y;
|
||||
|
||||
/// Unnormalised likelihood weight.
|
||||
final double weight;
|
||||
|
||||
factory Particle.fromJson(Map<String, dynamic> json) => Particle(
|
||||
x: (json['x'] as num).toDouble(),
|
||||
y: (json['y'] as num).toDouble(),
|
||||
weight: (json['weight'] as num).toDouble(),
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user