dLife Home Page

dlife.robot.pioneer
Class PioneerPTZ

java.lang.Object
  extended by java.util.Observable
      extended by dlife.robot.Device
          extended by dlife.robot.PanTiltZoomEffector
              extended by dlife.robot.pioneer.PioneerPTZ
Direct Known Subclasses:
CannonVCC50i

public abstract class PioneerPTZ
extends PanTiltZoomEffector

Abstract base class for all PTZ effectors for the Pioneer. This class provides the basic methods for controlling and accessing the pan, tilt and zoom. Concrete base classes for specific camera models may wish to add additional methods for model specific features.

NOTE: Pan and tilt positions for the Pioneer PTZ are set in degrees. For pan 0 degrees is directly forward with negative values being CW and positive values being CCW when looking down from above the robot. For tilt 0 degrees is horizontal with positive values being above horizontal and negative values being below horizontal. Zoom values are in arbitrary units with larger values indicating greater zoom.

Version:
Jun 20, 2008
Author:
Grant Braught, Dickinson College

Field Summary
 
Fields inherited from class dlife.robot.Device
DEFAULT_GUI_UPDATE_DELAY, DEFAULT_READ_DELAY, myRobot, readCount
 
Constructor Summary
PioneerPTZ()
          Construct a new PioneerPTZ.
 
Method Summary
 void freeze()
          Does nothing.
 double getPan()
          Get the pan setting.
 double getTilt()
          Get the tilt setting.
 double getZoom()
          Get the zoom setting.
 void pan(double newPan)
          Pan to the indicated position.
 void panTilt(double newPan, double newTilt)
          Set both the pan and tilt of the camera.
 void readStateFromRobot()
          Read the current pan, tilt and zoom values from the camera and cache them for use by the accessors.
 void tilt(double newTilt)
          Tilt to the indicated position.
 void zoom(double newZoom)
          Zoom to the indicated level.
 
Methods inherited from class dlife.robot.PanTiltZoomEffector
center, createGUIObjects, getCenterPan, getCenterTilt, getMaxPan, getMaxTilt, getMaxZoom, getMinPan, getMinTilt, getMinZoom, panTiltZoom, startUp
 
Methods inherited from class dlife.robot.Device
getAutoRead, getGUI, getGUIUpdateDelay, getReadDelay, getRobot, getSensorReadCount, getSensorReadRate, setAutoRead, setGUIUpdateDelay, setReadDelay, setRobot, shutDown, 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

PioneerPTZ

public PioneerPTZ()
Construct a new PioneerPTZ.

Method Detail

getPan

public double getPan()
Get the pan setting. Pan positions for the Pioneer are returned in degrees. Positive values are clockwise looking down on the robot from above.

Specified by:
getPan in class PanTiltZoomEffector
Returns:
the pan.

getTilt

public double getTilt()
Get the tilt setting. Tilt positions for the Pioneer are returned in degrees. Positive values are tilted up from horizontal.

Specified by:
getTilt in class PanTiltZoomEffector
Returns:
the tilt.

getZoom

public double getZoom()
Get the zoom setting. Zoom values for the Pioneer are returned in arbitrary zoom units with larger values indicating greater zoom.

Specified by:
getZoom in class PanTiltZoomEffector
Returns:
the zoom.

pan

public void pan(double newPan)
Pan to the indicated position. The position is relative to the values returned from getMinPan and getMaxPan.

Specified by:
pan in class PanTiltZoomEffector
Parameters:
newPan - the new pan position in degrees. Positive values are clockwise looking down on the robot from above.
Throws:
RobotCommunicationException - if unable to communicate with the Pioneer.

tilt

public void tilt(double newTilt)
Tilt to the indicated position. The position is relative to the values returned from getMinTilt and getMaxTilt.

Specified by:
tilt in class PanTiltZoomEffector
Parameters:
newTilt - the new tilt position in degrees. Positive values are tilted up from horizontal.
Throws:
RobotCommunicationException - if unable to communicate with the Pioneer.

zoom

public void zoom(double newZoom)
Zoom to the indicated level. The zoom is relative to the values returne from getMinZoom and getMaxZoom.

Specified by:
zoom in class PanTiltZoomEffector
Parameters:
newZoom - the new zoom. Zoom values are in arbitrary zoom units with larger values indicating greater zoom.
Throws:
RobotCommunicationException - if unable to communicate with the Pioneer.

panTilt

public void panTilt(double newPan,
                    double newTilt)
Set both the pan and tilt of the camera.

Specified by:
panTilt in class PanTiltZoomEffector
Parameters:
newPan - the new pan position in degrees. Positive values are clockwise looking down on the robot from above.
newTilt - the new tilt position in degrees. Positive values are tilted up from horizontal.
Throws:
RobotCommunicationException - if unable to communicate with the Pioneer.

readStateFromRobot

public void readStateFromRobot()
Read the current pan, tilt and zoom values from the camera and cache them for use by the accessors.

NOTE: The positions read will actually be the last positions requested. Thus if the camera is in motion the positions read may not be the current camera positions.

Specified by:
readStateFromRobot in class Device
Throws:
RobotCommunicationException - if unable to communicate with the Pioneer.

freeze

public void freeze()
Does nothing.

Specified by:
freeze in class Device

dLife Home Page