All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class EDU.gatech.cc.is.nomad150.Ndirect

java.lang.Object
   |
   +----EDU.gatech.cc.is.nomad150.Ndirect

public class Ndirect
extends Object
Introduction
Provides an interface to the Nomadics Technologies control library for a Nomad 150 robot. It provides a slightly higher-level interface than the C library functions provided by Nomadics. See the Nomadic's Language Reference Manual for details.

Two demonstration/debugging applications are also provided: Nomad150TestTriangle and Nomad150TestSensors. Nomad150TestTriangle drives the robot around in a 5 foot triange, while Nomad150TestSensors prints out detected sensor values. See documentation for them by clicking on the appropriate link below.

Version:
$revision$
Author:
(c) 1997, 1998 Tucker Balch, tucker@cc.gatech.edu
See Also:
Nomad150TestTriangle, Nomad150TestSensors

Variable Index

 o MV_AC
A control law for mv().
 o MV_IGNORE
A control law for mv().
 o MV_LP
A control law for mv().
 o MV_PR
A control law for mv().
 o MV_PWM_HIGH_0
 o MV_PWM_HIGH_1
 o MV_PWM_HIGH_2
 o MV_PWM_HIGH_3
 o MV_PWM_LOW_0
 o MV_PWM_LOW_1
 o MV_PWM_LOW_2
 o MV_PWM_LOW_3
 o MV_SP
A control law for mv().
 o MV_VM
A control law for mv().
 o SERVO_CCW_TIME
Time in microseconds for full CCW rotation of servo.
 o SERVO_CW_TIME
Time in microseconds for full CW rotation of servo.
 o SERVO_TIME
Time in microseconds for servo pulse.

Constructor Index

 o Ndirect(int, int)
Instantiate a nomad150.Ndirect object.

Method Index

 o da(int, int)
Defines the robot's steering and turret angles.
 o dp(int, int)
Defines the position of the robot.
 o finalize()
Dispose of a nomad150.Ndirect object.
 o get_bp()
Reads the bumpers.
 o get_rc()
Gets an update of the sonar, X, Y, turret and steering data.
 o get_rv()
Gets an update of the robot's translation, turret and steering velocities.
 o get_sn(int[])
Reads the sonars.
 o get_steering()
Get the robot's steering heading, call get_rc() or mv() first to ensure this data is current.
 o get_turret()
Get the robot's turret heading, call get_rc() or mv() first to ensure this data is current.
 o get_vsteering()
Get the robot's steering velocity, call get_rv() or mv() first to ensure this data is current.
 o get_vtranslation()
Get the robot's translational velocity, call get_rv() or mv() first to ensure this data is current.
 o get_vturret()
Get the robot's turret velocity, call get_rv() or mv() first to ensure this data is current.
 o get_x()
Get the robot's X coordinate, call get_rc() or mv() first to ensure this data is current.
 o get_y()
Get the robot's Y coordinate, call get_rc() or mv() first to ensure this data is current.
 o gs()
Reads all the sensor data from the robot.
 o mv(int, int, int, int, int, int)
Move the robot: translation, turret and steering all at once.
 o sn_off()
Turns off the sonar range sensors
 o sn_on()
Turns on the sonar range sensors.
 o sn_on(int)
Turns on the sonar range sensors.
 o st()
Stop the robot: translation, turret and steering all at once.

Variables

 o MV_IGNORE
 public static final int MV_IGNORE
A control law for mv().

See Also:
mv
 o MV_VM
 public static final int MV_VM
A control law for mv().

See Also:
mv
 o MV_PR
 public static final int MV_PR
A control law for mv().

See Also:
mv
 o MV_LP
 public static final int MV_LP
A control law for mv().

See Also:
mv
 o MV_AC
 public static final int MV_AC
A control law for mv().

See Also:
mv
 o MV_SP
 public static final int MV_SP
A control law for mv().

See Also:
mv
 o SERVO_TIME
 public static final int SERVO_TIME
Time in microseconds for servo pulse.

 o SERVO_CW_TIME
 public static final int SERVO_CW_TIME
Time in microseconds for full CW rotation of servo.

 o SERVO_CCW_TIME
 public static final int SERVO_CCW_TIME
Time in microseconds for full CCW rotation of servo.

 o MV_PWM_LOW_0
 public static final int MV_PWM_LOW_0
 o MV_PWM_HIGH_0
 public static final int MV_PWM_HIGH_0
 o MV_PWM_LOW_1
 public static final int MV_PWM_LOW_1
 o MV_PWM_HIGH_1
 public static final int MV_PWM_HIGH_1
 o MV_PWM_LOW_2
 public static final int MV_PWM_LOW_2
 o MV_PWM_HIGH_2
 public static final int MV_PWM_HIGH_2
 o MV_PWM_LOW_3
 public static final int MV_PWM_LOW_3
 o MV_PWM_HIGH_3
 public static final int MV_PWM_HIGH_3

Constructors

 o Ndirect
 public Ndirect(int serial_port,
                int baud) throws Exception
Instantiate a nomad150.Ndirect object. You should only instantiate one of these per robot connected to your computer. Configures the robot with default values with calls to zr(), ac(), conf_sn() conf_tm(). Standard call is Ndirect(1,38400);

