s3games.robot

## Class Robot

- java.lang.Object
- - s3games.robot.Robot

- All Implemented Interfaces:
    java.lang.Runnable

      public class Robot
      extends java.lang.Object
      implements java.lang.Runnable

  The main robot arm controller.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `Robot(java.lang.String serialPort, GameSpecification specs)` construct the robot controller and connect to the servo controller device

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `allLocationsDemo()` shows the user all locations learned by the robot arm, it does it in a separate thread of course as this method is called from the button action listener
    `void` | `close()` close the communication link to the servo-controller device
    `void` | `control()` allows a direct control of the robot using a keyboard in a separate robot control window
    `void` | `doTest()` lets the user to enter a simple command for the robot on the standard input console - this is used only for testing the robot arm
    `void` | `goHome()` move the arm away from the sight of the camera
    `void` | `goTo(double[] angles)` moves the robot arm to the requested angles configuration, if the previous move has been completed
    `void` | `goToDirect(double[] angles)` moves the robot arm to the requested angles configuration, regardless the previous move has been completed
    `void` | `grab()` grab the element now
    `void` | `initArm()` initialize the arm to its 0 position - a quite stressful operation!
    `void` | `moveRobot(Move move)` perform a single move operation with the robot arm including picking and placing an element.
    `void` | `pause()` invert the pause mode state
    `void` | `performMove()` perform a single move that was requested transporting the element to be moved
    `void` | `put()` release the element now
    `void` | `run()` performs the demo of showing all locations

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### Robot

          public Robot(java.lang.String serialPort,
               GameSpecification specs)
                throws java.lang.Exception

      construct the robot controller and connect to the servo controller device
      Throws:
        `java.lang.Exception`

  - ### Method Detail

    - #### close

          public void close()

      close the communication link to the servo-controller device

    - #### moveRobot

          public void moveRobot(Move move)
                         throws java.lang.Exception

      perform a single move operation with the robot arm including picking and placing an element. this method only requests that the move be performed and waits for confirmation.
      Throws:
        `java.lang.Exception`

    - #### performMove

          public void performMove()
                           throws java.lang.Exception

      perform a single move that was requested transporting the element to be moved
      Throws:
        `java.lang.Exception`

    - #### doTest

          public void doTest()

      lets the user to enter a simple command for the robot on the standard input console - this is used only for testing the robot arm

    - #### allLocationsDemo

          public void allLocationsDemo()

      shows the user all locations learned by the robot arm, it does it in a separate thread of course as this method is called from the button action listener

    - #### run

          public void run()

      performs the demo of showing all locations
      Specified by:
        `run` in interface `java.lang.Runnable`

    - #### pause

          public void pause()

      invert the pause mode state

    - #### control

          public void control()

      allows a direct control of the robot using a keyboard in a separate robot control window

    - #### goTo

          public void goTo(double[] angles)
                    throws java.lang.Exception

      moves the robot arm to the requested angles configuration, if the previous move has been completed
      Throws:
        `java.lang.Exception`

    - #### goToDirect

          public void goToDirect(double[] angles)
                          throws java.lang.Exception

      moves the robot arm to the requested angles configuration, regardless the previous move has been completed
      Throws:
        `java.lang.Exception`

    - #### grab

          public void grab()
                    throws java.lang.Exception

      grab the element now
      Throws:
        `java.lang.Exception`

    - #### put

          public void put()
                   throws java.lang.Exception

      release the element now
      Throws:
        `java.lang.Exception`

    - #### initArm

          public void initArm()

      initialize the arm to its 0 position - a quite stressful operation!

    - #### goHome

          public void goHome()
                      throws java.lang.Exception

      move the arm away from the sight of the camera
      Throws:
        `java.lang.Exception`