dLife Home Page

dlife.robot.hemisson
Class HemissonDifferentialDrive

java.lang.Object
  extended by java.util.Observable
      extended by dlife.robot.Device
          extended by dlife.robot.DifferentialDriveEffector
              extended by dlife.robot.hemisson.HemissonDifferentialDrive

public class HemissonDifferentialDrive
extends DifferentialDriveEffector

A class to control the motion of the Hemisson robot. Note: Significant and sudden changes in the Hemisson's motion (e.g. translation value changing from -1 to 1) required significant power from the battery and can cause a loss of communication with the robot.

Version:
Jun 8, 2008
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
HemissonDifferentialDrive()
          Construct a new HemissonDifferentialDrive.
 
Method Summary
static void main(String[] args)
          A little main method that lets a Hemisson be driven around using the control.
 void readStateFromRobot()
          Does nothing.
protected  void setRobotWheelSpeeds(double left, double right)
          Send a message to the Hemisson to set the speeds of its wheels according to the specified speeds.
 
Methods inherited from class dlife.robot.DifferentialDriveEffector
createGUIObjects, 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, startUp, 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

HemissonDifferentialDrive

public HemissonDifferentialDrive()
Construct a new HemissonDifferentialDrive.

Method Detail

readStateFromRobot

public void readStateFromRobot()
Does nothing. The Hemisson does not report the wheel speeds so we just rely on the values cached by the DifferentialDriveEffector class.

Specified by:
readStateFromRobot in class Device

setRobotWheelSpeeds

protected void setRobotWheelSpeeds(double left,
                                   double right)
Send a message to the Hemisson to set the speeds of its wheels according to the specified speeds. The provided speeds should be in the range [-1...1]. Values not in this range will be bounded to this range.

Note that the physical Hemisson accepts wheel speeds in the range [-9...9]. Thus, the provided speeds will be scaled by a factor of 9 before being sent to the actual robot.

Specified by:
setRobotWheelSpeeds in class DifferentialDriveEffector
Parameters:
left - the speed of the left wheel.
right - the speed of the right wheel.
Throws:
RobotCommunicationException - if unable to communicate with the Hemisson.

main

public static void main(String[] args)
                 throws Exception
A little main method that lets a Hemisson be driven around using the control.

Parameters:
args - none
Throws:
Exception

dLife Home Page