Main Content

distance

Distance between states

Description

dist = distance(manipSS,state1,state2) calculates the distance between one or more initial states and one more final states.

Input Arguments

collapse all

Manipulator state space, specified as a manipulatorStateSpace object, which is a subclass of nav.StateSpace (Navigation Toolbox).

Initial state position, specified as ann-element row vector or m-by-n matrix. n is the dimension of the state space specified in the NumStateVariables property of manipSS. m is the number of initial state positions.

The sizes of state1 and state2 determine the size of the dist output:

State Vectors and Distances

state1 Sizestate2 Sizedist Size
n-element row vectorn-element row vectorscalar
n-element row vectorm-by-n matrixm-element column vector
m-by-n matrixn-element row vectorm-element column vector
m-by-n matrixm-by-n matrixm-element column vector

Final state position, specified as a n-element row vector or m-by-n matrix. n is the dimension of the state space specified in the NumStateVariables property of manipSS. m is the number of initial state positions.

The sizes of state1 and state2 determine the size of the dist output:

State Vectors and Distances

state1 Sizestate2 Sizedist Size
n-element row vectorn-element row vectorscalar
n-element row vectorm-by-n matrixm-element column vector
m-by-n matrixn-element row vectorm-element column vector
m-by-n matrixm-by-n matrixm-element column vector

Output Arguments

collapse all

Distance between two states, returned as a numeric scalar or m-element column vector. This distance calculation is the main component in evaluating the costs of paths. For prismatic joints, the distance between two states is the Euclidean norm of the difference between the state vectors. For revolute joints with infinite bounds, the difference in joint values is calculated using angdiff.

For revolute joints, distances measure joint differences in radians. For prismatic joints, distances measure displacement in meters.

The sizes of state1 and state2 determine the size of output dist:

State Vectors and Distances

state1 Sizestate2 Sizedist Size
n-element row vectorn-element row vectorscalar
n-element row vectorm-by-n matrixm-element column vector
m-by-n matrixn-element row vectorm-element column vector
m-by-n matrixm-by-n matrixm-element column vector

See Also

(Navigation Toolbox) | (Navigation Toolbox) | (Navigation Toolbox) | (Navigation Toolbox) | (Navigation Toolbox)

Introduced in R2021b