orbotix.robot.base
Class CalibrateCommand

java.lang.Object
  extended by orbotix.robot.base.DeviceMessage
      extended by orbotix.robot.base.DeviceCommand
          extended by orbotix.robot.base.CalibrateCommand
All Implemented Interfaces:
android.os.Parcelable

public final class CalibrateCommand
extends DeviceCommand

Class that encapsulates the calibrate command used to set the 0° heading. Client code can use this along with RKBackLEDOutputCommand and RKRollCommand to aim Sphero so sending a roll command with 0° moves it in a user desired direction.


Nested Class Summary
 
Nested classes/interfaces inherited from interface android.os.Parcelable
android.os.Parcelable.Creator
 
Field Summary
 
Fields inherited from interface android.os.Parcelable
CONTENTS_FILE_DESCRIPTOR, PARCELABLE_WRITE_RETURN_VALUE
 
Constructor Summary
CalibrateCommand(float heading)
          Constructor that allows you set a heading offset.
 
Method Summary
 float getHeading()
          Accessor to the heading that will be used for calibrating.
static void sendCommand(Robot robot, float heading)
          Convenience method for sending the command through DeviceMessenger.
 
Methods inherited from class orbotix.robot.base.DeviceMessage
getTimeStamp, writeToParcel
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface android.os.Parcelable
describeContents
 

Constructor Detail

CalibrateCommand

public CalibrateCommand(float heading)
Constructor that allows you set a heading offset.

Parameters:
heading - This should always be 0.
Method Detail

sendCommand

public static void sendCommand(Robot robot,
                               float heading)
Convenience method for sending the command through DeviceMessenger.

Parameters:
robot - The robot object that will receive the message.
heading - An offset heading

getHeading

public float getHeading()
Accessor to the heading that will be used for calibrating.

Returns:
An angle between 0° to 360°.