Sample state using uniform distribution


state = sampleUniform(space)returns a sample state within the StateBounds property of the space object using a uniform distribution.

state = sampleUniform(space,numSamples) returns a number of state samples. The number is equal to numSamples.

state = sampleUniform(space,nearState,distVector,numSamples) returns the state samples in a subregion defined by nearState and distVector. The center of the subregion is the nearState. distVector defines the distance from the two boundaries of the subregion to the center.

Input Arguments

collapse all

State space object, specified as a stateSpaceSE2, a stateSpaceDubins, or a stateSpaceReedsShepp object.

Data Types: object

Number of samples, specified as a positive integer.

Data Types: single | double

Center of the sampling region, specified as a 3-element real vector.

Data Types: single | double

Distance of sampling region boundary form the center, specified as a 3-element nonnegative vector.

Data Types: single | double

Output Arguments

collapse all

State samples, returned as an N-by-3 real-valued matrix. N is the number of samples. Each row of the matrix corresponds to one incidence of state in the state space.

Data Types: single | double

Introduced in R2019b