uwcse.location.objects.sick
Class LMS200Driver

java.lang.Object
  |
  +--com.intel.research.rain.Service
        |
        +--uwcse.location.LocationService
              |
              +--uwcse.location.FusionClientService
                    |
                    +--uwcse.location.objects.SensorDriver
                          |
                          +--uwcse.location.objects.sick.LMS200Driver
All Implemented Interfaces:
MessageHandler

public class LMS200Driver
extends SensorDriver

Driver for the SICK LMS200 series laser range finder.

Version:
$Revision: 1.2 $
Author:
Jeffrey Hightower

Nested Class Summary
 
Nested classes inherited from class uwcse.location.LocationService
LocationService.RediscoverServices
 
Field Summary
protected  String m_laserName
           
protected  LMS200Driver.LMSPanel m_lmsPanel
           
protected  boolean m_logLocal
           
protected  OutputStream m_outStream
           
protected  javax.comm.SerialPort m_serialPort
           
protected  LMSSerialPortThread m_serialPortThread
           
protected  int[] m_values
           
protected  ProducerConsumerQueue m_valuesQueue
           
protected  LMS200Driver.LMSValuesThread m_valuesThread
           
protected  JFrame m_visualFrame
           
 
Fields inherited from class uwcse.location.objects.SensorDriver
m_measurementSinkServiceIDSet, SINK_DISCOVERY_QUERY
 
Fields inherited from class uwcse.location.FusionClientService
FUSION_DISCOVERY_QUERY, m_fusionServiceIDSet
 
Fields inherited from class uwcse.location.LocationService
CONFIG_FILENAME, MESSAGE_ELEMENT, MESSAGE_EXTENSION, RPC_ELEMENT, RPC_EXCEPTION_ELEMENT, RPC_EXTENSION, RPC_RESULT_ELEMENT
 
Constructor Summary
LMS200Driver(String portName, String laserName, boolean logLocal)
          Create a LMS200Driver for the given serial port name.
 
Method Summary
protected  void closeSerialPort()
          Close serial port and remove the event listener.
 void finalize()
          Close the serial port if necessary before the object is reclaimed by the garbage collector.
protected  void handleTerminalCommand(String cmd)
          This routine is called to process command strings captured by runTerminalCommandLoop.
 void hideVisualization()
          Hide the visualization window.
static void main(String[] argv)
           
protected  void openSerialPort(String portName)
          Open the specified serial port at the given baud rate.
protected static void printUsageAndExit()
          Show the program argument usage and then exit.
 void showVisualization()
          Display the visualization window.
protected  void withdraw()
          Overridden to close the serial port if necessary before withdrawing from Rain.
 
Methods inherited from class uwcse.location.objects.SensorDriver
sendMeasurement
 
Methods inherited from class uwcse.location.FusionClientService
callFusionServiceRpc, getFusionServiceIDSet
 
Methods inherited from class uwcse.location.LocationService
addObject, callLocationRpc, correctedTimeMillis, getObject, getSysclockError, multicastLocationMsg, multicastLocationMsgs, processLocationMsg, processLocationRpc, runTerminalCommandLoop, sendLocationMsg, sendLocationMsgs, setDescription
 
Methods inherited from class com.intel.research.rain.Service
getDaemon, getDispatcher, getServiceID, process, receive, setDaemon
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

m_serialPortThread

protected LMSSerialPortThread m_serialPortThread

m_valuesThread

protected LMS200Driver.LMSValuesThread m_valuesThread

m_serialPort

protected javax.comm.SerialPort m_serialPort

m_outStream

protected OutputStream m_outStream

m_laserName

protected String m_laserName

m_logLocal

protected boolean m_logLocal

m_valuesQueue

protected ProducerConsumerQueue m_valuesQueue

m_visualFrame

protected JFrame m_visualFrame

m_lmsPanel

protected LMS200Driver.LMSPanel m_lmsPanel

m_values

protected int[] m_values
Constructor Detail

LMS200Driver

public LMS200Driver(String portName,
                    String laserName,
                    boolean logLocal)
             throws RainException,
                    LocationException,
                    IOException
Create a LMS200Driver for the given serial port name.

Throws:
RainException
LocationException
IOException
Method Detail

showVisualization

public void showVisualization()
Display the visualization window.


hideVisualization

public void hideVisualization()
Hide the visualization window.


openSerialPort

protected void openSerialPort(String portName)
                       throws javax.comm.NoSuchPortException,
                              javax.comm.PortInUseException,
                              IOException,
                              javax.comm.UnsupportedCommOperationException,
                              TooManyListenersException
Open the specified serial port at the given baud rate.

Throws:
javax.comm.NoSuchPortException
javax.comm.PortInUseException
IOException
javax.comm.UnsupportedCommOperationException
TooManyListenersException

closeSerialPort

protected void closeSerialPort()
Close serial port and remove the event listener.


withdraw

protected void withdraw()
Overridden to close the serial port if necessary before withdrawing from Rain.

Overrides:
withdraw in class SensorDriver

finalize

public void finalize()
Close the serial port if necessary before the object is reclaimed by the garbage collector.

Overrides:
finalize in class Object

handleTerminalCommand

protected void handleTerminalCommand(String cmd)
Description copied from class: LocationService
This routine is called to process command strings captured by runTerminalCommandLoop. Classes extending LocationService may handle any command strings they wish except 'quit' (case insensitive) is a reserved command that causes the shell to exit.

Overrides:
handleTerminalCommand in class LocationService
See Also:
LocationService.runTerminalCommandLoop()

printUsageAndExit

protected static void printUsageAndExit()
Show the program argument usage and then exit.


main

public static void main(String[] argv)


This documentation is for the Location Stack v0.8. The latest distribution, the documentation, and the list of contributors to the Location Stack can always be found at http://portolano.cs.washington.edu/projects/location/

© Copyright 2004 University of Washington CSE