org.lejon.util
Class MoveMentor

java.lang.Object
  extended byorg.lejon.util.MoveMentor

public class MoveMentor
extends java.lang.Object

This class accumulates some support methods to control and debug the movement of the robot. You may use the method

rectify
as follows:
   boolean finished = false;
   do
   {
     finished = false;
     // Set a defined MotionCommand CURVE or ROTATE
     myDrive.setMotionCommand(mMotionCommand); 
     myDrive.move();
 
     while( !finished )
     {
       //wait for event MotionFinished
       Thread.yield();
     }
 
     try 
     {
       // Some time to let the robot stand still
       Thread.sleep(500);
     }
     catch (InterruptedException e)
     {}
   }
   while( MoveMentor.rectify( mMotionCommand, mMotionReport ) );
 


Constructor Summary
MoveMentor()
           
 
Method Summary
static boolean rectify(MotionCommand cmd, MotionReport report)
          Rectifies the motion defined in the MotionCommand.
static void showNumber(int i)
          Shows a signed integer on the RCX display.
static void showText(java.lang.String s)
          Shows a text on the RCX display.
static void startCounter(int i)
          Starts to count a specified number of seconds backwards until 0.
static void waitForRUNPressed()
          Waits until the Button RUN is pressed.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MoveMentor

public MoveMentor()
Method Detail

rectify

public static boolean rectify(MotionCommand cmd,
                              MotionReport report)
Rectifies the motion defined in the MotionCommand. Uses the MotionReport to get information about the local pose.

Parameters:
cmd - Motion command with the defined motion
report - Motion report with the current local pose
Returns:
flag A flag that is set to true if the rectification for the current motion command is supported and the robot has stopped within a certain range of tolerance (9°).

waitForRUNPressed

public static void waitForRUNPressed()
Waits until the Button RUN is pressed. Then clears the display.


startCounter

public static void startCounter(int i)
Starts to count a specified number of seconds backwards until 0. Beeps every second, twice at the end.

Parameters:
i - The number of seconds

showNumber

public static void showNumber(int i)
Shows a signed integer on the RCX display.

Parameters:
i - The number to be displayed.

showText

public static void showText(java.lang.String s)
Shows a text on the RCX display.

Parameters:
s - The text to be displayed.