Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
# Conflicts:
#	example-basic/example-basic.xcodeproj/project.xcworkspace/xcuserdata/joschow1.xcuserdatad/UserInterfaceState.xcuserstate
  • Loading branch information
Joseph Chow committed Dec 12, 2017
2 parents 3fece7d + 5a90a0f commit b2323ec
Show file tree
Hide file tree
Showing 306 changed files with 4,758 additions and 1,321 deletions.
2 changes: 1 addition & 1 deletion Doxyfile
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ PROJECT_LOGO =
# entered, it will be relative to the location where doxygen was started. If
# left blank the current directory will be used.

OUTPUT_DIRECTORY =
OUTPUT_DIRECTORY = ./docs

# If the CREATE_SUBDIRS tag is set to YES then doxygen will create 4096 sub-
# directories (in 2 levels) under the output directory of each output format and
Expand Down
39 changes: 19 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,20 @@ __After you've opened up the project file__
Note that you may have to repeat these steps if you make any changes to your project via the generator.

# Initializing ARKit
To initialize the ARKit framework
To get started, you need to initialize the ARKit framework. This can be done a couple of different ways. ofxARKit provides a helper api to quickly initialize a session without too much fuss.

__SessionSetup__
```c++
ARCore::SFormat format;
format.enablePlaneTracking().enableLighting();
auto session = ARCore::generateNewSession(format);
```

the `SFormat` object is a way to enable various features of ARKit in a more straightforward manner. Passing an instance of an `SFormat` object to `ARCore::generateNewSession` will automatically generate a new `ARSession` object, while ensuring the specified features are useable on your device.

You can of course, write things by hand which isn't too difficult either.

