public abstract class UgvController extends VehicleController
Modifier and Type | Field and Description |
---|---|
protected double |
alongTrackRange
along track range remaining to reach goal point
|
protected boolean |
closedLoopSpeed
set to true if speed is commanded as MPS or knots (false means trackSpeed is directly controlled)
|
protected double |
commandedSpeed
Commanded speed in MPS (if closed-loop speed is specified)
|
protected boolean |
controlledPsi
true if heading is automatically controlled
|
protected boolean |
correctToTrack
set to true if waypoint will follow a specified track to the waypoint (false is continuous to)
|
protected double |
crossTrackError
lateral displacement from a commanded track
|
protected double |
leftTrackCommand
commanded speed of the left track in meters per second
|
protected double |
maxTrackDif
Used to make sure the track commands don't cause too high a turn rate
|
protected double |
offTrackAngleDegrees
angle computed from arc tangent of alongTrackRange and crossTrackError
|
protected double |
psiCommand
commanded heading -- may or may not be relevant for individual inheriting control modes
|
protected double |
rightTrackCommand
commanded speed of the right track in meters per second
|
protected UgvExecution |
ugvExecution
reference to main class of this ugv
|
Constructor and Description |
---|
UgvController(UgvExecution execution)
Creates a new instance of Controller
|
Modifier and Type | Method and Description |
---|---|
abstract void |
computeControls()
computes ugvExecution controls based on type of controller and current state/command
|
protected void |
computeControls(double psiError)
Used by all of the controllers to compute left and right track settings
when heading is being controlled explicitly
|
void |
setControls()
uses the computed control settings to actually set the vehicle's controls
|
void |
setOpenLoopPsi()
Sets a new open-loop heading
|
void |
setPsiCommand(double newPsi)
Sets a new closed-loop heading
|
void |
setSpeed(double newSpeed)
Sets a new closed-loop speed
|
void |
setTrackSpeed(double newSpeed)
Sets a new open-loop track speed
|
void |
setTrackSpeed(double newLeftTrackSpeed,
double newRightTrackSpeed)
Sets a new open-loop track speed
|
protected void |
updateCrossTrackError()
Determines how far left or right of intended track the vehicle is and
modifies the heading command accordingly
|
protected UgvExecution ugvExecution
protected double leftTrackCommand
protected double rightTrackCommand
protected boolean controlledPsi
protected double psiCommand
protected double crossTrackError
protected double alongTrackRange
protected double offTrackAngleDegrees
protected boolean correctToTrack
protected boolean closedLoopSpeed
protected double commandedSpeed
protected double maxTrackDif
public UgvController(UgvExecution execution)
execution
- instance of TrackedUgvExecutionpublic void setSpeed(double newSpeed)
newSpeed
- public void setTrackSpeed(double newSpeed)
newSpeed
- public void setTrackSpeed(double newLeftTrackSpeed, double newRightTrackSpeed)
newLeftTrackSpeed
- newRightTrackSpeed
- public void setPsiCommand(double newPsi)
newPsi
- public void setOpenLoopPsi()
public abstract void computeControls()
protected void updateCrossTrackError()
protected void computeControls(double psiError)
psiError
- public void setControls()