Flat4 Configuration File Format

Overview

Previous versions of Flat did not allow many parameters to be changed at runtime and, even worse, many parameters were compiled in so that Flat had to be recompiled to make minor changes.

Flat4 reads a configuration file, so it does not need to be recompiled to change its behavior. In addition, the display is fully configurable so it does not even need to be restarted between Flat runs.

This page describes the Flat4 configuration file entries.

Programmer notes

The configuration file is parsed by read_config_file() in "flat.c" and the parameters are stored in a variable called Config which is an instance of struct configuration which is defined in "flatsim.h". The default values for the parameters are near the top of "flat.c".

Many of these parameters should be changeable from the Flat main control panel, but currently are not.

Configuration file

The configuration file is named ".flat", although a different file can be specified on the command line:
 
  % flat_cl some.env -config /my.flat

Flat looks for a configuration file in three places: With some hesitation, I say that the sample configuration file below is self-documenting and thus I add nothing further.

  This is /u/robot/flat-root/flat4/.flat

# Sample config file for Flat v4 and higher
# Mike Hewett   27 April 1999


# CONTROL_PORT
# Socket number for controllers to connect.
#
Flat.CONTROL_PORT         1069

# DISPLAY_HOST
# Host for the display program.
#
Flat.DISPLAY_HOST         localhost

# DISPLAY_PORT
# Socket number for displays to connect.
#
Flat.DISPLAY_PORT         1085

# REAL_TIME_MODE
# In real time mode, Flat runs at real time.
# In non-real time mode, Flat keeps a simulated
# clock (controlled by SIMULATION_INTERVAL below)
# and will always simulate a constant time
# control loop.
# Default is 0.
#
Flat.REAL_TIME_MODE         0

# SIMULATION_SPEED
# ratio of real time to simulation time
# Not used in real time mode.
# Default is 1.0.
#
Flat.SIMULATION_SPEED      1.0

# SIMULATION_INTERVAL
# delta-T used for discrete simulation.
# Not used in real time mode.
# Default is 100 ms.
# 
Flat.SIMULATION_INTERVAL  100

# ENVIRONMENT_SCALE
# Scale of units in the environment file.
# meters/unit.
# Default 0.1
# 
Flat.ENVIRONMENT_SCALE      0.1

# ENVIRONMENT_DISPLAY_SCALE
# Ratio of pixels to units in the environment file.
# 
Flat.ENVIRONMENT_DISPLAY_SCALE   1.0

# PERFECT_ODOMETRY
# 0 = NO and the model generates random gaussian errors
#        in x, y and orientation.
# 1 = YES - no errors
Flat.PERFECT_ODOMETRY             1

# USE_SONAR
# 0 = NO, 1 = YES 
#
Flat.USE_SONAR                    1

# PERFECT_SONAR
# 0 = NO and the model simulates specular reflection
# 1 = YES - no specular reflection
Flat.PERFECT_SONAR                1

# USE_LASER
# 0 = NO, 1 = YES 
#
Flat.USE_LASER                    1

# PERFECT_LASER
# 0 = NO and the model generates random gaussian distance errors
# 1 = YES - no errors
Flat.PERFECT_LASER                0

# NUMBER_OF_LASERS
# 1 or 2.
# If 1, the laser is assumed to be on top of Flat.
# If 2, the lasers are mounted on the right and left
#       sides, angled at +/- LASER_ANGLE.
#
Flat.NUMBER_OF_LASERS             2

# LASER_SEPARATION
# Defaults to twice the sonar ring radius of SPOT, 280 mm
# Units are millimeters.
#
Flat.LASER_SEPARATION           280

# LASER_ANGLE
# The outward angle of each laser, if there are 2.
# Units are degrees.
Flat.LASER_ANGLE                 45


[FLAT home]


Author: Micheal S. Hewett
Email: hewett@cs.utexas.edu
Last Updated: Monday, February 15, 1999