__Raw Objective-C__
```objective-c
@interface <your view controller name>()
@property (nonatomic, strong) ARSession *session;
Expand All @@ -49,26 +62,11 @@ configuration.planeDetection = ARPlaneDetectionHorizontal;
// start the session
[self.session runWithConfiguration:configuration];
```
note that - assuming you're using objective c++(which should be the default for ios oF projects), you could just as easily skip adding a view controller and just initialize in ofApp.h/.mm.
Lastly - include `ofxARKit.h`, this will give you access to all of the class files as well as the `ARProcessor` api class. Note that when you include `ofxARKit.h`, you'll be able to include a helper header called `ARSessionSetup.h` which includes a helper function for generating a new session.
As to where to initialize, it really doesn't matter all that much, if your project setup is more in the form of a traditional IOS objective-c app, you can set things up in your view controller, or if your app is more like a normal oF app, you should be able to just as easily set things up in your `setup` function.
# Current functionality
There are a number of classes and other files in the addon that deal with different areas relating to ARKit, like setting up the camera, dealing with feature detection, or dealing with plane detection.
The class `ARProcessor` deals with joining all of these different bits of functionality in a (hopefully) easy to use API, but each of the classes can be used as standalone classes as well.
There are the following classes/files that are part of the addon
* `ARAnchorManager` : deals with managing `ARAnchor` objects as well as `ARPlaneAnchor` objects.
* `ARCam` : deals with managing the camera data found by ARKit and generating something that can be displayed.
* `ARDebugUtils` : as the name suggests - this deals with debugging helpers. At the moment, it's able to handle feature detection and drawing a point cloud.
* `ARObject` : this is a header file that declares `PlaneAnchorObject` and `ARObject`. These structs are used to store converted ARKit data into something more oF friendly.
* `ARShaders` : this stores the core shaders needed by the addon.
* `ARSessionSetup` : provides a helper function for quickly generating a new session.
* `ARUtils.h` : this stores various utility functions
Note that if you've used the addon pior to 8/29/2017, though I did my best to not make any api changes, there is a very tiny chance your code may break.
[See the wiki](https://github.com/sortofsleepy/ofxARKit/wiki/Current-Functionality) for a brief description of current funcitonality.
### Potential Hurdles in setup of ARKit
Though ARKit is supported on all devices with an A9 chip(6s onwards I believe) - it is helpful to have a fairly recent device or you may experience near immediate degradation of tracking performance. That being said - ARKit is helpful in that manner by warning you of when you're loosing performance by spitting out a message to the effect of `...tracking performance reduced due to resource constraints...`
Expand All @@ -77,10 +75,11 @@ FPS appears to be minimally affected, but like the message says, things might no
If you see the message pop up, the ARKit api offers a limited function set to see what the reason might be in the degredation of tracking quality. You can log the current tracking status by
* calling `logTrackingState` in `ARProcessor` or `ARCam`. Will log to the console a basic string describing the status.
* calling `logTrackingState` in `ARCam`. Will log to the console a basic string describing the status.
* you can also call `getTrackingState` in either class to get the raw tracking state from ARKit.
* `ARProcessor` provides a `debugInfo` object which is an instance of `ARDebugInfo` which can be used as well. Using this will also provide information about FPS, etc.
Note that in order for those functions to work, you'll need to call the `setup` function of either of those classes and pass in the boolean `true`
Note that in order for those functions to work, you'll need to call the `setup` function of either of `ARCam` or `ARProcessor` and pass in the boolean `true`
# Permissions
For ARKit - You'll have to enable the `Privacy - Camera Usage Description` in your `ofxiOS-Info.plist` file. The value for this field is just the string you want to show users when you ask for camera permissions. If you've never touched a plist file before, no worries! Its very easy to change.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,6 @@
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="nested-classes"></a>
Classes</h2></td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">class &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_a_r_core_1_1_a_r_anchor_manager.html">ARCore::ARAnchorManager</a></td></tr>
<tr class="memdesc:"><td class="mdescLeft">&#160;</td><td class="mdescRight">This is a helper class to help manage anchors. <a href="class_a_r_core_1_1_a_r_anchor_manager.html#details">More...</a><br /></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="namespaces"></a>
Expand Down
91 changes: 91 additions & 0 deletions docs/html/_a_r_anchor_manager_8h_source.html

Large diffs are not rendered by default.

File renamed without changes.
File renamed without changes.
118 changes: 118 additions & 0 deletions docs/html/_a_r_cam_8h_source.html

Large diffs are not rendered by default.

File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,8 @@
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="nested-classes"></a>
Classes</h2></td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">class &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_a_r_debug_utils_1_1_a_r_debug_info.html">ARDebugUtils::ARDebugInfo</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">class &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_a_r_debug_utils_1_1_point_cloud_debug.html">ARDebugUtils::PointCloudDebug</a></td></tr>
<tr class="memdesc:"><td class="mdescLeft">&#160;</td><td class="mdescRight">Helper class for recognizing features and drawing the resulting point cloud. <a href="class_a_r_debug_utils_1_1_point_cloud_debug.html#details">More...</a><br /></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
Expand Down
96 changes: 96 additions & 0 deletions docs/html/_a_r_debug_utils_8h_source.html

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions html/_a_r_objects_8h.html → docs/html/_a_r_objects_8h.html
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,9 @@
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_a_r_objects_1_1_a_r_object.html">ARObjects::ARObject</a></td></tr>
<tr class="memdesc:"><td class="mdescLeft">&#160;</td><td class="mdescRight">The base class you can use to build your AR object. Provides a model matrix and a mesh for easy tracking by ARKit. <a href="struct_a_r_objects_1_1_a_r_object.html#details">More...</a><br /></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_a_r_objects_1_1_face_anchor_object.html">ARObjects::FaceAnchorObject</a></td></tr>
<tr class="memdesc:"><td class="mdescLeft">&#160;</td><td class="mdescRight">The base class to build a Face geometry. <a href="struct_a_r_objects_1_1_face_anchor_object.html#details">More...</a><br /></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="namespaces"></a>
Namespaces</h2></td></tr>
Expand Down

Large diffs are not rendered by default.

File renamed without changes.
126 changes: 126 additions & 0 deletions docs/html/_a_r_processor_8h_source.html

Large diffs are not rendered by default.

File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@
</div><!-- top -->
<div class="header">
<div class="summary">
<a href="#nested-classes">Classes</a> &#124;
<a href="#namespaces">Namespaces</a> &#124;
<a href="#func-members">Functions</a> </div>
<div class="headertitle">
Expand All @@ -72,15 +73,22 @@

<p><a href="_a_r_session_setup_8h_source.html">Go to the source code of this file.</a></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="nested-classes"></a>
Classes</h2></td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">struct &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="struct_a_r_core_1_1_format_state.html">ARCore::FormatState</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:"><td class="memItemLeft" align="right" valign="top">class &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_a_r_core_1_1_s_format.html">ARCore::SFormat</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="namespaces"></a>
Namespaces</h2></td></tr>
<tr class="memitem:namespace_a_r_core"><td class="memItemLeft" align="right" valign="top"> &#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespace_a_r_core.html">ARCore</a></td></tr>
<tr class="separator:"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="func-members"></a>
Functions</h2></td></tr>
<tr class="memitem:ab1e11f8de09a3f533f6ed38f93feb504"><td class="memItemLeft" align="right" valign="top">static ARSession *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespace_a_r_core.html#ab1e11f8de09a3f533f6ed38f93feb504">ARCore::generateNewSession</a> (ARWorldAlignment worldAlignment=ARWorldAlignmentCamera, NSObject&lt; ARSessionDelegate &gt; *delegateClass=NULL, bool providesAudio=false)</td></tr>
<tr class="separator:ab1e11f8de09a3f533f6ed38f93feb504"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a66ae704f1eff4b085765cc73635db8eb"><td class="memItemLeft" align="right" valign="top">static ARSession *&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespace_a_r_core.html#a66ae704f1eff4b085765cc73635db8eb">ARCore::generateNewSession</a> (SFormat format)</td></tr>
<tr class="separator:a66ae704f1eff4b085765cc73635db8eb"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
</div><!-- contents -->
<!-- start footer part -->
Expand Down
94 changes: 94 additions & 0 deletions docs/html/_a_r_session_setup_8h_source.html

Large diffs are not rendered by default.

File renamed without changes.
83 changes: 83 additions & 0 deletions docs/html/_a_r_shaders_8h_source.html

Large diffs are not rendered by default.

35 changes: 29 additions & 6 deletions html/_a_r_utils_8h.html → docs/html/_a_r_utils_8h.html
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,8 @@
</table><table class="memberdecls">
<tr class="heading"><td colspan="2"><h2 class="groupheader"><a name="define-members"></a>
Macros</h2></td></tr>
<tr class="memitem:ad331f6e0982862a12a66503c7e12334e"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="_a_r_utils_8h.html#ad331f6e0982862a12a66503c7e12334e">ARToolkitComponents_h</a></td></tr>
<tr class="separator:ad331f6e0982862a12a66503c7e12334e"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ab06e1eb2e9bf38e0d452b1f796aed208"><td class="memItemLeft" align="right" valign="top">#define&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="_a_r_utils_8h.html#ab06e1eb2e9bf38e0d452b1f796aed208">STRINGIFY</a>(A)&#160;&#160;&#160;#A</td></tr>
<tr class="separator:ab06e1eb2e9bf38e0d452b1f796aed208"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table><table class="memberdecls">
Expand All @@ -96,12 +98,14 @@
<tr class="memitem:ab67b42b84c068f0c4ab2401ea3af86c6"><td class="memTemplParams" colspan="2">template&lt;typename T , typename U &gt; </td></tr>
<tr class="memitem:ab67b42b84c068f0c4ab2401ea3af86c6"><td class="memTemplItemLeft" align="right" valign="top">const static U&#160;</td><td class="memTemplItemRight" valign="bottom"><a class="el" href="namespace_a_r_common.html#ab67b42b84c068f0c4ab2401ea3af86c6">ARCommon::convert</a> (const T &amp;t)</td></tr>
<tr class="separator:ab67b42b84c068f0c4ab2401ea3af86c6"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a78fc93a50ebb387050bae7d69d2a8cce"><td class="memItemLeft" align="right" valign="top">const static ofMatrix4x4&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespace_a_r_common.html#a78fc93a50ebb387050bae7d69d2a8cce">ARCommon::toMat4</a> (const matrix_float4x4 &amp;mat)</td></tr>
<tr class="memdesc:a78fc93a50ebb387050bae7d69d2a8cce"><td class="mdescLeft">&#160;</td><td class="mdescRight">convert to oF mat4 <a href="namespace_a_r_common.html#a78fc93a50ebb387050bae7d69d2a8cce">More...</a><br /></td></tr>
<tr class="separator:a78fc93a50ebb387050bae7d69d2a8cce"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:ad6930ed2b61bca10da347b8bb398d3b8"><td class="memItemLeft" align="right" valign="top">const matrix_float4x4&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespace_a_r_common.html#ad6930ed2b61bca10da347b8bb398d3b8">ARCommon::toSIMDMat4</a> (ofMatrix4x4 &amp;mat)</td></tr>
<tr class="memdesc:ad6930ed2b61bca10da347b8bb398d3b8"><td class="mdescLeft">&#160;</td><td class="mdescRight">convert to simd based mat4 <a href="namespace_a_r_common.html#ad6930ed2b61bca10da347b8bb398d3b8">More...</a><br /></td></tr>
<tr class="separator:ad6930ed2b61bca10da347b8bb398d3b8"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a7ea27fb9de7e7890d46de5bea9b535e6"><td class="memItemLeft" align="right" valign="top">static const static ofMatrix4x4&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespace_a_r_common.html#a7ea27fb9de7e7890d46de5bea9b535e6">ARCommon::toMat4</a> (const matrix_float4x4 &amp;mat)</td></tr>
<tr class="memdesc:a7ea27fb9de7e7890d46de5bea9b535e6"><td class="mdescLeft">&#160;</td><td class="mdescRight">convert to oF mat4 <a href="namespace_a_r_common.html#a7ea27fb9de7e7890d46de5bea9b535e6">More...</a><br /></td></tr>
<tr class="separator:a7ea27fb9de7e7890d46de5bea9b535e6"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a94f59f549eb5aec3f077b54ae5e5df86"><td class="memItemLeft" align="right" valign="top">static const matrix_float4x4&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespace_a_r_common.html#a94f59f549eb5aec3f077b54ae5e5df86">ARCommon::toSIMDMat4</a> (ofMatrix4x4 &amp;mat)</td></tr>
<tr class="memdesc:a94f59f549eb5aec3f077b54ae5e5df86"><td class="mdescLeft">&#160;</td><td class="mdescRight">convert to simd based mat4 <a href="namespace_a_r_common.html#a94f59f549eb5aec3f077b54ae5e5df86">More...</a><br /></td></tr>
<tr class="separator:a94f59f549eb5aec3f077b54ae5e5df86"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a5a232f6315a3a5b74678034efadd5d20"><td class="memItemLeft" align="right" valign="top">static ofVec3f&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespace_a_r_common.html#a5a232f6315a3a5b74678034efadd5d20">ARCommon::getAnchorXYZ</a> (ofMatrix4x4 mat)</td></tr>
<tr class="separator:a5a232f6315a3a5b74678034efadd5d20"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:aec58705c71590506c5f1f86e927f11e1"><td class="memItemLeft" align="right" valign="top">static ofMatrix4x4&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespace_a_r_common.html#aec58705c71590506c5f1f86e927f11e1">ARCommon::modelMatFromTransform</a> (matrix_float4x4 transform)</td></tr>
<tr class="memdesc:aec58705c71590506c5f1f86e927f11e1"><td class="mdescLeft">&#160;</td><td class="mdescRight">Constructs a generalized model matrix for a SIMD mat4. <a href="namespace_a_r_common.html#aec58705c71590506c5f1f86e927f11e1">More...</a><br /></td></tr>
<tr class="separator:aec58705c71590506c5f1f86e927f11e1"><td class="memSeparator" colspan="2">&#160;</td></tr>
Expand All @@ -113,8 +117,27 @@
<tr class="memitem:a5c33a5f3620614da8b3be53f6811d7ca"><td class="memItemLeft" align="right" valign="top">static float&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespace_a_r_common.html#a5c33a5f3620614da8b3be53f6811d7ca">ARCommon::getAspectRatio</a> ()</td></tr>
<tr class="memdesc:a5c33a5f3620614da8b3be53f6811d7ca"><td class="mdescLeft">&#160;</td><td class="mdescRight">Returns the aspect ratio in points. <a href="namespace_a_r_common.html#a5c33a5f3620614da8b3be53f6811d7ca">More...</a><br /></td></tr>
<tr class="separator:a5c33a5f3620614da8b3be53f6811d7ca"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:a9cd9f43005e2612ab5054dc3aec90fcf"><td class="memItemLeft" align="right" valign="top">static ofVec2f&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespace_a_r_common.html#a9cd9f43005e2612ab5054dc3aec90fcf">ARCommon::worldToScreen</a> (ofPoint worldPoint, ofMatrix4x4 projection, ofMatrix4x4 view)</td></tr>
<tr class="separator:a9cd9f43005e2612ab5054dc3aec90fcf"><td class="memSeparator" colspan="2">&#160;</td></tr>
<tr class="memitem:acc8f469a4596dc7173993ce58068bd2d"><td class="memItemLeft" align="right" valign="top">static ofVec4f&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="namespace_a_r_common.html#acc8f469a4596dc7173993ce58068bd2d">ARCommon::screenToWorld</a> (ofVec3f position, ofMatrix4x4 projection, ofMatrix4x4 mvMatrix)</td></tr>
<tr class="memdesc:acc8f469a4596dc7173993ce58068bd2d"><td class="mdescLeft">&#160;</td><td class="mdescRight">Convert screen position to a world position. <a href="namespace_a_r_common.html#acc8f469a4596dc7173993ce58068bd2d">More...</a><br /></td></tr>
<tr class="separator:acc8f469a4596dc7173993ce58068bd2d"><td class="memSeparator" colspan="2">&#160;</td></tr>
</table>
<h2 class="groupheader">Macro Definition Documentation</h2>
<a id="ad331f6e0982862a12a66503c7e12334e"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ad331f6e0982862a12a66503c7e12334e">&#9670;&nbsp;</a></span>ARToolkitComponents_h</h2>

<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">#define ARToolkitComponents_h</td>
</tr>
</table>
</div><div class="memdoc">

</div>
</div>
<a id="ab06e1eb2e9bf38e0d452b1f796aed208"></a>
<h2 class="memtitle"><span class="permalink"><a href="#ab06e1eb2e9bf38e0d452b1f796aed208">&#9670;&nbsp;</a></span>STRINGIFY</h2>

Expand Down
Loading

0 comments on commit b2323ec

Please sign in to comment.