RobotKit API
Public Member Functions | Static Public Member Functions | Properties
RKDriveControl Class Reference

Singleton class for managing the game play. More...

#import <RKDriveControl.h>

List of all members.

Public Member Functions

(void) - setup
(void) - tearDown
(void) - startDriving:
(void) - driveWithJoyStickPosition:
(void) - driveWithAcceleration:
(void) - stopDriving
(void) - jump

Static Public Member Functions

(RKDriveControl *) + sharedDriveControl

Properties

RKRobotProviderrobotProvider
RKRobotControlrobotControl
RKRobotrobot
CMMotionManager * motionManager
BOOL driving
CGSize joyStickSize
UIInterfaceOrientation tiltOrientation
double velocityScale
double stopOffset
id driveTarget
SEL driveConversionAction
BOOL handlesCoreMotionUpdates
BOOL showsRobotLostControlAlert

Detailed Description

This class provides a high level interface for controlling a robot.


Member Function Documentation

- (void) driveWithAcceleration: (CMAcceleration)  acceleration

Method to updatre the robot's heading and speed from accelerometer data. This is called internally for drive types that use accelerometer data.

Parameters:
accelerationThe acceleration data.
- (void) driveWithJoyStickPosition: (CGPoint)  newPoint

Used to update the robot heading and speed using the point from a joy stick control.

Parameters:
newPointThe new point to use to change the robot's motion.
- (void) jump

Uncontrolled boost to give a Sphero enough momentum to go over jumps.

- (void) setup

Sets up the game environment. Sets up the resources needed to start controlling a robot.

+ (RKDriveControl *) sharedDriveControl

Accessor to the singleton object for this class.

Returns:
The singleton object for this class.
- (void) startDriving: (RKDriveControlType type

Starts driving for a RKDriveControlType. This sets up the drive algorithm for the given control type. For a Core Motion based control, the updates will be started unless user disables them first.

See also:
RKDriveControlType
RKRobotControl
Parameters:
typeThe drive control type used to drive.
- (void) stopDriving

Stops driving the robot, which includes stoping Core Motion updates as needed.

- (void) tearDown

Tears down the game environment. Destroys any resources used to control a robot, and makes sure the robot is shut down properly.


Property Documentation

- (SEL) driveConversionAction [read, write, assign]

Action to call once input coordinates are converted to speed and heading for the robot. The method signiture is

- (id) driveTarget [read, write, assign]

Target to use for action calls

- (BOOL) driving [read, assign]

The driving state. YES if driving, otherwise, NO

- (BOOL) handlesCoreMotionUpdates [read, write, assign]

Property to control if Core Motion updates are handled automatically. Default value is YES.

- (CGSize) joyStickSize [read, write, assign]

Size of the possible values used for a joy stick control

- (CMMotionManager *) motionManager [read, assign]

Instance of the CMMotionManager used to drive the robot

- (RKRobot*) robot [read, assign]

The RKRobot object that is being driven

- (RKRobotControl*) robotControl [read, assign]

The RKRobotControl object from the robotProvider instance

- (RKRobotProvider*) robotProvider [read, assign]

The RKRobotProvider object used to manage robots

- (BOOL) showsRobotLostControlAlert [read, write, assign]

Property to control the robot lost control alert message

- (double) stopOffset [read, write, assign]

Value used to set a position for the stop point.

- (UIInterfaceOrientation) tiltOrientation [read, write, assign]

Interface orientation used for tilt control

- (double) velocityScale [read, write, assign]

Scale value between 0.0 to 1.0 that scales the velocity of the robot. Default value is 1.0.


The documentation for this class was generated from the following file:
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Properties