aim4.vehicle
Class BasicAutoVehicle

java.lang.Object
  extended by aim4.vehicle.BasicVehicle
      extended by aim4.vehicle.BasicAutoVehicle
All Implemented Interfaces:
AutoVehicleDriverView, AutoVehicleSimView, VehicleDriverView, VehicleSimView
Direct Known Subclasses:
ProxyVehicle

public class BasicAutoVehicle
extends BasicVehicle
implements AutoVehicleSimView

The basic autonomous vehicle.


Nested Class Summary
 
Nested classes/interfaces inherited from class aim4.vehicle.BasicVehicle
BasicVehicle.AccelScheduleMovement, BasicVehicle.Movement, BasicVehicle.MovementFactory, BasicVehicle.MovementWithAccel, BasicVehicle.MoveToTargetVelocityMovement, BasicVehicle.NonAccelMovement, BasicVehicle.PhysicalMovement, BasicVehicle.SteeringMovement, BasicVehicle.TrackMovement
 
Nested classes/interfaces inherited from interface aim4.vehicle.AutoVehicleDriverView
AutoVehicleDriverView.LRFMode
 
Field Summary
protected  int bitsReceived
          The number of bits this Vehicle has received.
static double DEFAULT_TRANSMISSION_POWER
          The default distance the Vehicle can transmit messages.
 
Fields inherited from class aim4.vehicle.BasicVehicle
currentTime, movement, spec, vin
 
Constructor Summary
BasicAutoVehicle(VehicleSpec spec, Point2D pos, double heading, double steeringAngle, double velocity, double targetVelocity, double acceleration, double currentTime)
          Construct a vehicle
 
Method Summary
 int getBitsReceived()
          Get the number of bits this Vehicle has received.
 int getBitsTransmitted()
          Get the number of bits this Vehicle has transmitted.
 AutoDriver getDriver()
          Getter method for the Driver controlling this Vehicle.
 DoubleGauge getFrontVehicleDistanceSensor()
          Get this Vehicle's gauge of sensors about the distance, in meters, between p1 and p2, both of them are points on the target lane, where p1 is the point projected from the center of the front of the vehicle, and p2 is the nearest point of another vehicle in the front of the vehicle to p1 on the target lane.
 DoubleGauge getFrontVehicleSpeedSensor()
          Get this Vehicle's gauge of sensors about the speed, in meters per second, of the vehicle in front of the vehicle on the target lane.
 DoubleGauge getIntervalometer()
          Get this Vehicle's interval-to-vehicle-in-front gauge.
 V2IMessage getLastV2IMessage()
          Get the last V2I message
 DoubleGauge getLRFAngle()
          Get this Vehicle's laser range finder angle gauge.
 DoubleGauge getLRFDistance()
          Get this Vehicle's laser range finder distance gauge.
 AutoVehicleDriverView.LRFMode getLRFMode()
          Get the Vehicle's laser range finder operating mode.
 DoubleGauge getRearVehicleDistanceSensor()
          Get this Vehicle's gauge of sensors about the distance, in meters, between p1 and p2, both of them are points on the target lane, where p1 is the point projected from the center of the front of the vehicle, and p2 is the nearest point of another vehicle behind the vehicle to p1 on the target lane.
 DoubleGauge getRearVehicleSpeedSensor()
          Get this Vehicle's gauge of sensors about the speed, in meters per second, of the vehicle behind the vehicle on the target lane.
 Lane getTargetLaneForVehicleTracking()
          Return the target lane for vehicle tracking.
 double getTransmissionPower()
          Get the Vehicle's transmission power.
 Queue<V2IMessage> getV2IOutbox()
          Get the queue of V2I messages waiting to be delivered from this Vehicle.
 boolean isLRFSensing()
          Get whether or not the laser range finder is sensing anything.
 boolean isVehicleTracking()
          Get whether or not the vehicle tracking sensors are sensing anything.
 List<I2VMessage> pollAllMessagesFromI2VInbox()
          Get the list of all messages currently in the queue of I2V messages waiting to be read by this Vehicle.
 void receive(I2VMessage msg)
          Adds a message to the incoming queue of messages received from IntersectionManagers.
 void send(V2IMessage msg)
          Adds a message to the outgoing queue of messages to be delivered to an IntersectionManager.
 void setDriver(AutoDriver driver)
          Set this Vehicle's Driver.
 void setLRFMode(AutoVehicleDriverView.LRFMode mode)
          Set the Vehicle's laser range finder operating mode.
 void setLRFSensing(boolean sensing)
          Set whether or not the laser range finder is sensing anything.
 void setTargetLaneForVehicleTracking(Lane lane)
          Set the target lane for vehicle tracking.
 void setTransmissionPower(double transmissionPower)
          Set the Vehicle's transmission power.
 void setVehicleTracking(boolean sensing)
          Set whether or not the vehicle tracking sensors are sensing anything.
 
