Community
cancel
Showing results for 
Search instead for 
Did you mean: 
sam_l_1
Beginner
34 Views

案例启动失败

用realsense for   unity3D ,打开自带案例时报错:

Unable to initialize all modalities
UnityEngine.Debug:LogError(Object)
RSUnityToolkit.SenseToolkitManager:OnEnable() (at Assets/RSUnityToolkit/Internals/RealSenseInput/SenseToolkitManager.cs:346)
RSUnityToolkit.SenseToolkitManager:Update() (at Assets/RSUnityToolkit/Internals/RealSenseInput/SenseToolkitManager.cs:596)

 

为什么?求解答

0 Kudos
1 Reply
MartyG
Honored Contributor III
34 Views

I recognized the first section of code in SenseToolkitManager (line 346)..  The error appears because Unity believes that the RealSense camera is not detected.

I am less familiar with the code at line 596 but would speculate from its contents and the fact that the error was triggered after the check for the camera at line 346 that, because the camera presence check at line 346 failed, the running of the SenseToolkitManager script is paused (stopping the camera from working).

You may want to check the following things:

- The camera is listed in the Device Manager section of Windows

- The camera is connected to a USB 3.0 port on your computer and not a USB 2.0 port

- The camera works with other sample programs that came packaged with the RealSense SDK.

If you believe that the camera is functioning correctly and it is just this particular program you are running where the error is occurring, you can disable the check for the camera by editing the SenseToolkitManager script file so that when Unity checks the camera and cannot find it, it does nothing and lets the program continue to run.  Here is my guide to doing this.

**********

If you try to run the project without the camera attached though, you are likely to get the red error message "Unable to initialize all modalities".  You can bypass the camera check and enable your project to run with traditional controls by using the following method:

STEP ONE

Open the SDK script 'SenseToolkitManager' in the Unity script editor.  The fastest way to find it is to type the name into the search box of the Unity Assets panel.

STEP TWO 

Delete lines 343 to 346 and save the script.  Doing so removes the code that produces the red error if it checks for the camera and finds that it is not present.  The amended script basically says "If the camera is missing, do nothing".

1.jpg

So it should now look like this:

2.jpg

Your project should now be able to run with traditional controls without the camera being plugged in.

***********

CHINESE

我认识的代码SenseToolkitManager第一部分(346行)..出现错误,因为团结认为,未检测到相机RealSense。
我在行596不太熟悉的代码,但会从它的内容和错误是在346行检查相机,因为在346行相机存在检查失败后触发,观念的运行这一事实推测工具包管理器脚本暂停(从工作停止相机)。
您可能要检查下列事项:
- 相机在Windows的设备管理器部分上市
- 将相机连接到计算机上的U​​SB 3.0端口,而不是USB 2.0端口
- 相机的工作原理与来了打包在RealSense SDK其他示例程序。
如果您认为相机正常,它只是你正在运行的地方发生了误差,这个特殊的程序,您可以通过编辑SenseToolkitManager脚本文件,这样当团结检查相机关闭摄像机的检查,并无法找到它,它什么都不做,让程序继续运行。这里是我的指导这样做。
**********
如果您尝试运行,虽然没有附相机项目,你很可能得到红色的错误消息“无法初始化所有的方式”。您可以绕过相机检查,使您的项目通过使用以下方法传统控制运行:
步骤1
在Unity脚本编辑器中打开脚本SDK“SenseToolkitManager”。找到它的最快方法是键入名称为统一Assets面板的搜索框。
第二步
删除线343至346和保存脚本。这样做会删除,如果它检查相机产生红色的错误,并认为这是不存在的代码。修改后的剧本基本上说“如果相机丢失,什么都不做”。
所以,现在应该是这样的:
您的项目现在应该能够在没有相机被堵塞与传统的控制运行。

0 Kudos