CogniPilot

MODELICA LIBRARY · ENGINEERING REFERENCE

function

Planning.DubinsPolynomial.segmentStartPose

Nominal pose at the start of a Dubins segment

Public declarations

Explicit source declarations; dimensions, modifications and defaults are shown as written, without evaluation.

RoleNameTypeDimensions / attributes / defaultDescription
inputstartPositionReal[2]
inputstartHeadingReal
inputturnRadiusReal
inputpathTypePlanning.Dubins.PathType
inputnormalizedSegmentLengthReal[3]
inputsegmentIndexInteger(min=1, max=3)
outputposePlanning.Dubins.Pose

Modelica declarations and implementation

Show parameters, interfaces and source

Parameters, inputs, outputs, defaults and equations from the source file.

function segmentStartPose "Nominal pose at the start of a Dubins segment"
  input Real startPosition[2];
  input Real startHeading;
  input Real turnRadius;
  input Planning.Dubins.PathType pathType;
  input Real normalizedSegmentLength[3];
  input Integer segmentIndex(min=1, max=3);
  output Planning.Dubins.Pose pose;
protected
  Planning.Dubins.Pose nextPose;
algorithm
  pose.position := startPosition;
  pose.heading := startHeading;
  for precedingSegment in 1:segmentIndex - 1 loop
    nextPose := Planning.Dubins.advance(
      pose.position,
      pose.heading,
      Planning.Dubins.segmentType(pathType, precedingSegment),
      normalizedSegmentLength[precedingSegment],
      turnRadius);
    pose := nextPose;
  end for;
end segmentStartPose;