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
-
MV_AC
- A control law for mv().
-
MV_IGNORE
- A control law for mv().
-
MV_LP
- A control law for mv().
-
MV_PR
- A control law for mv().
-
MV_PWM_HIGH_0
-
-
MV_PWM_HIGH_1
-
-
MV_PWM_HIGH_2
-
-
MV_PWM_HIGH_3
-
-
MV_PWM_LOW_0
-
-
MV_PWM_LOW_1
-
-
MV_PWM_LOW_2
-
-
MV_PWM_LOW_3
-
-
MV_SP
- A control law for mv().
-
MV_VM
- A control law for mv().
-
SERVO_CCW_TIME
- Time in microseconds for full CCW rotation of servo.
-
SERVO_CW_TIME
- Time in microseconds for full CW rotation of servo.
-
SERVO_TIME
- Time in microseconds for servo pulse.
-
Ndirect(int, int)
- Instantiate a nomad150.Ndirect object.
-
da(int, int)
- Defines the robot's steering and turret angles.
-
dp(int, int)
- Defines the position of the robot.
-
finalize()
- Dispose of a nomad150.Ndirect object.
-
get_bp()
- Reads the bumpers.
-
get_rc()
- Gets an update of the sonar, X, Y, turret and steering
data.
-
get_rv()
- Gets an update of the robot's translation, turret and steering
velocities.
-
get_sn(int[])
- Reads the sonars.
-
get_steering()
- Get the robot's steering heading, call get_rc() or mv() first
to ensure this data is current.
-
get_turret()
- Get the robot's turret heading, call get_rc() or mv() first
to ensure this data is current.
-
get_vsteering()
- Get the robot's steering velocity, call get_rv() or mv() first
to ensure this data is current.
-
get_vtranslation()
- Get the robot's translational velocity, call get_rv() or mv() first
to ensure this data is current.
-
get_vturret()
- Get the robot's turret velocity, call get_rv() or mv() first
to ensure this data is current.
-
get_x()
- Get the robot's X coordinate, call get_rc() or mv() first
to ensure this data is current.
-
get_y()
- Get the robot's Y coordinate, call get_rc() or mv() first
to ensure this data is current.
-
gs()
- Reads all the sensor data from the robot.
-
mv(int, int, int, int, int, int)
- Move the robot: translation, turret and steering all at once.
-
sn_off()
- Turns off the sonar range sensors
-
sn_on()
- Turns on the sonar range sensors.
-
sn_on(int)
- Turns on the sonar range sensors.
-
st()
- Stop the robot: translation, turret and steering all at once.
MV_IGNORE
public static final int MV_IGNORE
- A control law for mv().
- See Also:
- mv
MV_VM
public static final int MV_VM
- A control law for mv().
- See Also:
- mv
MV_PR
public static final int MV_PR
- A control law for mv().
- See Also:
- mv
MV_LP
public static final int MV_LP
- A control law for mv().
- See Also:
- mv
MV_AC
public static final int MV_AC
- A control law for mv().
- See Also:
- mv
MV_SP
public static final int MV_SP
- A control law for mv().
- See Also:
- mv
SERVO_TIME
public static final int SERVO_TIME
- Time in microseconds for servo pulse.
SERVO_CW_TIME
public static final int SERVO_CW_TIME
- Time in microseconds for full CW rotation of servo.
SERVO_CCW_TIME
public static final int SERVO_CCW_TIME
- Time in microseconds for full CCW rotation of servo.
MV_PWM_LOW_0
public static final int MV_PWM_LOW_0
MV_PWM_HIGH_0
public static final int MV_PWM_HIGH_0
MV_PWM_LOW_1
public static final int MV_PWM_LOW_1
MV_PWM_HIGH_1
public static final int MV_PWM_HIGH_1
MV_PWM_LOW_2
public static final int MV_PWM_LOW_2
MV_PWM_HIGH_2
public static final int MV_PWM_HIGH_2
MV_PWM_LOW_3
public static final int MV_PWM_LOW_3
MV_PWM_HIGH_3
public static final int MV_PWM_HIGH_3
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.
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
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.
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.
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.
st
public native int st()
- Stop the robot: translation, turret and steering all at once.
- Returns:
- 0 on success 1 otherwise.
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.
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.
sn_off
public native int sn_off()
- Turns off the sonar range sensors
- Returns:
- 0 on success 1 otherwise.
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
gs
public native int gs()
- Reads all the sensor data from the robot.
- Returns:
- 0 on success 1 otherwise.
- See Also:
- get_rc
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
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
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
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
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
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
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
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
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
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