All Packages  Class Hierarchy  This Package  Previous  Next  Index

Class EDU.gatech.cc.is.abstractrobot.MultiForageN150Hard

java.lang.Object
   |
   +----EDU.gatech.cc.is.abstractrobot.Simple
           |
           +----EDU.gatech.cc.is.abstractrobot.SimpleN150Hard
                   |
                   +----EDU.gatech.cc.is.abstractrobot.MultiForageN150Hard

public class MultiForageN150Hard
extends SimpleN150Hard
implements MultiForageN150
MultiForageN150Hard implements MultiForageN150 for Nomad 150 hardware using the Ndirect class. You should see the specifications in MultiForageN150 and Ndirect class documentation for details.

To reduce I/O between the controller and the robot, a thread is set up to perform periodic I/O. The sensor data and motor commands are exchanged through MultiForageN150Hard class variables (globals).

Copyright (c)1997, 1998 Tucker Balch

Version:
$Revision: 1.7 $
Author:
Tucker Balch
See Also:
MultiForageN150, Ndirect, Newton

Variable Index

 o gripper_finger
 o gripper_height
 o hard_command
 o newt
 o nt
 o old_gripper_finger
 o old_gripper_height
 o old_hard_command
 o trigger_mode

Constructor Index

 o MultiForageN150Hard(int, int)
Instantiate a MultiForageN150Hard object.

Method Index

 o broadcast(Message)
NOT IMPLEMENTED.
 o connected()
NOT IMPLEMENTED.
 o getObjectInGripper(long)
Get the kind of object in the gripper.
 o getOpponents(long)
NOT IMPLEMENTED.
 o getPlayerNumber(long)
NOT IMPLEMENTED.
 o getReceiveChannel()
NOT IMPLEMENTED.
 o getTeammates(long)
NOT IMPLEMENTED.
 o getVisualObjects(long, int)
Get an array of Vec2s that represent the locations of visually sensed objects egocentrically from center of the robot to the objects currently sensed by the vision system.
 o multicast(int[], Message)
NOT IMPLEMENTED.
 o run()
Body of the thread that conducts periodic I/O with the robot.
 o setCommunicationMaxRange(double)
NOT IMPLEMENTED.
 o setGripperFingers(long, double)
Set the gripper "finger" position from 0 to 1, with 0 being closed and 1 being open.
 o setGripperHeight(long, double)
Set the gripper height from 0 to 1, with 0 being down and 1 being up.
 o setKinMaxRange(double)
NOT IMPLEMENTED.
 o unicast(int, Message)
NOT IMPLEMENTED.

Variables

 o newt
 protected Newton newt
 o nt
 protected NewtonTrans nt
 o old_gripper_finger
 protected double old_gripper_finger
 o old_gripper_height
 protected double old_gripper_height
 o hard_command
 protected int hard_command
 o old_hard_command
 protected int old_hard_command
 o gripper_finger
 protected double gripper_finger
 o trigger_mode
 protected boolean trigger_mode
 o gripper_height
 protected double gripper_height

Constructors

 o MultiForageN150Hard
 public MultiForageN150Hard(int serial_port,
                            int baud) throws Exception
Instantiate a MultiForageN150Hard object. You should only instantiate one of these per robot connected to your computer. Standard call is MultiForageN150Hard(1,38400);

Parameters:
serial_port - 1 = ttys0 (COM1), 2 = ttys1 (COM2) ...
baud - baud rate for communication.
Throws: Exception
If unable to configure the hardware.

Methods

 o run
 public void run()
Body of the thread that conducts periodic I/O with the robot. It runs at most every MultiForageN150Hard.MIN_CYCLE_TIME milliseconds to gather sensor data from the robot, and issue movement commands.

 o getVisualObjects
 public Vec2[] getVisualObjects(long timestamp,
                                int channel)
Get an array of Vec2s that represent the locations of visually sensed objects egocentrically from center of the robot to the objects currently sensed by the vision system.

