|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object
|
+--EDU.gatech.cc.is.abstractrobot.Simple
|
+--EDU.gatech.cc.is.abstractrobot.SimpleN150Hard
|
+--EDU.gatech.cc.is.abstractrobot.CommN150Hard
CommN150Hard implements SimpleN150 for Nomad 150 hardware using the Ndirect class. You should see the specifications in SimpleN150 and Ndirect class documentation for details.
Copyright (c)1998 Tucker Balch
CommN150,
Ndirect| Field Summary | |
protected Vec2[] |
last_opponents
|
protected Vec2[] |
last_teammates
|
protected CircularBufferEnumeration |
rec_positions
Channel for recieving other robot positions. |
protected TransceiverHard |
t
The transceiver used to communicate with the rest of the robots. |
| Fields inherited from class EDU.gatech.cc.is.abstractrobot.SimpleN150Hard |
base_speed,
cycles,
DEBUG,
desired_heading,
desired_speed,
hard_command,
in_reverse,
keep_running,
last_Obstacles,
last_Position,
last_SteerHeading,
last_TurretHeading,
nomad150_hardware,
num_Obstacles,
obstacle_rangeInch,
old_desired_heading,
old_desired_turret_heading,
old_hard_command,
run_time_sum,
sonar_raw_data,
time_sum |
| Fields inherited from class EDU.gatech.cc.is.abstractrobot.Simple |
dictionary,
displayVectors,
unique_id |
| Fields inherited from interface EDU.gatech.cc.is.abstractrobot.SimpleN150 |
MAX_STEER,
MAX_TRANSLATION,
MAX_TURRET,
RADIUS,
SONAR_RADIUS |
| Constructor Summary | |
CommN150Hard(int serial_port,
int baud,
java.lang.String server,
int id)
Instantiate a CommN150Hard object. |
|
| Method Summary | |
void |
broadcast(Message m)
Broadcast a message to all teammates, except self. |
boolean |
connected()
Check to see if the transceiver is connected to the server. |
java.awt.Color |
getBackgroundColor()
Gets the background color of the robot. |
java.awt.Color |
getForegroundColor()
Gets the foreground color of the robot. |
Vec2[] |
getOpponents(long timestamp)
Get an array of Vec2s that represent the locations of opponents. |
int |
getPlayerNumber(long timestamp)
Get the robot's player number, between 0 and the number of robots on the team. |
CircularBufferEnumeration |
getReceiveChannel()
Get an enumeration of the incoming messages. |
Vec2[] |
getTeammates(long timestamp)
Get an array of Vec2s that represent the locations of teammates (Kin). |
void |
multicast(int[] ids,
Message m)
Transmit a message to specific teammates. |
void |
setCommunicationMaxRange(double r)
Set the maximum range at which communication can occur. |
void |
setKinMaxRange(double r)
NOT IMPLEMENTED Set the maximum range at which kin may be sensed. |
void |
takeStep()
Conduct periodic I/O with the robot. |
void |
unicast(int id,
Message m)
Transmit a message to just one teammate. |
| Methods inherited from class EDU.gatech.cc.is.abstractrobot.SimpleN150Hard |
getObstacles,
getPosition,
getSteerHeading,
getTime,
getTurretHeading,
quit,
resetPosition,
resetSteerHeading,
resetTurretHeading,
setBaseSpeed,
setDisplayString,
setObstacleMaxRange,
setSpeed,
setSteerHeading,
setTurretHeading |
| Methods inherited from class EDU.gatech.cc.is.abstractrobot.Simple |
getDictionary,
getID,
getID,
setDictionary,
setID |
| Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
| Field Detail |
protected TransceiverHard t
protected CircularBufferEnumeration rec_positions
protected Vec2[] last_teammates
protected Vec2[] last_opponents
| Constructor Detail |
public CommN150Hard(int serial_port,
int baud,
java.lang.String server,
int id)
throws java.lang.Exception
serial_port - 1 = ttys0 (COM1), 2 = ttys1 (COM2) ...baud - baud rate for communication.| Method Detail |
public void takeStep()
public Vec2[] getTeammates(long timestamp)
timestamp - only get new information if
timestamp > than last call or timestamp == -1.Vec2public Vec2[] getOpponents(long timestamp)
timestamp - only get new information if
timestamp > than last call or timestamp == -1.Vec2public int getPlayerNumber(long timestamp)
timestamp - only get new information if
timestamp > than last call or timestamp == -1.public void setKinMaxRange(double r)
r - double, the maximum range.public void broadcast(Message m)
m - Message, the message to be broadcast.
public void unicast(int id,
Message m)
throws CommunicationException
id - int, the ID of the agent to receive the message.m - Message, the message to transmit.
public void multicast(int[] ids,
Message m)
throws CommunicationException
ids - int[], the IDs of the agents to receive the message.m - Message, the message to transmit.public CircularBufferEnumeration getReceiveChannel()
Transceiver c = new RobotComm();
CircularBufferEnumeration r = c.getReceiveChannel();
while (r.hasMoreElements())
System.out.println(r.nextElement());
public void setCommunicationMaxRange(double r)
r - double, the maximum range.public boolean connected()
public java.awt.Color getForegroundColor()
public java.awt.Color getBackgroundColor()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||