Items with no label
3335 Discussions

SR300 issues with Unity Toolkit - need previous SDK or working sample project

idata
Employee
2,515 Views

Hi there

I have the Razer Stargazer (with the SR300) and I'm trying to do some basic Unity tests on a Windows 10 64 bit i5 5th gen PC.

I've managed to run a few Real Sense showcased apps successfully (Wave Warrior, Lego Portal Races) and all the SR300 code samples work (from within the R3 2016 SDK browser).

I have installed the following individual components:

Intel® RealSense™ SDK 3D Scan for Windows* Version 11.0 (11.0)

Intel® RealSense™ SDK Cursor Mode for Windows* Version 11.0 (11.0)

Intel® RealSense™ SDK Essentials for Windows* Version 11.0 (11.0)

Intel® RealSense™ SDK Hand Tracking for Windows* Version 11.0 (11.0)

Intel® RealSense™ SDK User Background Segmentation for Windows* Version 11.0 (11.0)

Plus the Depth Camera Manager intel_rs_dcm_sr300_3.3.27.5718

None of the 7 Unity Toolkit samples are working on my pc.

I get these errors:

UnityException: EnsureRunningOnMainThread can only be called from the main thread

UnityEngine.Object.GetInstanceID () (at C:/buildslave/unity/build/Runtime/Export/UnityEngineObject.cs:31)

BaseAction..ctor () (at Assets/RSUnityToolkit/Internals/Actions Utils/BaseAction.cs:62)

I then tried following this guide to add the RealSense Unity Toolkit to a new project: https://software.intel.com/en-us/blogs/2015/02/13/add-realsense-to-unity

It requires me to import the RSSDK Unity Toolkit into my project, but I can't find the RSUnityToolkit.unitypackage in C:\Program Files (x86)\Intel\RSSDK\framework\Unity.

The R3 Essentials Release Notes state that the Unity toolkit isn't supported in R3. Use R2 instead. Can you advise where I can download R2 of the SDK from?

The download link on this page does not work: https://software.intel.com/en-us/blogs/2016/05/21/new-r2

If anyone has a code sample for the SR300 that works on Unity 5.4.2ft I'd really appreciate it to give acme a head start.

I'd really appreciate the assistance as I'm spinning at the moment and would love to be able to successfully showcase RealSense technology into a hardware display solution I'm developing.

Thanks

Zaid

0 Kudos
11 Replies
idata
Employee
1,040 Views

