org.mbari.siam.foce.utils
Class FOCEMotorUtil

java.lang.Object
  extended by org.mbari.siam.foce.utils.FOCEMotorUtil

public class FOCEMotorUtil
extends java.lang.Object


Field Summary
protected  java.lang.Boolean _aftMotorEnable
          aft motor enable
protected  java.lang.String _aftMotorPort
          forward motor serial port path
protected  java.lang.Double _aftMotorRPM
          aft motor speed (RPM)
protected  int _countsPerRevolution
          Number of counts per motor revolution
protected  java.lang.Boolean _forwardMotorEnable
          forward motor enable
protected  java.lang.String _forwardMotorPort
          forward motor serial port path
protected  java.lang.Double _forwardMotorRPM
          forward motor speed (RPM)
protected static org.apache.log4j.Logger _log4j
           
protected  int ACCELERATION
          Motor acceleration value (counts/second^2)
protected static java.lang.String AFT_MOTOR_PORT
          Default aft controller serial port
protected  int DECELERATION
          Motor deceleration value (counts/second^2)
protected static java.lang.String FORWARD_MOTOR_PORT
          Default forward controller serial port
 double GEAR_RATIO
          Gear ratio between motor and thrusters.
protected  boolean setUnitMode
          set UnitMode during controller initialization (stops motor)
protected  boolean useShaftSpeed
          interpret specified speed as shaft speed
protected  boolean VERBOSE
          Verbose output flag
 
Constructor Summary
FOCEMotorUtil()
          Contstructor
 
Method Summary
 void configurePorts(java.lang.String forwardPort, java.lang.String aftPort)
          Configure the serial ports used to communicate with the motor controllers.
protected  void initializeController(ElmoSolo controller)
          Initialize the specified motor controller.
static void main(java.lang.String[] args)
          Main entry point.
 void printUsage()
          Print application-specific usage message to stdout.
 void processArguments(java.lang.String[] args)
          Process command line options.
 int run()
          Perform the actions indicated on the command line.
 void setEnable(ElmoSolo motor, boolean value, long timeoutMsec)
          Enable or disable the motor.
 void setVelocity(ElmoSolo motor, double rpm)
          Command motor velocity (in rpm) fulfills MotorControlIF interface
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

_log4j

protected static org.apache.log4j.Logger _log4j

GEAR_RATIO

public double GEAR_RATIO
Gear ratio between motor and thrusters.


FORWARD_MOTOR_PORT

protected static final java.lang.String FORWARD_MOTOR_PORT
Default forward controller serial port

See Also:
Constant Field Values

AFT_MOTOR_PORT

protected static final java.lang.String AFT_MOTOR_PORT
Default aft controller serial port

See Also:
Constant Field Values

VERBOSE

protected boolean VERBOSE
Verbose output flag


ACCELERATION

protected int ACCELERATION
Motor acceleration value (counts/second^2)


DECELERATION

protected int DECELERATION
Motor deceleration value (counts/second^2)


_countsPerRevolution

protected int _countsPerRevolution
Number of counts per motor revolution


_forwardMotorRPM

protected java.lang.Double _forwardMotorRPM
forward motor speed (RPM)


_forwardMotorEnable

protected java.lang.Boolean _forwardMotorEnable
forward motor enable


_aftMotorRPM

protected java.lang.Double _aftMotorRPM
aft motor speed (RPM)


_aftMotorEnable

protected java.lang.Boolean _aftMotorEnable
aft motor enable


_forwardMotorPort

protected java.lang.String _forwardMotorPort
forward motor serial port path


_aftMotorPort

protected java.lang.String _aftMotorPort
forward motor serial port path


useShaftSpeed

protected boolean useShaftSpeed
interpret specified speed as shaft speed


setUnitMode

protected boolean setUnitMode
set UnitMode during controller initialization (stops motor)

Constructor Detail

FOCEMotorUtil

public FOCEMotorUtil()
Contstructor

Method Detail

printUsage

public void printUsage()
Print application-specific usage message to stdout.


processArguments

public void processArguments(java.lang.String[] args)
Process command line options.

Parameters:
args - command line arguments

configurePorts

public void configurePorts(java.lang.String forwardPort,
                           java.lang.String aftPort)
Configure the serial ports used to communicate with the motor controllers.


initializeController

protected void initializeController(ElmoSolo controller)
Initialize the specified motor controller.

Parameters:
controller - ElmoSolo motor controller to initialize

setEnable

public void setEnable(ElmoSolo motor,
                      boolean value,
                      long timeoutMsec)
               throws TimeoutException
Enable or disable the motor. fulfills MotorControlIF interface

Parameters:
motor - motor controller to enable
value - enable if trye, disable if false
timeoutMsec - timeout (milliseconds)
Throws:
TimeoutException

setVelocity

public void setVelocity(ElmoSolo motor,
                        double rpm)
Command motor velocity (in rpm) fulfills MotorControlIF interface

Parameters:
motor - motor controller to enable
rpm - motor speed to set (RPM)

run

public int run()
Perform the actions indicated on the command line.

Returns:
0 on success

main

public static void main(java.lang.String[] args)
Main entry point.

Parameters:
args - command line arguments


Copyright © 2003 MBARI.

The Monterey Bay Aquarium Research Institute (MBARI) provides this documentation and code "as is", with no warranty, express or implied, of its quality or consistency. It is provided without support and without obligation on the part of MBARI to assist in its use, correction, modification, or enhancement.