CS395T: Autonomous Robots -- UTAssist Information

CS395T: Autonomous Robots -- UTAssist Information


Note: This page is copied directly from our team's resource page. It may be outdated, but I hope it will be helpful anyway.

UTAssist

UTAssist is composed of a bunch of pieces of software that work together to get information off of the Aibo and display it to a user on some computer. There are two main pieces of UTAssist:


The Server

The UTAssist server is written in Java and is located in the CVS at team/utils/UTAssist. To run the server, you should make sure you CLASSPATH environment variable includes the following:

 /usr/local/java/jre/lib/rt.jar:.
      

Compiling: Type javac *.java.

Running: Start the UTAssist server by typing java Server.


The Client

The UTAssist client is itself divided into two pieces.

UTAssistClient

The first is a UTAssistClient object, which lives in the Brain, and provides a couple of friendly interfaces for the Brain:

 
      Brain::getUTAssistClient()->queueDataForServer( byte* data, int size, char ID );
      

During one Brain cycle, any number of components can add data to be sent to the Server using this function. At the end of a cycle, the Brain sends the data to the Server. The ID is a unique value that describes each message. The size is the size of the data to be sent, in bytes.

Note: If the Brain is in the middle of sending data, then you cannot queue data for later sending -- this function returns false in this case. This ensures that any data sent will be from the most recent Brain cycle possible.

There is another function that can send data to the server without queueing it. However, this function and the queueing function won't really work well together, so try to use the queue function.

 
      Brain::getUTAssistClient()->sendDataToServer( byte* data, int size, char ID );
      

This function sends data directly to the Server, if possible. It returns a boolean value that lets you know if the data could be sent or not.

CommObject

The second piece is the CommObject, which is a standalone OObject that does all of the actual work of fragmenting and sending data over the network. The CommObject is connected to the Brain via a standard subject/observer interface.

Note: The client must be configured to know the IP address of the Server's computer. Vieri is 10.0.1.90, Zico is 10.0.1.91. You can set this in team/Brain/CommObject/CommObjectConfig.h by changing the SERVER_ADDRESS variable.

Message Types

There are a number of different message types that UTAssist passes around. Each message type is used to pass a different type of data. Each message type is identified by a unique identifier between 0-255, which is equivalent to one char in C. Note that this section is slightly outdated - especially the numbers specifying the sizes for each message type, which correspond to the older model of the robots, ERS210A.

Message TypeSize (bytes)IDDescription
MSG_T_IMAGE7603298 (or 'b')The full-size image. This is a large chunk of data to send around, and usually takes about 2.8 seconds to send. The data in this message is 176*144 pixels, with three bytes for each pixel: Y, Cb, and Cr.
MSG_T_SMALL_IMAGE475299 (or 'c')The smallest image, 1/4 of the dimension of the full-size image.
MSG_T_POSITION24100 (or 'd')A struct of variables containing the Aibo's current position and orientation. And variance, if we start using it again. The variables are encoded in string format. What was I thinking?
MSG_T_VISIONOBJS51101 (or 'e')This is a list of VisionObjects, which comes from Vision. Each VisionObject is a bounding box (x1,y1)-(x2,y2) and an identifier that descibes this box.
MSG_T_STATE_NAME40102 (or 'f')This is a string of characters describing the current state name.
MSG_T_PARTICLES1200103 (or 'g')The particles from localization. Right now, this is hardcoded as 200 particles, where each particle is identified by a triplet (x,y,theta).
MSG_T_SEGMENTED_IMAGE25344104 (or 'h')This is a full-size image. Instead of having three values for each pixel, we only have one: a value from [0,255] that describes what color that pixel was classified as.
Command Set9105 (or 'i')This is a set of commands that gets sent from UTAssist over to the Brain. The commands are processed by the Debug object, and are used to set a number of flags that control what data is sent from the Aibo to the Server.
Request one image2106 (or 'j')A command from the server to the Aibo that sets a flag in the Debug object. This flag will cause MohanVision to send over one large image.
MSG_T_BALL_FORCE_FIELD10208107 (or 'k')A force field.