Methods inherited from class aim4.vehicle.BasicVehicle
checkCurrentTime, coast, finalize, gaugeCornerPoints, gaugeHeading, gaugePointAtMiddleFront, gaugePointAtRear, gaugePointBetweenFrontWheels, gaugePosition, gaugeRearLeftCornerPoint, gaugeRearRightCornerPoint, gaugeShape, gaugeTime, gaugeVelocity, getAcceleration, getAccelSchedule, getCenterPoint, getCornerPoints, getEdges, getHeading, getPointAtMiddleFront, getPointAtRear, getPosition, getShape, getShape, getSpec, getSteeringAngle, getVelocity, getVIN, getWheelShapes, move, printState, removeAccelSchedule, setAccelSchedule, setAccelWithMaxTargetVelocity, setMaxAccelWithMaxTargetVelocity, setTargetVelocityWithMaxAccel, setVIN, slowToStop, turnTowardPoint
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface aim4.vehicle.VehicleSimView
checkCurrentTime, getAcceleration, getCenterPoint, getCornerPoints, getEdges, getHeading, getPointAtMiddleFront, getPointAtRear, getPosition, getShape, getShape, getVelocity, getWheelShapes, move, setVIN
 
Methods inherited from interface aim4.vehicle.VehicleDriverView
coast, gaugeHeading, gaugePointAtMiddleFront, gaugePointAtRear, gaugePointBetweenFrontWheels, gaugePosition, gaugeRearLeftCornerPoint, gaugeRearRightCornerPoint, gaugeShape, gaugeTime, gaugeVelocity, getAccelSchedule, getSpec, getVIN, printState, removeAccelSchedule, setAccelSchedule, setAccelWithMaxTargetVelocity, setTargetVelocityWithMaxAccel, slowToStop, turnTowardPoint
 

Field Detail

DEFAULT_TRANSMISSION_POWER

public static final double DEFAULT_TRANSMISSION_POWER
The default distance the Vehicle can transmit messages. 250.0 meters.

See Also:
Constant Field Values

bitsReceived

protected int bitsReceived
The number of bits this Vehicle has received.

Constructor Detail

BasicAutoVehicle

public BasicAutoVehicle(VehicleSpec spec,
                        Point2D pos,
                        double heading,
                        double steeringAngle,
                        double velocity,
                        double targetVelocity,
                        double acceleration,
                        double currentTime)
Construct a vehicle

Parameters:
spec - the vehicle's specification
pos - the initial position of the Vehicle
heading - the initial heading of the Vehicle
steeringAngle - the initial steering angle of the Vehicle
velocity - the initial velocity of the Vehicle
targetVelocity - the initial target velocity
acceleration - the initial acceleration of the Vehicle
currentTime - the current time
Method Detail

getDriver

public AutoDriver getDriver()
Getter method for the Driver controlling this Vehicle.

