AutomobilePassing:
--------------------------------------------------------------------------
Implements passing control by pointing the wheels at the target.
Generates a steering angle demand and torque demand.
Prior to passing the passState is 0. During the passing it is 1.
When it returns to its original lane the state is set to 0.
--------------------------------------------------------------------------
Form:
passer = AutomobilePassing( passer, passee, dY, dV, dX, gain )
--------------------------------------------------------------------------
------
Inputs
------
passer (1,1) Car data structure
.mass (1,1) Mass (kg)
.delta (1,1) Steering angle (rad)
.r (2,4) Position of wheels (m)
.cD (1,1) Drag coefficient
.cF (1,1) Friction coefficient
.torque (1,1) Motor torque (Nm)
.area (1,1) Frontal area for drag (m^2)
.x (6,1) [x;y;vX;vZ;theta;omega]
.errOld (1,1) Old position error
.passState (1,1) State of passing maneuver
passee (1,1) Car data structure
dY (1,1) Relative position in y
dV (1,1) Relative velocity in x
dX (1,1) Relative position in x
gain (1,3) Gains [position velocity position derivative]
-------
Outputs
-------
passer (1,1) Car data structure with updated fields:
.passState
.delta
.errOld
.torque
--------------------------------------------------------------------------