dLife Home Page

dlife.robot.scribbler
Class ScribblerDifferentialDrive

java.lang.Object
  extended by java.util.Observable
      extended by dlife.robot.Device
          extended by dlife.robot.DifferentialDriveEffector
              extended by dlife.robot.scribbler.ScribblerDifferentialDrive

public class ScribblerDifferentialDrive
extends DifferentialDriveEffector

A class for controlling the Scribbler's differential drive.

Version:
Mar 10, 2012
Author:
Grant Braught, Dickinson College

Field Summary
 
Fields inherited from class dlife.robot.DifferentialDriveEffector
vL, vR
 
Fields inherited from class dlife.robot.Device
DEFAULT_GUI_UPDATE_DELAY, DEFAULT_READ_DELAY, myRobot, readCount
 
Constructor Summary
ScribblerDifferentialDrive()
          Construct a new ScribblerDifferentialDrive object.
 
Method Summary
protected  DeviceDisplay[] createGUIObjects()
          Get the GUI Display for the ScribblerDifferentialDrive.
 int getOrientation()
          Returns the current orientation of the Scribbler as either Scribbler.FLUKE_AT_REAR or Scribbler.FLUKE_AT_FRONT.
 void readStateFromRobot()
          Does nothing.
 void setOrientation(int orientation)
          Set the orientation of the Scribbler.
protected  void setRobotWheelSpeeds(double left, double right)
          Set the wheel speeds of the Scribbler.
 void startUp()
          Initialize the Scribbler so that the Fluke is at the rear of the robot.
 
Methods inherited from class dlife.robot.DifferentialDriveEffector
freeze, getLeftWheelSpeed, getRightWheelSpeed, getRotation, getTranslation, move, rotate, setWheelSpeeds, shutDown, translate
 
Methods inherited from class dlife.robot.Device
getAutoRead, getGUI, getGUIUpdateDelay, getReadDelay, getRobot, getSensorReadCount, getSensorReadRate, setAutoRead, setGUIUpdateDelay, setReadDelay, setRobot, startAutoReadTimer, stopAutoReadTimer
 
Methods inherited from class java.util.Observable
addObserver, clearChanged, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, notifyObservers, setChanged
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ScribblerDifferentialDrive

public ScribblerDifferentialDrive()
Construct a new ScribblerDifferentialDrive object.

Method Detail

startUp

public void startUp()
Initialize the Scribbler so that the Fluke is at the rear of the robot.

Overrides:
startUp in class Device

setRobotWheelSpeeds

protected void setRobotWheelSpeeds(double left,
                                   double right)
Set the wheel speeds of the Scribbler. This method assumes that speed of each wheel is in the range [-1...+1] with -1 being full speed backward and +1 being full speed forward.

Specified by:
setRobotWheelSpeeds in class DifferentialDriveEffector
Parameters:
left - the rotational speed of the left wheel.
right - the rotational speed of the right wheel.

setOrientation

public void setOrientation(int orientation)
Set the orientation of the Scribbler. The orientation affects the interpretation of the motion commands to the Scribbler as well as the left-right ordering of many of the sensors.

If the orientation is FLUKE_AT_FRONT then positive translation values will move the robot forward with the fluke leading the way. In this orientation the obstacle and light sensors are rear-facing.

If the orientation is FLUKE_AT_REAR then positive translation values will move the robot with the fluke bringing up the rear. In this orientation

Parameters:
orientation - one of the constants FLUKE_AT_REAR or FLUKE_AT_FRONT indicating the orientation of the Scribbler.

getOrientation

public int getOrientation()
Returns the current orientation of the Scribbler as either Scribbler.FLUKE_AT_REAR or Scribbler.FLUKE_AT_FRONT.

Returns:
the orientation of the Scribbler.

readStateFromRobot

public void readStateFromRobot()
Does nothing. The Scribbler does not report back its wheel speeds so this class maintains them internally.

Specified by:
readStateFromRobot in class Device

createGUIObjects

protected DeviceDisplay[] createGUIObjects()
Get the GUI Display for the ScribblerDifferentialDrive.

Overrides:
createGUIObjects in class DifferentialDriveEffector
Returns:
the GUI display.

dLife Home Page