Specified by:
getDriver in interface AutoVehicleDriverView
Specified by:
getDriver in interface VehicleDriverView
Specified by:
getDriver in class BasicVehicle
Returns:
the Driver controlling this Vehicle, or null if none exists.

setDriver

public void setDriver(AutoDriver driver)
Set this Vehicle's Driver.

Specified by:
setDriver in interface VehicleSimView
Parameters:
driver - the new driver to control this Vehicle

getIntervalometer

public DoubleGauge getIntervalometer()
Get this Vehicle's interval-to-vehicle-in-front gauge. This should only be followed by a call to read, except in the actual physical simulator which is allowed to set these values.

Specified by:
getIntervalometer in interface AutoVehicleDriverView
Returns:
the Vehicle's interval-to-vehicle-in-front gauge

setLRFMode

public void setLRFMode(AutoVehicleDriverView.LRFMode mode)
Set the Vehicle's laser range finder operating mode.

Parameters:
mode - the new laser range finder mode
See Also:
AutoVehicleDriverView.LRFMode

getLRFMode

public AutoVehicleDriverView.LRFMode getLRFMode()
Get the Vehicle's laser range finder operating mode.

Specified by:
getLRFMode in interface AutoVehicleDriverView
Returns:
the current operating mode of the laser range finder
See Also:
AutoVehicleDriverView.LRFMode

isLRFSensing

public boolean isLRFSensing()
Get whether or not the laser range finder is sensing anything.

Specified by:
isLRFSensing in interface AutoVehicleDriverView
Returns:
whether or not the laser range finder is sensing anything

setLRFSensing

public void setLRFSensing(boolean sensing)
Set whether or not the laser range finder is sensing anything. This should only be called by the actual physical simulator when it is providing sensing information to the Vehicle.

Specified by:
setLRFSensing in interface AutoVehicleSimView
Parameters:
sensing - whether or not the laser range finder is sensing anything

getLRFAngle

public DoubleGauge getLRFAngle()
Get this Vehicle's laser range finder angle gauge. This should only be followed by a call to read, except in the actual physical simulator which is allowed to set these values.

Returns:
the Vehicle's laser range finder angle gauge

getLRFDistance

public DoubleGauge getLRFDistance()
Get this Vehicle's laser range finder distance gauge. This should only be followed by a call to read, except in the actual physical simulator which is allowed to set these values.

Specified by:
getLRFDistance in interface AutoVehicleDriverView
Returns:
the Vehicle's laser range finder angle gauge

isVehicleTracking

public boolean isVehicleTracking()
Get whether or not the vehicle tracking sensors are sensing anything.

Specified by:
isVehicleTracking in interface AutoVehicleDriverView
Returns:
whether or not the vehicle tracking sensors are sensing anything

setVehicleTracking

public void setVehicleTracking(boolean sensing)
Set whether or not the vehicle tracking sensors are sensing anything.

Specified by:
setVehicleTracking in interface AutoVehicleDriverView
Parameters:
sensing - whether or not the vehicle tracking sensors are sensing anything

setTargetLaneForVehicleTracking

public void setTargetLaneForVehicleTracking(Lane lane)
Set the target lane for vehicle tracking.

Specified by:
setTargetLaneForVehicleTracking in interface AutoVehicleDriverView
Parameters:
lane - the target lane for vehicle tracking

getTargetLaneForVehicleTracking

public Lane getTargetLaneForVehicleTracking()
Return the target lane for vehicle tracking.

Specified by:
getTargetLaneForVehicleTracking in interface AutoVehicleDriverView
Returns:
the target lane for vehicle tracking

getFrontVehicleDistanceSensor

public DoubleGauge getFrontVehicleDistanceSensor()
Get this Vehicle's gauge of sensors about the distance, in meters, between p1 and p2, both of them are points on the target lane, where p1 is the point projected from the center of the front of the vehicle, and p2 is the nearest point of another vehicle in the front of the vehicle to p1 on the target lane. If there is no vehicle in the front on the target lane, the value should be Double.MAX_VALUE.

