RobotKit API
Public Member Functions | Properties
RKRobotControl Class Reference

Objects of this class use a connection to manipulating a robot. More...

#import <RKRobotControl.h>

List of all members.

Public Member Functions

(id) - initWithRobot:
(void) - openConnection
(void) - closeConnection
(void) - stopMoving
(void) - driveWithCoord1:coord2:coord3:
(void) - startCalibration
(void) - stopCalibrated:
(void) - rotateToHeading:
(void) - rollAtHeading:velocity:
(void) - startControlledBoost
(void) - cancelControlledBoost
(void) - resetDeadZoneSize
(void) - jump

Properties

RKDeviceConnectiondeviceConnection
RKDriveAlgorithmdriveAlgorithm
float deadZoneSize
double stopOffset
float boostTimeScale
float controlledBoostVelocity
BOOL calibrating

Detailed Description

This class is used to control a robot. It's main responsibility is to high order control methods like converting input coordinates to robotic coordinates to send to the device.


Member Function Documentation

- (void) cancelControlledBoost

Cancels the currently running controlled boost so that the velocity is no longer stuck at the boosted level. This command is only effective if the robot is currently in a controlled boost mode.

- (void) closeConnection

Closes communications with the robot.

- (void) driveWithCoord1: (double)  coord1
coord2: (double)  coord2
coord3: (double)  coord3 

Method used to drive a robot with a set coordinates. Coordinates are unspecified as the can be angular or scaler coordinates. The coordinates are dependent on the drive method used.

Parameters:
coord1The first parameter in the coordinate system.
coord2The second parameter in the coordinate system.
coord3The third parameter in the coordinate system.
- (id) initWithRobot: (RKRobot *)  aRobot

Initializer that setups control of a robot.

Parameters:
aRobotThe RKRobot instance to control.
Returns:
The initialized instance or nil if the robot can't be controlled.
- (void) jump

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

- (void) openConnection

Opens the connection by seting up communication streams, and testing that the robot communications with some initial startup commands.

- (void) resetDeadZoneSize

Resets the dead zone to the default value.

- (void) rollAtHeading: (float)  angle
velocity: (float)  velocity 

Tells the robot to move in the direction given by the angle, and at a given velocity. This method will honor the dead zone.

Parameters:
angleThe direction given by an angle between 0° and 360°.
velocityA velocity between 0.0 and 1.0.
- (void) rotateToHeading: (float)  angle

Method to rotate Sphero to a heading without moving the ball. Used during calibration.

Parameters:
angleA heading angle between 0° to 360°
- (void) startCalibration

Starts the calibration mode for Sphero. This mainly sets up the calibration LED.

- (void) startControlledBoost

Tells the robot to move at the given velocity for the boost time. During the time interval, the user can control the robot's direction but the velocity is fixed.

- (void) stopCalibrated: (BOOL)  calibrate

Stop calibration mode for Sphero.

Parameters:
calibrateYES to calibrate for new heading, and NO to stop calibration without setting calibration on the ball.
- (void) stopMoving

Stops the device from moving.


Property Documentation

- (float) boostTimeScale [read, write, assign]

The fraction of 25.5 seconds for a boost. Default value is 1.0.

See also:
- jump
- (BOOL) calibrating [read, assign]

Property for clients to check that the robot is being calibrated.

Returns:
YES if the robot is being calibrated, otherwise NO if in normal mode.
- (float) controlledBoostVelocity [read, write, assign]

Property for assigning a velocity for controlled boosts.

- (float) deadZoneSize [read, write, assign]

Provides a deadzone in terms of a fraction of full velocity.

- (RKDeviceConnection*) deviceConnection [read, assign]

Accessor to the RKDeviceConnection for calling direct commands to the device

- (RKDriveAlgorithm*) driveAlgorithm [read, write, retain]

Property to set and access the drive algorithm. A RKSteeringWheelDriveMethod is created by default.

See also:
RKDriveAlgorithm
- (double) stopOffset [read, write, assign]

Property for setting an offset to adjust what is consider a stop point for the input. Depends on the drive method used.

See also:
RKDriveMethod

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