orbotix.robot.base
Class CalibrateCommand
java.lang.Object
orbotix.robot.base.DeviceMessage
orbotix.robot.base.DeviceCommand
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 classes/interfaces inherited from interface android.os.Parcelable |
android.os.Parcelable.Creator |
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 java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface android.os.Parcelable |
describeContents |
CalibrateCommand
public CalibrateCommand(float heading)
- Constructor that allows you set a heading offset.
- Parameters:
heading
- This should always be 0.
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°.