setParticles(mcl,particles)
sets the particle poses and sets the weights of each particle to 1/n,
where n is the number of particles in the mcl object
at the current timestep.
setParticles(mcl,particles,weights)
specifies the poses and weights to set to each of the specified particles.
Call the reset method to initialize the mcl. The monteCarloLocalization object must be initialized using the step or reset methods first before you can use the setParticles function.
reset(mcl);
Load particle states and weights to use to set the particles in the monteCarloLocalization object.
Create lidar scan data. Create 300 range with measured values of 10 meters. Set the middle values to 2 meters to represent an obstacle. Create corresponding angles for the range readings and set the angle range to be -pi/2 to pi/2 radians.
Estimation particles, specified as an n-by-3 matrix, where each
row corresponds to the position and orientation of a single particle [x y
theta]. n is the total number of particles to set and
must be equal to the number of particles in mcl. Use the output
particle poses and weights from getParticles to determine the number of particles at the current timestep
and set particle poses and weights.
Weights of particles, returned as a n-element column vector. Each
row corresponds to the weight of the particle in the matching row of
particles. These weights are used in the final estimate of the
pose of the vehicle. n is the total number of weights to set and must
be equal to the number of particles in mcl. Use the output particle
poses and weights from getParticles to determine the number of
particles at the current timestep and set particle poses and weights.
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window.
Web browsers do not support MATLAB commands.
Seleziona un sito web
Seleziona un sito web per visualizzare contenuto tradotto dove disponibile e vedere eventi e offerte locali. In base alla tua area geografica, ti consigliamo di selezionare: .
Puoi anche selezionare un sito web dal seguente elenco:
Come ottenere le migliori prestazioni del sito
Per ottenere le migliori prestazioni del sito, seleziona il sito cinese (in cinese o in inglese). I siti MathWorks per gli altri paesi non sono ottimizzati per essere visitati dalla tua area geografica.