Parameters:
serial_port - 1 = ttys0 (COM1), 2 = ttys1 (COM2) ...
baud - baud rate for communication.
Throws: Exception
If unable to make native code resident.

Methods

 o finalize
 protected void finalize() throws Exception, Throwable
Dispose of a nomad150.Ndirect object. You should never call this, the garbage collector calls it.

Throws: Exception
If unable to release code resources.
Throws: Throwable
If super.finalize() throws it.
Overrides:
finalize in class Object
 o da
 public native int da(int th,
                      int tu)
Defines the robot's steering and turret angles.

Parameters:
th - steering orientation.
tu - turret orientation.
Returns:
0 on success 1 otherwise.
 o dp
 public native int dp(int x,
                      int y)
Defines the position of the robot.

Parameters:
x - the X coordinate.
y - the Y coordinate.
Returns:
0 on success 1 otherwise.
 o mv
 public native int mv(int t_mode,
                      int t_mv,
                      int s_mode,
                      int s_mv,
                      int r_mode,
                      int r_mv)
Move the robot: translation, turret and steering all at once. The arguments are passed directly to Nomadics mv(). The control law for each axis must be MV_VM, MV_PR, MV_IGNORE, MV_LP, MV_SP or MV_AC. See Nomadic's Language Reference Manual for details.

Parameters:
t_mode - control law for translation.
t_mv - motion value for translation.
s_mode - control law for steering.
s_mv - motion value for steering.
r_mode - control law for turret.
r_mv - motion value for turret.
Returns:
0 on success 1 otherwise.
 o st
 public native int st()
Stop the robot: translation, turret and steering all at once.

Returns:
0 on success 1 otherwise.
 o sn_on
 public native int sn_on(int delay)
Turns on the sonar range sensors. Calls Nomadics conf_sn with a standard sonar firing order.

Parameters:
delay - The time between sonar firing in milliseconds. The minimum is 60.
Returns:
0 on success 1 otherwise.
 o sn_on
 public int sn_on()
Turns on the sonar range sensors. Calls Nomadics conf_sn with a standard sonar firing order. Calls sn_on(60)

Returns:
0 on success 1 otherwise.
 o sn_off
 public native int sn_off()
Turns off the sonar range sensors

Returns:
0 on success 1 otherwise.
 o get_sn
 public native int get_sn(int readings[])
Reads the sonars. The readings are in inches from the sonar "skin." The sonars are arranged in 22.5 degree increments CCW from 0 to 15. The data is refreshed either by a move command or a call to get_rc().

Parameters:
readings - The sonar readings will be read into this array. It must contain at least 16 elemements.
Returns:
0 on success 1 otherwise.
See Also:
get_rc
 o gs
 public native int gs()
Reads all the sensor data from the robot.

Returns:
0 on success 1 otherwise.
See Also:
get_rc
 o get_bp
 public native long get_bp()
Reads the bumpers. The data is refreshed either by a move command or a call to get_rc().

Returns:
the bumper data.
See Also:
get_rc
 o get_rc
 public native int get_rc()
Gets an update of the sonar, X, Y, turret and steering data. This method does not actually return this data, you have to call one of the various accessor functions to get it.

Returns:
0 on success 1 otherwise.
See Also:
get_x, get_y, get_steering, get_turret
 o get_x
 public native int get_x()
Get the robot's X coordinate, call get_rc() or mv() first to ensure this data is current.

Returns:
the X coordinate in tenths of an inch.
See Also:
get_rc
 o get_y
 public native int get_y()
Get the robot's Y coordinate, call get_rc() or mv() first to ensure this data is current.

Returns:
the Y coordinate in tenths of an inch.
See Also:
get_rc
 o get_steering
 public native int get_steering()
Get the robot's steering heading, call get_rc() or mv() first to ensure this data is current.

Returns:
the steering heading in tenths of a degree.
See Also:
get_rc
 o get_turret
 public native int get_turret()
Get the robot's turret heading, call get_rc() or mv() first to ensure this data is current.

Returns:
the turret heading in tenths of a degree.
See Also:
get_rc
 o get_rv
 public native int get_rv()
Gets an update of the robot's translation, turret and steering velocities. This method does not actually return this data, you have to call the various accessor functions to get it.

Returns:
0 on success 1 otherwise.
See Also:
get_vtranslation, get_vsteering, get_vturret
 o get_vtranslation
 public native int get_vtranslation()
Get the robot's translational velocity, call get_rv() or mv() first to ensure this data is current.

Returns:
the translational velocity in tenths of an inch/s.
See Also:
get_rv
 o get_vturret
 public native int get_vturret()
Get the robot's turret velocity, call get_rv() or mv() first to ensure this data is current.

Returns:
the turret velocity in tenths of a degree/s.
See Also:
get_rv
 o get_vsteering
 public native int get_vsteering()
Get the robot's steering velocity, call get_rv() or mv() first to ensure this data is current.

Returns:
the steering velocity in tenths of a degree/s.
See Also:
get_rv

All Packages  Class Hierarchy  This Package  Previous  Next  Index