def __init__(self, n_particles, particle_color='b', **kwargs): """ :param n_particles: Number of particles to display. This will also dictate how many particles are expected when providing new particles to update the plot :param particle_color: color of particle for plotting. Defaults to blue. Other keyword arguments are passed to FilterHemispherePlot """ FilterHemispherePlot.__init__(self, **kwargs) self._n_particles = n_particles self._particle_color = particle_color self._setup_particles() self._setup_estimates()
def update(self, particles, weights, *args, **kwargs): """ Update the plot given a new set of particles, weights, and possibly estimates :param particles: new particle locations. Should be of size (n_particles x 3) :param weights: new particle weights. Should be numpy vector of length 'n_particles' All other arguments arguments are passed to FilterHemispherePlot.update() """ self._update_particle_locs(particles) self._update_particle_weights(weights) FilterHemispherePlot.update(self, *args, **kwargs)