For instructions on using the Spot control panel, see the simulated Spot web page.
java flat.Flat [port-number] [environment-file]
Options:
port-number defaults to 6688 environment-file path to an environment file. See /u/robot/flat-root/flat5/env/*.env Command-line arguments can be in any order. Normally, you give just the port number, which should correspond to the DISPLAY_PORT in the ".flat" file read by Flat4 when it starts.
Menu item | Description |
---|---|
FILE | |
Use environment... | Changes the environment in which the robot runs. |
Help... | Not yet implemented. |
Quit | Terminates the Flat program. |
EDIT | |
Edit environment... | Not yet implemented. |
VIEW | |
Show names | Toggles whether a mouse moving over a robot displays the name of the robot. |
Set display scale... | Changes the display scale of the environment. Options are 1x, 2x and 3x. |
ROBOT | |
Add robot... | Adds a new robot to the environment. The user selects a robot type and gives it a name. |
Remove robot... | Removes a robot from the environment. The user selects a robot by name. |
Center all robots | Moves all robots to the center of the environment. |
Mouse operation | Description |
---|---|
Move over a robot | Rolling the mouse over a robot displays the robot's name in a popup label, if the "Show names" option is turned on. |
Left click on the background | Moves a robot to that location. If there are multiple robots in the environment, the user selects one from a popup menu. |
Right click or Control-Clickon the background | Turns a robot to face that location. If there are multiple robots in the environment, the user selects one from a popup menu. This is Command-click on the Macintosh. |
Middle click or Alt-Clickon a robot | Displays a robot-specific control panel. This is Option-click on the Macintosh. |
IMPORTANT! Each command is a string (i.e. it is enclosed in double quotes).
To send commands to the Flat Display, the first word in the command should be DISPLAY. The general format of a command is:
"DISPLAY command optional-arguments"
$ telnet arachne 6123 Trying 128.83.120.71... Connected to arachne.cs.utexas.edu. Escape character is '^]'. "DISPLAY WhatRobots" (:FLAT-DISPLAY :WHAT-ROBOTS 0) "DISPLAY AddRobot" "DISPLAY WhatRobots" (:FLAT-DISPLAY :WHAT-ROBOTS 1 "Spot-1") "DISPLAY MoveRobot Spot-1 100 100" "DISPLAY MoveRobot Spot-1 -100 -100" "DISPLAY MoveRobotTo Spot-1 100 100"
Command | Description |
---|---|
UseEnvironment filename | Equivalent to the menu command of the same name. |
GetEnvironmentSize | Returns (:FLAT-DISPLAY :GET-ENVIRONMENT-SIZE <width> <height>) |
Help | Equivalent to the menu command of the same name. |
Quit | Equivalent to the menu command of the same name. |
EditEnvironment [filename] | Equivalent to the menu command of the same name. |
ShowNames TRUE|FALSE | Equivalent to the menu command of the same name. |
SetDisplayScale 1|2|3 | Equivalent to the menu command of the same name. |
SetEnvironmentScale |
Sets the ratio of pixels to units in environment files. |
AddRobot [robotClassName [robotName]] | Equivalent to the menu command of the same name. Currently, the only classes are flat.display.spot.SpotDisplay and flat.display.tinman.TinmanDisplay. Note: TinmanDisplay requires Java2. |
HideRobot robotName | Hides, but does not delete, the given robot. A hidden robot can still move and leave marks. | ShowRobot robotName | Makes a hidden robot visible again. |
RobotMessage robotName Message | Displays a short message on the fifth line of the Robot Manager for this robot. The message is the portion of the command line after the robot name and its trailing space. There is no need to enclose the message in quotes. |
PerformRobotAction robotName [parameters] | When the user clicks the middle mouse button on the robot, it currently activates a control panel for the robot, but the user can design robots that have different behavior. This action causes the robot to perform that function or functions. The other whole command string is passed to the command so it can parse any extra arguments. |
SetRobotParameter [robotName param=value] | Forwards the string "param=value" to the specified robot. The robot must recognize the given parameter. Currently, Spot recognizes only the parameters "NumberOfLasers=n", where n is 1 or 2, and "UseSonar=<boolean>" where <boolean> is true or false. |
GetRobotParameter [robotName param] | Not yet implemented. |
RemoveRobot [robotName] | Removes the specified robot from the environment. |
SensorData robot-name num-data data-type [COLOR hex-RGB-value] data-values... | Sends sensor data to the specified robot. The number of values and their meaning
is robot and sensor specific. Values can be integers or doubles. The user
can optionally specify the color in which the data will be drawn.
The Spot display currently understands the data types SONAR, LASER-LEFT, LASER-RIGHT, LASER-TOP, LASER-LEFT-OBJECTS, LASER-RIGHT-OBJECTS, LASER-TOP-OBJECTS LASER-LEFT-SEGMENTS, LASER-RIGHT-SEGMENTS, LASER-TOP-SEGMENTS, LASER-LEFT-POINTS, LASER-RIGHT-POINTS, LASER-TOP-POINTS, POINTS-LEFT and POINTS-RIGHT. Note: LASER-...-SEGMENTS, LASER-...-CIRCLE and LASER-...-POINTS are deprecated. Use the more general LASER-...-OBJECTS instead. Sonar readings are relative to each individual sonar. The readings start with sonar 0 (facing forward) and proceed in a clockwise direction through sonar 11. The units are millimeters. Laser readings specify distance r relative to the sensor. The units are millimeters. The drawing program assumes that the readings start at -90 degrees in the sensor coordinate system, and that they are spread equally across a 180-degree span. The display will rotate the readings into the robot's reference frame, but will not translate them to the center of the robot. LASER-...-OBJECTS specifies that the command contains either segment, point or circle data as described below. It is a generalization of the object-specific commands (which are deprecated, but still functional). Points-left and Points-right. Note: This and all of the following commands are deprecated. Use LASER-...-OBJECTS instead. Point signifies a list of x and y values in the robot's coordinate system. The units are millimeters. The points are displayed on the left or right Laser display in the optionally-specified color and remain on the screen until another set of points is sent. To erase the points, send a command specifying 0 points. Since points come in pairs of coordinates, the number of data values should always be a multiple of 2. Segment data specifies points P1 and P2 which indicate the start and end of the segment in the robot's coordinate system. The units are millimeters. Each point consists of two coordinates, x and y. So the number of data-values sent to the segment display should always be a multiple of 4. Circle data specifies a center point, radius and thickness which define a circle in the robot's coordinate system. The units for x, y and r are millimeters. The center of the circle is at (x y) relative to the robot. The thickness is in pixels.
The segment and object displays are superimposed on the laser readings, in
a different color. When new laser readings arrive, the display
is cleared, but when new segments arrive they are superimposed on
the existing readings. Sizes with dimension
Examples:
|
SetDisplayLabel robotName display-name new-label | Changes the label on a robot's sensor display. The display-name can be one of: LASER-LEFT, LASER-RIGHT, SONAR, FILTERED-SONAR, LOCAL-NEIGHBORHOOD, CAMERA-LEFT or CAMERA-RIGHT. The camera sensor displays are not yet implemented. The message is the portion of the command line after the robot name and its trailing space. There is no need to enclose the message in quotes. |
MoveRobot robotName delta-x delta-y | Adjusts the robot's position on the display. This is sent by the simulator. It does not move the robot in the simulator. |
MoveRobotTo robotName x y | Jumps the robot to the given location. Same as mouse left click. X and Y must be integers. This is sent by the simulator. It does not move the robot in the simulator. |
TurnRobot robotName delta-theta | Turns the robot by an incremental number of degrees. The angle is integral degrees. This is sent by the simulator. It does not turn the robot in the simulator. |
TurnRobotTo robotName theta | Turns the robot to face the given angle. Similar to mouse right click. The angle is integral degrees. This is sent by the simulator. It does not turn the robot in the simulator. |
CantMoveRobotTo robotName x y | The display receives this message when the user tried to move the robot to a place where it would intersect a wall. The display displays an error message to the user. |
PositionRobot robotName x y theta | This moves and rotates the robot on the display, but also
notifies the simulator that the robot has moved. This is equivalent
to clicking the mouse to position the robot. The difference between
this command and MoveRobotTo is that the latter is
received as a message from the simulator, while this command is
interpreted the same as a user-generated mouse click.
|
CenterAllRobots | Equivalent to the menu command of the same name. |
WhatRobots | Returns a list of the robots in the environment. Example: (:FLAT-DISPLAY :WHAT-ROBOTS 2 "Spot" "Tommy") |
RobotMark robotName :CLEAR | :CIRCLE radius hex-RGB-color | Either clears all marks for this robot or draws a circle
of the specified radius and color on the screen. The units are pixels
at 1x view scale. Use a radius of 1 to draw a single point. This command can be used, for example, to mark the trail of a robot, or to mark distinctive places. |
SimulationTime robotName time | Used only by Flat. This updates the simulation time on the Robot Manager display. |
RobotSpeed robotName linear-velocity rot-velocity | Used only by Flat. This updates the robot speed on the Robot Manager display. |
Sensors robotName message | Used only by Flat. This updates the list of available sensors on the Robot Manager display. |
Implement the GetRobotParameter command.