Skip to content

Directory Structure

brindza edited this page Nov 4, 2011 · 5 revisions

The code is divided into two main components: high and low level processing. The low level code is mainly written in C/C++ and compiled into libraries that have Lua interfaces. These libraries are used mainly for device drivers and anything designed to execute quickly (e.g. image processing and forward/inverse kinematics calculations). The high level code is mainly scripted Lua. The high level code includes the robots behavioral state machines which use the low level libraries.

The following will contain a brief description of the code following the provided directory structure. The low level code is rooted at the Lib directory and the high level code is rooted at the Player directory.

Low Level (Lib)

  • Platform
    There are three directories contained here, one corresponding to the three robot platforms supported. The code contained in these directories is everything that is platform dependent. This includes the robots forward/inverse kinematics and device drivers for controlling the robots sensors and actuators. All of the libraries have the same interface to allow you to just drop in the needed libraries/Lua files without changing the high level behavioral code. The directory trees for each platform (Webots/Nao) are the same
    • Body
      Body contains the device interface for controlling the robot's sensors and actuators. This includes controlling joint angles, reading IMU data, etc.
    • Camera
      Camera contains the device interface for controlling the robots camera.
    • Kinematics
      Kinematics contains library for computing the forward and inverse kinematics of the robot.
  • ImageProc
    This directory contains all of the image processing libraries written in C/C++: Segmentation and finding connected components.
  • Util
    These are all of the C/C++ utility function libraries.
    • CArray
      CArray allows access to C arrays in Lua.
    • CUtil
      CUtil provides access to a few C functions such as, bitwise operations and _sizeof_. It also contains the serialization and de-serialization for C arrays.
    • Shm
      Shm is the Lua interface to Boost shared memory objects.
    • Unix
      This library provides a Lua interface to a number of important Unix functions; including time, sleep, and chdir to name a few.
  • NaoQi
    This contains the custom NaoQi module allowing access to the Nao device communication manager in Lua.

High Level (Player)

player.lua is the main entry point for the code and contains the robot's main loop.

  • BodyFSM
    The state machine definition and states for the robot body are found here. These robot states include spinning to look for the ball, walking toward the ball and kicking the ball when positioned.
  • Config
    This directory contains the only high level platform dependent code, in the form of configuration files. Config.lua links to other environment-dependent configuration files, where the walk parameters, camera parameters and the names of the device interface libraries to use are all defined.
  • Dev
    This directory contains the Lua modules for controlling the devices (actuators/sensors) on the robot.
  • Data
    This directory contains any logging information produced. Currently this is only in the form of saved images.
  • HeadFSM
    The head state machine definition and states are located here. The head is controlled separately from the rest of the body and transitions between searching for the goals, searching for the ball, and tracking the ball once found.
  • Lib
    Lib contains all of the compiled, low level C libraries and Lua files that were created in Lib.
  • Motion
    Here is where all of the robot's motions are defined. It contains the walk and kick engines along with keyframe motions used for the get-up routines.
  • Util
    Utility functions are located here. The base finite state machine description and a Lua vector class are defined here.
  • Vision
    The main image processing pipeline is located here. It uses the output from the low level image processing to detect objects of interest (ball, goals, lines, spot, and landmarks).
  • World
    This is the code relating to the robots world model and localization.
Clone this wiki locally