The returned path is a sequence of

*states*.

The length and content of a state depends on how the state space is defined:

- if the state space is a single simOMPL.StateSpaceType.position2d, then the state is \(\left<p_x, p_y\right>\).
- if the state space is a single simOMPL.StateSpaceType.pose2d (SE(2)), then the state is \(\left<p_x, p_y, \theta\right>\).
- if the state space is a single simOMPL.StateSpaceType.position3d, then the state is \(\left<p_x, p_y, p_z\right>\).
- if the state space is a single simOMPL.StateSpaceType.pose3d (SE(3)), then the state is \(\left<p_x, p_y, p_z, q_x, q_y, q_z, q_w\right>\).
- if the state space is a single simOMPL.StateSpaceType.joint_position, then the state is \(\left<p\right>\).
- if the state space is a single simOMPL.StateSpaceType.dubins (SE(2)), then the state is \(\left<p_x, p_y, \theta\right>\).

Where \(p_x\), \(p_y\), \(p_z\) are the x, y, z position, \(\theta\) is orientation on the (XY) plane, \(q_x\), \(q_y\), \(q_z\), \(q_w\) is the 3D orientation expressed as a unit quaternion, \(p\) is the value of a joint position.

If the state space is a composition of the above, simple concatenation applies, e.g.: if the state space consists of two components: 1) simOMPL.StateSpaceType.position2d and 2) simOMPL.StateSpaceType.joint_position, then the state is \(\left<p_x, p_y, p\right>\).

The path is simply the repetition of the

*n* states, i.e. \(\left<{p_x}^{(1)}, {p_y}^{(1)}, {p}^{(1)}, {p_x}^{(2)}, {p_y}^{(2)}, p^{(2)}, \ldots, {p_x}^{(n)}, {p_y}^{(n)}, {p}^{(n)}, \right>\).

You can use

`simOMPL.getPathStateCount(taskHandle,path)`

to get the number of states from the returned path, and

`simOMPL.getPathState(taskHandle,path,index)`

to extract the state at position

*index*.