Main Content

global2frenet

Convert global states to Frenet states

Description

frenetState = global2frenet(refPath,globalState) converts global states to Frenet trajectory states.

Input Arguments

collapse all

Reference path, specified as a referencePathFrenet object.

Trajectories in the global coordinate frame, specified as a P-by-6 numeric matrix with rows of form [x y theta kappa speed accel], where:

  • x y and theta –– SE(2) state expressed in global coordinates, with x and y in meters and theta in radians

  • kappa –– Curvature, or inverse of the radius, in meters

  • speed –– Speed in the theta direction in m/s

  • accel –– Acceleration in the theta direction in m/s2

P is the number of Frenet trajectories converted to global trajectories.

The absolute difference between theta and the orientation of the closest point on the path from a global state must not exceed pi/2 when converting between global and Frenet coordinate systems.

Output Arguments

collapse all

Trajectory in the Frenet coordinate frame, returned as a P-by-6 numeric matrix with rows of form [S dS ddS L dL ddL], where S is the arc length and L is the perpendicular deviation from the direction of the reference path. Derivatives of S are relative to time. Derivatives of L are relative to the arc length, S. P is the number of Frenet states specified.

Extended Capabilities

C/C++ Code Generation
Generate C and C++ code using MATLAB® Coder™.

Introduced in R2020b