Upgrading your App to work with Structure Sensor Mark II: STCaptureSession or STSensorController


#1

Upgrading your existing Structure Sensor application

If you already have an existing Structure Sensor app, upgrading it to use Mark II and straightforward. Our engineers have worked extremely hard to make sure that this upgrade process is as easy as possible.

Option 1 - easier to upgrade, but doesn’t take advantage of certain things and you won’t have access to certain features, like Wide vision lens detection, future IMU and Ultra-wide angle camera support.

  1. Open the existing app’s Xcode project.

  2. In the Project Manager Tab, go to Frameworks:

  3. Delete Structure.framework.

  4. Click Remove Reference.

  5. Open a sample application found within Structure SDK (iOS) 1.0.0.

  6. In the Project Manager Tab, go to Frameworks:

  7. Drag the new Structure.framework into the Frameworks folder in your existing app.

  8. Build app:

  9. There shouldn’t be any errors if STCaptureSession, but there might be new warnings that might have to be handled.

  10. Launch app to see if it works correctly.

  11. Take a look at this forum post [Forum Post URL] to take an in-depth view of the new presets and options for Structure Sensor Mark II.

  12. STStreamPresets can be used to change the settings to widely used use-cases, like Room or Body scanning

  13. STCaptureSessionSensorAnalogGainMode is used to change the gain on the infrared cameras.

  14. STCaptureSessionSensorExposureMode is used to change the exposure on the infrared cameras.

Option 2 - Convert your app from STSensorController to STCaptureSession to take advantage of all upcoming new features

  1. Open the existing app’s Xcode project

  2. Take the new structure .framework and drop it into your app,

  3. Look between the samples to compare Samples/Samples Low Level to get a better understanding of STCaptureSession.

  4. Remove code that is represented in the following two files within our sample apps: ViewController+Sensor, ViewController+Camera.

  5. Sensor Controller → ViewController+Sensor controls the iOS Sensor stuff in it

  6. Sensor Controller → ViewController+Camera iOS Camera

  7. You will replace both these files with a unified ViewController+CaptureSession

  8. The thing to look at here STCaptureSession helps you control both, with less than ½ the code. No functionality is lost, as well!

  9. You’ll need to go through and pull out STSensorController and upgrade to STCaptureSession

  10. See the map below for details on how delegates from STSensorController are now handled with STCaptureSession.

For more specifics on upgrading your app to STCaptureSession, please see the following forum post: Converting to STCaptureSession using Scanner Sample App as an example.


Meet Structure Sensor Mark II