function
Planning.DubinsPolynomial.nominalCurvature
Signed curvature of a nominal Dubins segment
Public declarations
Explicit source declarations; dimensions, modifications and defaults are shown as written, without evaluation.
| Role | Name | Type | Dimensions / attributes / default | Description |
|---|---|---|---|---|
| input | pathType | Planning.Dubins.PathType | | |
| input | segmentIndex | Integer | (min=1, max=3) | |
| input | turnRadius | Real | | |
| output | curvature | Real | |
Modelica declarations and implementation
Show parameters, interfaces and source
Parameters, inputs, outputs, defaults and equations from the source file.
function nominalCurvature "Signed curvature of a nominal Dubins segment"
input Planning.Dubins.PathType pathType;
input Integer segmentIndex(min=1, max=3);
input Real turnRadius;
output Real curvature;
protected
Planning.Dubins.SegmentType kind;
algorithm
assert(turnRadius > 0.0, "Dubins turn radius must be positive");
kind := Planning.Dubins.segmentType(pathType, segmentIndex);
curvature := if kind == Planning.Dubins.SegmentType.left then 1.0 / turnRadius
else if kind == Planning.Dubins.SegmentType.right then -1.0 / turnRadius
else 0.0;
end nominalCurvature;