Specified by:
getFrontVehicleDistanceSensor in interface AutoVehicleDriverView
Returns:
the distance of the vehicle in the front on the target lane.

getRearVehicleDistanceSensor

public DoubleGauge getRearVehicleDistanceSensor()
Get this Vehicle's gauge of sensors about the distance, in meters, between p1 and p2, both of them are points on the target lane, where p1 is the point projected from the center of the front of the vehicle, and p2 is the nearest point of another vehicle behind the vehicle to p1 on the target lane. If there is no vehicle behind on the target lane, the value should be Double.MAX_VALUE.

Specified by:
getRearVehicleDistanceSensor in interface AutoVehicleDriverView
Returns:
the distance of the vehicle behind on the target lane.

getFrontVehicleSpeedSensor

public DoubleGauge getFrontVehicleSpeedSensor()
Get this Vehicle's gauge of sensors about the speed, in meters per second, of the vehicle in front of the vehicle on the target lane. If there is no vehicle in the front on the target lane, the value should be Double.MAX_VALUE.

Specified by:
getFrontVehicleSpeedSensor in interface AutoVehicleDriverView
Returns:
the speed of the vehicle in the front on the target lane.

getRearVehicleSpeedSensor

public DoubleGauge getRearVehicleSpeedSensor()
Get this Vehicle's gauge of sensors about the speed, in meters per second, of the vehicle behind the vehicle on the target lane. If there is no vehicle behind on the target lane, the value should be Double.MAX_VALUE.

Specified by:
getRearVehicleSpeedSensor in interface AutoVehicleDriverView
Returns:
the speed of the vehicle behind on the target lane.

setTransmissionPower

public void setTransmissionPower(double transmissionPower)
Set the Vehicle's transmission power.

Parameters:
transmissionPower - the new transmission power, in meters

getTransmissionPower

public double getTransmissionPower()
Get the Vehicle's transmission power.

Specified by:
getTransmissionPower in interface AutoVehicleDriverView
Returns:
the Vehicle's transmission power, in meters

getV2IOutbox

public Queue<V2IMessage> getV2IOutbox()
Get the queue of V2I messages waiting to be delivered from this Vehicle.

Specified by:
getV2IOutbox in interface VehicleSimView
Returns:
the queue of V2I messages to be delivered from this Vehicle

pollAllMessagesFromI2VInbox

public List<I2VMessage> pollAllMessagesFromI2VInbox()
Get the list of all messages currently in the queue of I2V messages waiting to be read by this Vehicle.

Specified by:
pollAllMessagesFromI2VInbox in interface AutoVehicleDriverView
Returns:
the list of all messages currently in the queue of I2V messages.

send

public void send(V2IMessage msg)
Adds a message to the outgoing queue of messages to be delivered to an IntersectionManager.

Specified by:
send in interface AutoVehicleDriverView
Parameters:
msg - the message to send to an IntersectionManager

receive

public void receive(I2VMessage msg)
Adds a message to the incoming queue of messages received from IntersectionManagers.

Specified by:
receive in interface AutoVehicleDriverView
Parameters:
msg - the message to send to another Vehicle

getBitsReceived

public int getBitsReceived()
Get the number of bits this Vehicle has received.

Specified by:
getBitsReceived in interface AutoVehicleDriverView
Returns:
the number of bits this Vehicle has received

getBitsTransmitted

public int getBitsTransmitted()
Get the number of bits this Vehicle has transmitted.

Specified by:
getBitsTransmitted in interface AutoVehicleDriverView
Returns:
the number of bits this Vehicle has transmitted

getLastV2IMessage

public V2IMessage getLastV2IMessage()
Get the last V2I message

Specified by:
getLastV2IMessage in interface AutoVehicleDriverView
Returns:
the last V2I message


Copyright © 2011. All Rights Reserved.