This patch set adding the ERS-220(A) specific features to Tekkotsu 1.2


FILES
-----
  README                                      - this file
  Tekkotsu_1.2_ERS-220.diff                   - patch for ERS-220 specific features
  Tekkotsu_1.2_WorldModel2_bugfix1.diff       - patch for WorldModel2 bugfix
  Tekkotsu_1.2_GetRobotDesign_on_Startup.diff - patch for OPENR::GetRobotDesign() sample


INSTALL
-------

  Download Tekkotsu_1.2.tar.gz from http://www.tekkotsu.org/ and extract it:

    $ tar xzf Tekkotsu_1.1.tar.gz
    $ cd Tekkotsu_1.2

  To apply ERS-220 specific features:

    $ patch -p1 -c -i Tekkotsu_1.2_ERS-220.diff

  To apply WorldModel2 bugfix:

    $ patch -p1 -c -i Tekkotsu_1.2_WorldModel2_bugfix1.diff

  To apply OPENR::GetRobotDesign() sample (optional, not necessary):

    $ patch -p1 -c -i Tekkotsu_1.2_GetRobotDesign_on_Startup.diff

  Now you are ready to build. See also the install guide on the
  Tekkotsu Homepage to build and use it.


WHAT IS THIS?
-------------

  Tekkotsu_1.2_ERS-220.diff
  -------------------------

    Adds ERS-220(A) specific features (3 buttons and 11 LEDs):
     - Tail Buttons x3
     - Back multi indicators x6 (two of them are aliases of the ERS-210's tail LEDs)
     - Tail indicators x3
     - Face front indicators x3
     - Retractable Head Light x1
     see also Shared/ERS220Info.h, Shared/WorldState.h and Shared/WorldState.cc

    Re-assigns controller's next/prev/select buttons:
     - next button:   Front head button (ERS-210) => Tail left button (ERS-220)
     - prev button:   Back head button (ERS-210)  => Tail right button (ERS-220)
     - select button: Chin button (ERS-210)       => Tail center button (ERS-220)
     see also Behaviors/Controls/ControlBase.cc

    Re-defines LED patterns for displaying one digit:
     - re-defined LedEngine::numMask[] for ERS-220.
     see also Motion/LedEngine.cc

    Re-defines the tail LED pattern of EmergencyStopMC:
     see also Motion/EmergencyStopMC.cc


  Tekkotsu_1.2_WorldModel2_bugfix1.diff
  -------------------------------------

    The WorldModel2Behavior crashes as soon as start. I think it is
    bug caused by a typo in 'almMain.cc'. This patch fixes it.

    see also WorldModel2/Maps/almMain.cc


  Tekkotsu_1.2_GetRobotDesign_on_Startup.diff
  -------------------------------------------

    This is a sample of OPENR::GetRobotDesign() to detect the robot
    design; like as "ERS-220".

    If you apply this patch, the StartupBehavior prints the robot
    design at last of startup sequence.

    see also project/StartupBehavior.cc


NOTE
----

  About controller's next/prev/select buttons
  -------------------------------------------

    ERS-220's Front/Back head buttons are differ from ERS-210's.
    See "4.1.1 Head Sensor" in 'ModelInformation_220_E.pdf' from Sony Corp.


  Open problem of WorldModel2Behavior
  -----------------------------------

    1. Turn on the WorldModel2Behavior in the emergency stop mode.
    2. Start it - runs correctly if the above patch is applied.
    3. Stop it and back to the emergency stop mode.
    4. Turn off the WorldModel2Behavior - causes crash! Hmm..


  About OPENR::GetRobotDesign()
  -----------------------------

    Tekkotsu 1.2 supports both ERS-210 and ERS-220, but a recompile is
    necessary to switch between them. If the framework would support
    auto-detecting the robot design, a recompile may not be necessary.

    To support both or more type of robots without recompile, it'll be
    necessary to integrate RobotInfo and WorldState into a singleton
    object.

    Suppose the following class hierarchy example:

      WorldState <--- ERS2xxWorldState <--- ERS210WorldState
                                         |
                                         +- ERS220WorldState

      WorldState is the abstract base class.
      ERS2xxWorldState is the base class implements common features for ERS-2xx series.
      ERS210WorldState is the concrete class for ERS-210.
      ERS220WorldState is the concrete class for ERS-220.

    'state' global variable
      The singleton which is an instance of one of the concrete class of WorldState;
      e.g. ERS210WorldState, ERS220WorldState or else.

    state->getRobotDesign()
      Returns the identifier corresponding to the model of the robot;
      e.g. ERS-210, ERS-220 or else. (like as OPENR::getRobotDesign())

    state->getNumPIDJoints()
      Returns the NumPIDJoints.
      It is 18 if ERS210WorldState, 15 if ERS220WorldState.

    state->getNumLEDs()
      Returns the NumLEDs.
      It is 9 if ERS210WorldState, 20 if ERS220WorldState.

    ...and so on.

    How do you think about the above idea?
    Of course it will be hard work, I think. ;)



----
Daishi MORI <mori-d@super-r.net>