I saw a link to the previous SDK posted on the forum on 12 Dec ( http://registrationcenter-download.intel.com/akdlm/irc_nas/vcp/9078/intel_rs_sdk_offline_package_10.0.26.0396.exe http://registrationcenter-download.intel.com/akdlm/irc_nas/vcp/9078/intel_rs_sdk_offline_package_10.0.26.0396.exe. ) but this file is downloading extremely slow (only 200kb in 30 minutes). Is the file available on another mirrored host?

Also, has anyone got a R3 Unity 5 SR 300 example to share?

Thanks

Zaid

0 Kudos
idata
Employee
1,041 Views

 

Hi Zaid,

Thanks for your interest in the Intel Realsense Platform.

The link you found in is the only we have available for older versions of the SDK.

I have also found this videos on how to get started with Unity Toolkit using the SDK: https://www.youtube.com/playlist?list=PLg-UKERBljNwzzQDKCogpenJcDvnLgQK0 Innovator Tips: Intel® RealSense™ Technology - YouTube .

Hope you find this information useful, have a nice day!

Best Regards,

 

-Jose.
MartyG
Honored Contributor III
1,040 Views

Earlier this year I published an index of the many RealSense Unity how-to guides I had written on the old RealSense forum. You might want to check it out quickly though, as I believe I read that the old forum is being retired in favor of this one and so I don't know how long those articles will be viewable!

https://software.intel.com/en-us/forums/realsense/topic/676139 Index of Marty G's RealSense Unity How-To Guides

idata
Employee
1,040 Views

Thanks all.

Finally got a working example in Unity 5.

I uninstalled the latest SDK and installed R2 ( finally managed to download it @Jose ) which has much more Unity samples for the SR300 to work with, plus the RSUnityToolkit.unitypackage

@MartyG, I followed your advice on another thread (https://software.intel.com/en-us/forums/realsense/topic/540784 Unity Plugin (RealSense Original Project) | NullReferenceException ) to install the SDK in my C:\ and not under \Program Files (x86) where the directory is protected.

The camera wouldn't initialise so I unistalled the DCM SR300 driver and rebooted.

My PC wouldn't detect the camera to re-install the driver - tried in different ports,

In Device Manager I could see the SR300 listed under my USB devices category, not Imaging. I tried to üpdate driver"" for the SR300 under USB devices and for some reason it then showed up under the Imaging Devices, which allowed me to install the DCM SR300 driver.

I created a new project in Unity 5, imported the RSUnityToolKit package and added the TrackingAction from the toolkit to a new object in my scene.

It didn't compile correctly. Then, following this guide https://www.youtube.com/watch?v=SK50ncrYq4w How to Set Up the Intel® RealSense™ SDK Toolkit in Unity* 5 - YouTube I copied the 64-bit plugin to my project and it now works successfully.

Still getting this error though, but it does not prevent me from successfully moving an object when I run the project:

UnityException: EnsureRunningOnMainThread can only be called from the main thread

UnityEngine.Object.GetInstanceID () (at C:/buildslave/unity/build/Runtime/Export/UnityEngineObject.cs:31)

BaseAction..ctor () (at Assets/RSUnityToolkit/Internals/Actions Utils/BaseAction.cs:62)

VirtualWorldBoxAction..ctor ()

TrackingAction..ctor ()

If anyone knows how to resolve this error I'd appreciate it.

Onto a little more advanced things next

If I had to install the latest version of the SDK now, would it replace R2 (particularly the Unity Toolkit package), or add additional capabilities to it?

Thanks

Zaid

0 Kudos
MartyG
Honored Contributor III
1,040 Views

I have experienced that error message a few times myself but can't recall the exact cause of it. My experience is that if you have an error that appears to be generated by a TrackingAction, the best thing to do is to remove that TrackingAction from the object, create a new TrackingAction and put your settings into it again. This is because TrackingAction sometimes breaks in the Unity editor, causing glitches such as not being able to access most of its configuration options. Running the project when the TrackingAction is like that causes an error.

As for using R3 with Unity, I would recommend sticking with R2 until the latest SDK is stable with Unity. This is because R3 is structured differently from previous SDKs, as it takes a modular approach instead of providing all the features in one package. For example, Face Tracking is apparently not in R3 yet, but it is in R2. Also, the Unity Toolkit apparently does not work in R3 now. When I tried upgrading my project to R3, I got a mass of red errors and had to rollback to R2.

According to an official post on this forum about the new R3 SDK, "Other packages, such as Blob Tracking, Speech, Touchless Controller, RealSense Web Runtime, and Java support, have been deprecated and are only available in previous versions of the RealSense SDK."

idata
Employee
1,040 Views

 

Hi Zaid,

 

 

Please follow MartyG suggestions. Also as he stated, I would recommend to stick with the R2 for now, as Unity Toolkit doesn't work with the R3.

 

 

Have a nice day!

 

 

Best Regards,

 

-Jose.

 

idata
Employee
1,040 Views

Thanks Jose and MartyG!

Continuing with R2 for now and I've made a lot of progress (for someone who is learning to code in Unity for the 1st time this week).

I've had a look at @MartyG 's tutorials - informative reading.Hope this isn't removed forever when that part of the site is archived (useful for future developers).

I'm actually building 360 degree physical hardware displays (my startup) at the moment and wanted to incorporate a motion tracking solution into it.

I've studied the Tracking Action sample and managed to re-create it withing a 180 degree Field of View scene (that utilises 4 cameras).

I've got a basic throw-a-sphere at a bulls-eye example working for now https://www.youtube.com/watch?v=fNPNU2c9TRM Intel RealSense300 Tracking Action in Unity 5 with 180 degree FOV scene - YouTube

Still a bit of trial-and-error selecting the optimal settings for the virtual world box and sensitivity

Cheers!

0 Kudos
MartyG
Honored Contributor III
1,040 Views

Glad the tutorials were useful to you, Zaidmo! I have their text and images archived offline, so they would not be completely lost if the old RealSense forum they are published on went bye-bye. It would mostly be a question of the labor involved in re-publishing them on another platform. Most of the content - especially those relating to TrackingActions - will probably become redundant from SDK R3 onwards anyway, considering that it is such a departure from R2. I'm always happy to answer specific help requests posted on the forum if I am able to though.

Your mentioning of your sphere throwing project reminded me of a guide I recently read on the Gamasutra game developer site about throwing objects accurately in VR. I dug up the link for you.

http://www.gamasutra.com/blogs/CharlieDeck/20161118/285808/Why_Throwing_in_VR_Sucksand_How_to_Make_it_Better.php Gamasutra: Charlie Deck's Blog - Why Throwing in VR Sucks--and How to Make it Better

0 Kudos
idata
Employee
1,040 Views

Hi Zaid,

 

 

I'm glad to hear that you are making progress with the Unity Toolkit! If you have any more questions, please don't hesitate to contact us.

 

 

Have a nice day!

 

 

Best Regards,

 

-Jose.
0 Kudos
JDill1
New Contributor I
1,040 Views

Is there any time frame for supported samples for Unity 5.x to ship with R3 ? When is the R3 Unity Toolkit going to be available?

0 Kudos
MartyG
Honored Contributor III
1,040 Views

As far as I am aware, the Unity Toolkit has barely been updated since the early days of RealSense in 2014. So it seems unlikely that there will be an official fix in the short term for it to work with the R3 SDK. The toolkit works fine with the previous R2 SDK though. If you are developing a Unity application with RealSense, there is not yet a compelling reason to upgrade from R2 to R3. Performance increases with the camera in Unity tend to come from better code in Unity's latest releases rather than improvements in the SDK files.

0 Kudos
Reply