Skip to content
This repository has been archived by the owner on Dec 31, 2019. It is now read-only.

Commit

Permalink
Updates for 1.1 beta 1.
Browse files Browse the repository at this point in the history
  • Loading branch information
Brian Smith committed Apr 27, 2012
1 parent 7b0efda commit 38ce022
Show file tree
Hide file tree
Showing 1,105 changed files with 39,772 additions and 104 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
![iosdeveloperheader.jpg](https://github.com/orbotix/Sphero-iOS-SDK/raw/master/assets/image00.jpg)
![iosdeveloperheader.jpg](https://github.com/orbotix/Sphero-iOS-SDK/raw/master/iosdeveloperheader.jpg)

# iOS Developer Quick Start Guide

Expand Down Expand Up @@ -29,7 +29,7 @@ There are two ways to integrate the Sphero SDK into your project. You can start
- Download the latest version of our [Xcode 4 Template Installer](https://github.com/orbotix/Sphero-iOS-SDK/raw/master/frameworks/SpheroXcode4Template.pkg)
* *You can always keep up to date by watching our [GitHub Repository](https://github.com/orbotix/Sphero-iOS-SDK)*

![installspheroxcode4templateforios.png](https://github.com/orbotix/Sphero-iOS-SDK/raw/master/assets/image01.png)
![installspheroxcode4templateforios.png](https://github.com/orbotix/Sphero-iOS-SDK/raw/master/installspheroxcode4templateforios.png)

This Xcode 4 Template Installer is designed to move the Sphero iOS SDK into the correct directory and integrate a default Sphero Application into the New Project menu in Xcode. It is important to note that this Installer only works with Xcode 4 and above. If you are the type that neglects the importance of upgrading your development environment, (guilty!) then you will have to manually add the Sphero iOS RobotKit and RobotUIKit into your Xcode project.

Expand All @@ -39,7 +39,7 @@ This Xcode 4 Template Installer is designed to move the Sphero iOS SDK into the

- Start a New Sphero Application.

![newspheroapplicationinxcode.png](https://github.com/orbotix/Sphero-iOS-SDK/raw/master/assets/image02.png)
![newspheroapplicationinxcode.png](https://github.com/orbotix/Sphero-iOS-SDK/raw/master/newspheroapplicationinxcode.png)

Name your project and decide where you would like to store the project. There should now be a project with RobotKit and RobotUIKit already linked up and ready to use. To test everything out, we want to build the default Application. It is important to note here that the Sphero iOS SDK will not work on the iOS Simulator because it uses the External Accessories Framework, therefore it must be Run on an actual iOS Device. There are ways to simulate the Bluetooth of an iOS device on Mac OSX but that topic is beyond the scope of this document.

Expand All @@ -59,7 +59,7 @@ There are always those cases where you already developed an awesome game or app

- Simply Drag `RobotKit.framework`, `RobotUIKit.framework` and `RobotUIKit.Bundle` into your project's framework folder.

![sendingIn.png](https://github.com/orbotix/Sphero-iOS-SDK/raw/master/assets/image03.png)
![sendingIn.png](https://github.com/orbotix/Sphero-iOS-SDK/raw/master/sendingIn.png)

The HelloSphero example has all the necessary code needed to create and maintain a connection to Sphero, and can be used as a guide in best practices. In general you will need to:

Expand Down
Binary file removed api/RobotKit.zip
Binary file not shown.
Binary file removed api/RobotUIKit.zip
Binary file not shown.
22 changes: 22 additions & 0 deletions frameworks/RobotKit.framework/Headers/RKAbortMacroCommand.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
//
// RKAbortMacroCommand.h
// RobotKit
//
// Created by Brian Smith on 8/30/11.
// Copyright 2011 Orbotix Inc. All rights reserved.
//

/*! @file */

#import <RobotKit/RKDeviceCommand.h>

/*!
* @brief Class to encapsulate a save macro command.
*
* This class is used to send a macro to abort the current running command.
*
* @sa RKAbortMacroResponse
*/
@interface RKAbortMacroCommand : RKDeviceCommand

@end
40 changes: 40 additions & 0 deletions frameworks/RobotKit.framework/Headers/RKAbortMacroResponse.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
//
// RKAbortMacroResponse.h
// RobotKit
//
// Created by Brian Smith on 8/30/11.
// Copyright 2011 Orbotix Inc. All rights reserved.
//

/*! @file */
#import "RKDeviceResponse.h"

/*!
* Codes sent back in the response to an abort macro command.
*/
enum RKAbortMacroCode {
RKAbortMacroCodeMacroNotRunning = 0 /*!< No macro was running */
};

/*!
* Defines a RKAbortMacroCode type for macro abort codes.
*/
typedef enum RKAbortMacroCode RKAbortMacroCode;

/*!
* @brief Class that encapsulates the response from a abort macro command.
*
* This is a response that can be used to check for abort codes or see if an error was returned
* from an abort macro command.
*
* @sa RKAbortMacroCommand
*/

@interface RKAbortMacroResponse : RKDeviceResponse {
RKAbortMacroCode abortCode;
}

/*! Read only property for the abort code returned in the response. */
@property (nonatomic, readonly) RKAbortMacroCode abortCode;

@end
5 changes: 5 additions & 0 deletions frameworks/RobotKit.framework/Headers/RKAchievement.h
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,11 @@
*/
+(void)recordEvent:(NSString*)name withCount:(int)count;

/*!
* Returns an array of RKAchievement objects showing current user progress
*/
+(NSArray*)getAchievements;

@end

//Achievement related notification constants
Expand Down
6 changes: 5 additions & 1 deletion frameworks/RobotKit.framework/Headers/RKAsyncPacketCodes.h
Original file line number Diff line number Diff line change
Expand Up @@ -14,5 +14,9 @@ enum {
RKAsyncPacketSensorDataStreaming = 0x03,
RKAsyncPacketConfigBlockContents = 0x04,
RKAsyncPacketPreSleepWarning = 0x05,
RKAsyncPacketMacroEmitMarker = 0x06
RKAsyncPacketMacroEmitMarker = 0x06,
RKAsyncPacketCollisionDetected = 0x07,
RKAsyncPacketOrbBasicPrint = 0x08,
RKAsyncPacketOrbBasicErrorASCII = 0x09,
RKAsyncPacketOrbBasicErrorBinary = 0x0A
};
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
//
// RKCollisionDetectedAsyncData.h
// RobotKit
//
// Created by Brian Smith on 2/23/12.
// Copyright (c) 2012 Orbotix Inc. All rights reserved.
//

#import "RKDeviceAsyncData.h"

struct RKCollisionAcceleration {
float x;
float y;
float z;
};
typedef struct RKCollisionAcceleration RKCollisionAcceleration;

struct RKCollisionAxis {
bool x : 1;
bool y : 1;
};
typedef struct RKCollisionAxis RKCollisionAxis;

struct RKCollisionPower {
int x;
int y;
};
typedef struct RKCollisionPower RKCollisionPower;


@interface RKCollisionDetectedAsyncData : RKDeviceAsyncData {
@private
RKCollisionAcceleration impactAcceleration;
RKCollisionAxis impactAxis;
RKCollisionPower impactPower;
float impactSpeed;
NSTimeInterval impactTimeStamp;
}

@property (nonatomic, readonly) RKCollisionAcceleration impactAcceleration;
@property (nonatomic, readonly) RKCollisionAxis impactAxis;
@property (nonatomic, readonly) RKCollisionPower impactPower;
@property (nonatomic, readonly) float impactSpeed;
@property (nonatomic, readonly) NSTimeInterval impactTimeStamp;

@end
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
//
// RKConfigureCollisionDetectionCommand.h
// RobotKit
//
// Created by Brian Smith on 2/23/12.
// Copyright (c) 2012 Orbotix Inc. All rights reserved.
//

#import "RKDeviceCommand.h"

enum RKCollisionDetectionMethod {
RKCollisionDetectionMethodDetectionOff = 0,
RKCollisionDetectionMethod1 = 1
};
typedef enum RKCollisionDetectionMethod RKCollisionDetectionMethod;


@interface RKConfigureCollisionDetectionCommand : RKDeviceCommand {
RKCollisionDetectionMethod method;
uint8_t xThreshold;
uint8_t yThreshold;
uint8_t xSpeedThreshold;
uint8_t ySpeedThreshold;
NSTimeInterval postTimeDeadZone;
}

@property (nonatomic, readonly) RKCollisionDetectionMethod method;
@property (nonatomic, readonly) uint8_t xThreshold;
@property (nonatomic, readonly) uint8_t yThreshold;
@property (nonatomic, readonly) uint8_t xSpeedThreshold;
@property (nonatomic, readonly) uint8_t ySpeedThreshold;
@property (nonatomic, readonly) NSTimeInterval postTimeDeadZone;

+ (void)sendCommandForMethod:(RKCollisionDetectionMethod)method
xThreshold:(uint8_t)theXThreshold
yThreshold:(uint8_t)theYThreshold
xSpeedThreshold:(uint8_t)theXSpeedThreshold
ySpeedThreshold:(uint8_t)theYSpeedThreshold
postTimeDeadZone:(NSTimeInterval)deadZone;

+ (void)sendCommandToStopDetection;

- (id)initForMethod:(RKCollisionDetectionMethod)method
xThreshold:(uint8_t)theXThreshold
yThreshold:(uint8_t)theYThreshold
xSpeedThreshold:(uint8_t)theXSpeedThreshold
ySpeedThreshold:(uint8_t)theYSpeedThreshold
postTimeDeadZone:(NSTimeInterval)deadZone;

@end
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
//
// RKConfigureCollisionDetectionResponse.h
// RobotKit
//
// Created by Brian Smith on 2/23/12.
// Copyright (c) 2012 Orbotix Inc. All rights reserved.
//

#import "RKDeviceResponse.h"

@interface RKConfigureCollisionDetectionResponse : RKDeviceResponse

@end
3 changes: 3 additions & 0 deletions frameworks/RobotKit.framework/Headers/RKDeviceCommand.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,11 @@
* @sa RKDeviceMessage
*/
@interface RKDeviceCommand : RKDeviceMessage {
NSTimeInterval transmitTimeStamp;
}

@property (nonatomic, readonly) NSTimeInterval transmitTimeStamp;

/*!
* Convenience method that will send a simple command without parameter using the RKDeviceMessenger
* singleton.
Expand Down
1 change: 1 addition & 0 deletions frameworks/RobotKit.framework/Headers/RKDeviceConnection.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ enum RKConnectionState {
RKConnectionStatePing1, /*! A ping was issued to test communications. */
RKConnectionStatePing2, /*! A second ping issued to test communications before giving up. */
RKConnectionStateGetBluetoothInfo, /*! A get bluetooth info was sent to the robot. */
RKConnectionStatePollPacketTimes, /*! Get the packet transmit and receive times for synchronizing clocks. */
RKConnectionStateOnline /*! The robot is responding to communications and ready for commands to be sent. */
};

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
//
// RKInitMacroExecutive.h
// RobotKit
//
// Created by Jon Carroll on 3/2/12.
// Copyright (c) 2012 Orbotix Inc. All rights reserved.
//

/*! @file */

#import <RobotKit/RKDeviceCommand.h>

/*!
* @brief Terminates running macros and re-initializes the system
*
* This terminates any running macro and reinitializes the macro system.
* The table of any persistent users macros is erased and the storage space is freed.
*
*/

@interface RKInitMacroExecutiveCommand : RKDeviceCommand

@end
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
//
// RKInitMacroExecutiveResponse.h
// RobotKit
//
// Created by Jon Carroll on 3/2/12.
// Copyright (c) 2012 Orbotix Inc. All rights reserved.
//

/*! @file */

#import <RobotKit/RKDeviceResponse.h>

/*!
* @brief Class that represents a response from the RKInitMacroExecutiveCommand
*
* This is a simple response.
*
* @sa RKInitMacroExecutiveCommand
*/

@interface RKInitMacroExecutiveResponse : RKDeviceResponse

@end
39 changes: 39 additions & 0 deletions frameworks/RobotKit.framework/Headers/RKMCCalibrate.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
//
// MCCalibrate.h
// MacroLab
//
// Created by Jon Carroll on 9/12/11.
// Copyright (c) 2011 Orbotix, Inc. All rights reserved.
//

#import "RKMacroCommand.h"

/*!
* @brief Macro Command to calibrate the robot
*
* When this command is sent the current heading of the robot will become
* the heading that is passed in as a parameter.
* Allowed values:
* heading 0-359
* delay 0-255
*/

@interface RKMCCalibrate : RKMacroCommand {
int heading;
int delay;
}

/*! The current heading of the robot will become this value after the command is executed. 0-359 allowed. */
@property int heading;

/*! The delay in ms after this command is executed before the next command is. 0-255 allowed.*/
@property int delay;

/*! Convenience method for creating a command and setting the parameters in one line.
* @param heading The heading the command will be initialized with.
* @param delay The delay the command will be initialized with
* @return An instance of the command with the given parameters.
*/
+(RKMCCalibrate*)commandWithHeading:(int)heading delay:(int)delay;

@end
33 changes: 33 additions & 0 deletions frameworks/RobotKit.framework/Headers/RKMCDelay.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
//
// MCDelay.h
// MacroLab
//
// Created by Jon Carroll on 9/12/11.
// Copyright (c) 2011 Orbotix, Inc. All rights reserved.
//

#import "RKMacroCommand.h"


/*!
* @brief A command for adding a delay between commands
*
* This command will allow you to add a delay between commands greater than the 255 ms
* delay limit on most commands.
* Allowed values:
* delay 0-65,535
*/
@interface RKMCDelay : RKMacroCommand {
int delay;
}

/*! Delay in ms associated with this command. 0-65,535 allowed. */
@property int delay;

/*! Convenience method for creating a command and setting the parameters in one line.
* @param delay The delay the command will be initialized with.
* @return An instance of the command with the given parameters.
*/
+(RKMCDelay*)commandWithDelay:(int)delay;

@end
Loading

0 comments on commit 38ce022

Please sign in to comment.