Parameters:
timestamp - only get new information if timestamp > than last call or timestamp == -1 .
channel - (1-6) which type/color of object to retrieve.
Returns:
the sensed objects.
 o getObjectInGripper
 public int getObjectInGripper(long timestamp)
Get the kind of object in the gripper.

Parameters:
timestamp - only get new information if timestamp > than last call or timestamp == -1 .
Returns:
channel (0-5) which type/color of object `in the gripper, -1 otherwise.
See Also:
getVisualObjects
 o setGripperFingers
 public void setGripperFingers(long time_stamp,
                               double position)
Set the gripper "finger" position from 0 to 1, with 0 being closed and 1 being open. In simulation, any setting less than 1 means closed.

Parameters:
position - the desired position from 0 to 1.
 o setGripperHeight
 public void setGripperHeight(long time_stamp,
                              double position)
Set the gripper height from 0 to 1, with 0 being down and 1 being up. In simulation this has no effect.

Parameters:
position - the desired position from 0 to 1.
 o getTeammates
 public Vec2[] getTeammates(long timestamp)
NOT IMPLEMENTED. Get an array of Vec2s that represent the locations of teammates (Kin).

Parameters:
timestamp - only get new information if timestamp > than last call or timestamp == -1.
Returns:
the sensed teammates.
See Also:
Vec2
 o getOpponents
 public Vec2[] getOpponents(long timestamp)
NOT IMPLEMENTED. Get an array of Vec2s that represent the locations of opponents.

Parameters:
timestamp - only get new information if timestamp > than last call or timestamp == -1.
Returns:
the sensed opponents.
See Also:
Vec2
 o getPlayerNumber
 public int getPlayerNumber(long timestamp)
NOT IMPLEMENTED. Get the robot's player number, between 0 and the number of robots on the team. Don't confuse this with getID which returns a unique number for the object in the simulation as a whole, not on its individual team.

Parameters:
timestamp - only get new information if timestamp > than last call or timestamp == -1.
Returns:
the player number.
 o setKinMaxRange
 public void setKinMaxRange(double r)
NOT IMPLEMENTED. Set the maximum range at which kin may be sensed. Primarily for use in simulation.

Parameters:
r - double, the maximum range.
 o broadcast
 public void broadcast(Message m)
NOT IMPLEMENTED. Broadcast a message to all teammates, except self.

Parameters:
m - Message, the message to be broadcast.
 o unicast
 public void unicast(int id,
                     Message m) throws CommunicationException
NOT IMPLEMENTED. Transmit a message to just one teammate. Transmission to self is allowed.

Parameters:
id - int, the ID of the agent to receive the message.
m - Message, the message to transmit.
Throws: CommunicationException
if the receiving agent does not exist.
 o multicast
 public void multicast(int ids[],
                       Message m) throws CommunicationException
NOT IMPLEMENTED. Transmit a message to specific teammates. Transmission to self is allowed.

Parameters:
ids - int[], the IDs of the agents to receive the message.
m - Message, the message to transmit.
Throws: CommunicationException
if one of the receiving agents does not exist.
 o getReceiveChannel
 public Enumeration getReceiveChannel()
NOT IMPLEMENTED. Get an enumeration of the incoming messages. The messages are automatically buffered by the implementation. Unless the implementation guarantees it, you cannot count on all messages being delivered. Example, to print all incoming messages:
 Transceiver c = new RobotComm();
 Enumeration r = c.getReceiveChannel();
 while (r.hasMoreElements())
      System.out.println(r.nextElement());
 

Returns:
the Enumeration.
 o setCommunicationMaxRange
 public void setCommunicationMaxRange(double r)
NOT IMPLEMENTED. Set the maximum range at which communication can occur. In simulation, this corresponds to a simulation of physical limits, on mobile robots it corresponds to a signal strength setting.

Parameters:
r - double, the maximum range.
 o connected
 public boolean connected()
NOT IMPLEMENTED.


All Packages  Class Hierarchy  This Package  Previous  Next  Index