TWiki > RisePrivate Web>StickyBotForceController? >GaitFileFormat (11 Aug 2008, BarrettHeyneman)

Gait File Format

ALERT! This page is a working page and thus the details will frequently change

Each file is required to have a header and a table of contents

Header

The header is the first two bytes of the flash file. It is a 16-bit little-endian number that indicates the size of the flash file. The header is included in the size. To calculate the file size, subtract the starting address from the ending address and add one. The table of contents must directly follow the header. Therefore, the smallest valid file, an empty-file, should be three bytes.

Table Of Contents

The first byte of the TOC indicates the number of entries in the TOC. This should be the third byte in the file. ALERT! This byte seems to be missing in the program memory we flash onto Stickybot. It would be very nice to include, so we might want to add it. -- BarrettHeyneman - 11 Aug 2008

Following the size byte are the entries for each section of the file. Each entry consists of three bytes, the first being the type of entry and the second and third indicating the location of the section. The location is referenced from the start of the file, so a location of 0x0000 would point to the TOC's number-of-entries byte.

ALERT! MPLAB C18 is little-endian, which means the 2-byte number 0xAABB, if stored starting at location 0x0100, would result in a 0xBB at 0x0100 and 0xAA at 0x0101. Due to this reason, the file format needs to be little-endian as well.

Example:

0x02 0x30 0x07 0x00 0x31 0x1A 0x01

From this TOC, we read there are two entries. The first is of type 0x30 which is a Servo Configuration Table. Its location is at 0x0007, directly after the TOC. (Since the TOC is seven bytes, it takes resides in the region 0x0000-0x0006.) The second entry is of type 0x31 and its location is at 0x011A.

Servo Configuration Table

Entry type: 0x30

The first byte indicates the number of servos installed. That byte is followed by 3 tables (expanded by row) each indexed by servo type, then leg. Those 3 tables have entries of the following types:

  • Home position (1 unsigned byte)
  • Upper limit (1 unsigned byte)
  • Lower limit (1 unsigned byte)

These limits are the raw output limits, enforced by the servo update routine, to prevent any damage to the machine. They should represent the absolute mechanical limit.

The home position is the resting position of the robot. The robot should be returned to home position before disconnecting power.

-- BarrettHeyneman - 06 Sep 2006

TIP All numbers used by the different controllers are not necessarily 1 byte long. At the moment I see no reason why we should need any values larger than 128 or smaller than 1/256, so for now we'll use two bytes, 2's complement signing where the decimal point is between the bytes (i.e. the number is in base 1/256). This way it can be represented as a signed int in C. We should revisit this if need be. From here on, a "number" refers to this representation.

-- BarrettHeyneman - 02 Aug 2006

Sensor Configuration Table

Entry type: 0x31

The first byte will be N, the total number of sensors. Following that byte will be two tables (expanded by row), of size N, which are indexed by sensor type then leg number. Those tables are:

  • Sensor Zero (unsigned chars)
  • Sensor Slope (numbers)

For more information on sensor calibration, see StickyBotSensorCalibration.

-- BarrettHeyneman - 07 Aug 2006

Stance Controller

Entry type: 0x32

The stance controller requires 52 numbers, in the following order:

  • G (16 numbers)
  • G-1 (16 numbers)
  • KG (4 numbers)
  • fD (4 numbers)
  • vFF (4 numbers)

The non-diagonal matrices (G matrices) are expanded by row; i.e. the elements of row 1, then the elements of row 2, etc. For more information about the control structure, see StanceController.

Detachment Controller

Entry type: 0x33

The detachment controller requires 13 numbers, in the following order:

  • fdes (1 number)
  • Kstroke (1 number)
  • fthresh (1 number)
  • Wup (4 numbers)
  • vwing (1 number)
  • Fup (4 numbers)
  • vfoot (1 number)

For information of the content of the controller, see DetachmentController.

-- BarrettHeyneman - 08 Aug 2006

Flight Controller

Entry type: 0x34

The flight controller has not been finalized.

Attachment Controller

Entry type: 0x35

The attachment controller requires 6 numbers in the following order:

  • vstroke (1 number)
  • Wload (4 numbers)
  • vwing (1 number)

For more information on the inner workings of the attachment controller, see AttachmentController.

-- BarrettHeyneman - 08 Aug 2006

Attachment Gesture

Entry type: 0x36

This is an entry that defines a compliance-controlled gesture for attaching feet to the wall. See AttachmentGesture for more details.

-- SalomonTrujillo - 30 Aug 2006

 
This site is powered by the TWiki collaboration platformCopyright &© by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding TWiki? Send feedback