Create a uniform state sampler with default properties. By default, the sampler uses the SE(2) state space as the configuration space for motion planning. The limits of the state variables [x, y, theta] in the default state space are [-100 100; -100 100; -3.1416 3.1416]. The values of x and y are in meters. theta is in radians.
Define a custom SE(2) state space by specifying the limits of the state variables [x, y, theta]. The values of x and y are in meters. theta is in radians.
ss = stateSpaceSE2([-1 1; -2 2; -pi/2 pi/2]);
Create a uniform state sampler with the custom state space as input.
sampler = stateSamplerUniform(ss);
Sample the input state space. Set the number of samples to select as 10.
State samples, returned as an M-by-N matrix of
real values. M is the number of states. N is the
number of state variables. Each row of the matrix specifies the state variables
corresponding to the input state space model. For example, for the SE(2) state space
model, N is 3, and each row is of the form [x,
y, theta].