Class TofArTofManager
ToFカメラとの接続を管理する
下記機能を有する
- ToFカメラとの接続管理
- Depthデータの取得
- Confidenceデータの取得
- PointCloudデータの取得
- DepthデータのTexture2D変換
- ConfidenceデータのTextture2D変換
- ストリーム開始イベント通知
- ストリーム終了イベント通知
- フレーム到着通知
- ストリーム異常停止検出通知
- ToFカメラ搭載有無の確認
- カメラキャリブレーション情報の管理
- 録画ファイルの再生
Inheritance
Inherited Members
Namespace: TofAr.V0.Tof
Assembly: TofArTofAssembly.dll
Syntax
public class TofArTofManager : Singleton<TofArTofManager>, IStreamStoppable, IDisposable, IStreamHolder, IDependedManager
Fields
autoloadCalibration
true: Start時にAutoCalibアプリで計測したカメラ内部パラメータを自動ロードする
false: Start時にカメラ内部パラメータをロードしない
デフォルト値:true
Declaration
public bool autoloadCalibration
Field Value
Type |
---|
System.Boolean |
autoStart
trueの場合、アプリケーション開始時に自動的にToFデータのストリームを開始する
Declaration
public bool autoStart
Field Value
Type |
---|
System.Boolean |
autoSwitchColorCameraId
true: TofとColor同時ストリームの場合Colorカメラを自動変更する
false: Colorカメラを自動変更しない
デフォルト値: true
Declaration
[HideInInspector]
public bool autoSwitchColorCameraId
Field Value
Type |
---|
System.Boolean |
CalibrationSettingsFailed
カメラキャリブレーション設定ロード失敗通知
Declaration
public TofArTofManager.CalibrationSettingsFailedEventHandler CalibrationSettingsFailed
Field Value
Type |
---|
TofArTofManager.CalibrationSettingsFailedEventHandler |
CalibrationSettingsLoaded
カメラキャリブレーション設定ロード通知
Declaration
public TofArTofManager.CalibrationSettingsLoadedEventHandler CalibrationSettingsLoaded
Field Value
Type |
---|
TofArTofManager.CalibrationSettingsLoadedEventHandler |
cameraSynchronization
ToFカメラとColorカメラの同期設定を指定する
デフォルト値:Master
Declaration
public CameraSynchronization cameraSynchronization
Field Value
Type |
---|
CameraSynchronization |
defaultColorHeight
カメラキャリブレーション情報ロード時に使用するデフォルトColorカメラ解像度Height。デフォルト値:720
Declaration
public int defaultColorHeight
Field Value
Type |
---|
System.Int32 |
defaultColorId
カメラキャリブレーション情報ロード時に使用するデフォルトColorカメラID。デフォルト値:"0"
Declaration
public string defaultColorId
Field Value
Type |
---|
System.String |
defaultColorWidth
カメラキャリブレーション情報ロード時に使用するデフォルトColorカメラ解像度Width。デフォルト値:1280
Declaration
public int defaultColorWidth
Field Value
Type |
---|
System.Int32 |
SetDefaultStreamDelay
遅延フレーム数デフォルト復帰時通知
Declaration
public TofArTofManager.SetDefaultStreamDelayEventHandler SetDefaultStreamDelay
Field Value
Type |
---|
TofArTofManager.SetDefaultStreamDelayEventHandler |
timeToDetectStreamUnexpectedStop
ストリーム異常停止とみなすまでの停止時間(秒)
デフォルト値:1.5
Declaration
public float timeToDetectStreamUnexpectedStop
Field Value
Type |
---|
System.Single |
Properties
CalibrationSettings
カメラキャリブレーション情報
Declaration
public CalibrationSettingsProperty CalibrationSettings { get; set; }
Property Value
Type |
---|
CalibrationSettingsProperty |
CalibrationSettingsStatus
カメラキャリブレーション情報の状態
Declaration
public TofArTofManager.CalibrationSettingsStatusType CalibrationSettingsStatus { get; }
Property Value
Type |
---|
TofArTofManager.CalibrationSettingsStatusType |
ConfidenceData
最新のConfidenceデータ
Declaration
public ConfidenceData ConfidenceData { get; }
Property Value
Type |
---|
ConfidenceData |
ConfidenceTexture
Confidenceデータを変換したTexture2D
Declaration
public Texture2D ConfidenceTexture { get; }
Property Value
Type |
---|
UnityEngine.Texture2D |
DepthData
最新のDepthデータ
Declaration
public DepthData DepthData { get; }
Property Value
Type |
---|
DepthData |
DepthTexture
Depthデータを変換したTexture2D
Declaration
public Texture2D DepthTexture { get; }
Property Value
Type |
---|
UnityEngine.Texture2D |
DesiredFrameRate
設定希望FPS。設定は次回ストリーミング開始時に有効となる。
Declaration
public float DesiredFrameRate { get; }
Property Value
Type |
---|
System.Single |
FrameRate
実測FPS
Declaration
public float FrameRate { get; }
Property Value
Type |
---|
System.Single |
IsPlaying
trueの場合、録画ファイルを再生している
Declaration
public bool IsPlaying { get; }
Property Value
Type |
---|
System.Boolean |
IsProcessTexture
trueの場合データのTexture2D変換処理を行っている
Declaration
[Obsolete("IsProcessTexture is deprecated, please use ProcessTexture instead")]
public bool IsProcessTexture { get; }
Property Value
Type |
---|
System.Boolean |
IsStreamActive
trueの場合ストリーミングを行っている
Declaration
public bool IsStreamActive { get; }
Property Value
Type |
---|
System.Boolean |
PointCloudData
最新のPointCloudデータ
Declaration
public PointCloudData PointCloudData { get; }
Property Value
Type |
---|
PointCloudData |
ProcessTargets
処理対象のチャネルを取得する
Declaration
public ProcessTargetsProperty ProcessTargets { get; }
Property Value
Type |
---|
ProcessTargetsProperty |
ProcessTexture
trueの場合データのTexture2D変換処理を行っている
Declaration
public bool ProcessTexture { get; }
Property Value
Type |
---|
System.Boolean |
Stream
ストリーム
Declaration
public Stream Stream { get; }
Property Value
Type |
---|
SensCord.Stream |
StreamDelay
フレームの送出を指定フレーム数遅延させる
Declaration
public int StreamDelay { get; set; }
Property Value
Type |
---|
System.Int32 |
StreamPlay
再生ストリーム
Declaration
public Stream StreamPlay { get; }
Property Value
Type |
---|
SensCord.Stream |
Version
コンポーネントのバージョン番号
Declaration
public string Version { get; }
Property Value
Type |
---|
System.String |
Methods
AddManagerDependency(IDependManager)
依存Managerを追加する
Declaration
public void AddManagerDependency(IDependManager dependManager)
Parameters
Type | Name | Description |
---|---|---|
IDependManager | dependManager | 依存Manager |
CheckDevice()
ToFカメラが端末に搭載されているか確認する
Declaration
public bool CheckDevice()
Returns
Type | Description |
---|---|
System.Boolean | true:ToFカメラが端末に搭載されている。false:ToFカメラが端末に搭載されていない |
ClearLoadedSettings()
キャリブレーション設定リストをクリアする
Declaration
public void ClearLoadedSettings()
Dispose()
破棄処理
Declaration
public void Dispose()
Dispose(Boolean)
破棄処理
Declaration
public void Dispose(bool ignoreEventRelease)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | ignoreEventRelease | trueの場合、イベントハンドラのクリアをスキップする |
GetProperty<T>()
コンポーネントプロパティを取得する
Declaration
public T GetProperty<T>()
where T : class, IBaseProperty, new()
Returns
Type | Description |
---|---|
T | プロパティクラス |
Type Parameters
Name | Description |
---|---|
T | IBaseProperty継承クラス |
GetProperty<T>(T)
コンポーネントプロパティを取得する。入力パラメータvalueを指定可能。
Declaration
public T GetProperty<T>(T value)
where T : class, IBaseProperty
Parameters
Type | Name | Description |
---|---|---|
T | value | 入力パラメータ |
Returns
Type | Description |
---|---|
T | プロパティクラス |
Type Parameters
Name | Description |
---|---|
T | IBaseProperty継承クラス |
GetProperty<T>(T, Int32)
シリアライズ用バッファサイズを指定してコンポーネントプロパティを取得する。入力パラメータvalueを指定可能。
Declaration
public T GetProperty<T>(T value, int bufferSize)
where T : class, IBaseProperty, new()
Parameters
Type | Name | Description |
---|---|---|
T | value | 入力パラメータ |
System.Int32 | bufferSize | シリアライズ用バッファサイズ |
Returns
Type | Description |
---|---|
T | プロパティクラス |
Type Parameters
Name | Description |
---|---|
T | BaseProperty継承クラス |
GetPropertyList()
Propertyリストを取得する
Declaration
public string[] GetPropertyList()
Returns
Type | Description |
---|---|
System.String[] | Propertyリスト |
LoadSettings()
キャリブレーション設定をロードする
Declaration
public CalibrationSettingsProperty LoadSettings()
Returns
Type | Description |
---|---|
CalibrationSettingsProperty | キャリブレーション設定データ |
LoadSettings(String, Int32, Int32, Boolean)
キャリブレーション設定をロードする
Declaration
public CalibrationSettingsProperty LoadSettings(string depth_id, int depth_h, int depth_w, bool reportFailure)
Parameters
Type | Name | Description |
---|---|---|
System.String | depth_id | カメラID |
System.Int32 | depth_h | 縦解像度 |
System.Int32 | depth_w | 横解像度 |
System.Boolean | reportFailure | キャリブレーション読み込みが失敗した場合、通知イベントを発行するかどうか |
Returns
Type | Description |
---|---|
CalibrationSettingsProperty | キャリブレーション設定データ |
LoadSettings(String, Int32, Int32, String, Int32, Int32, Boolean)
キャリブレーション設定をロードする
Declaration
public CalibrationSettingsProperty LoadSettings(string color_cameraId, int color_h, int color_w, string depth_cameraId, int depth_h, int depth_w, bool reportFailure)
Parameters
Type | Name | Description |
---|---|---|
System.String | color_cameraId | ColorカメラID |
System.Int32 | color_h | Color縦解像度 |
System.Int32 | color_w | Color横解像度 |
System.String | depth_cameraId | DepthカメラID |
System.Int32 | depth_h | Depth縦解像度 |
System.Int32 | depth_w | Depth横解像度 |
System.Boolean | reportFailure | キャリブレーション読み込みが失敗した場合、通知イベントを発行するかどうか |
Returns
Type | Description |
---|---|
CalibrationSettingsProperty | キャリブレーション設定データ |
RegisterTofPreProcessing(IPreProcessTofData)
Tofデータ送出前処理を登録する
Declaration
public void RegisterTofPreProcessing(IPreProcessTofData preProcessTof)
Parameters
Type | Name | Description |
---|---|---|
IPreProcessTofData | preProcessTof | Tofデータ処理クラス |
RemoveManagerDependency(IDependManager)
依存Managerを削除する
Declaration
public void RemoveManagerDependency(IDependManager dependManager)
Parameters
Type | Name | Description |
---|---|---|
IDependManager | dependManager | 依存Manager |
SetProcessTargets(Boolean, Boolean, Boolean)
処理対象のチャネルを設定する
Declaration
public void SetProcessTargets(bool depth, bool confidence, bool pointCloud)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | depth | trueの場合Depthチャネルの処理を有効化する |
System.Boolean | confidence | trueの場合Confidenceチャネルの処理を有効化する |
System.Boolean | pointCloud | trueの場合PointCloudチャネルの処理を有効化する |
SetProperty<T>(T)
コンポーネントプロパティを設定する
Declaration
public void SetProperty<T>(T value)
where T : class, IBaseProperty
Parameters
Type | Name | Description |
---|---|---|
T | value | 入力パラメータ |
Type Parameters
Name | Description |
---|---|
T | IBaseProperty継承クラス |
StartPlayback(String)
指定されたパス内の録画ファイルの再生を開始する
Declaration
public void StartPlayback(string path)
Parameters
Type | Name | Description |
---|---|---|
System.String | path | 再生する録画ファイルを含むディレクトリのパス |
StartStream(Boolean)
ストリーミングを開始する
Declaration
public void StartStream(bool isProcessTexture = false)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | isProcessTexture | カメラデータのTexture2D変換処理を実施するかどうか |
StartStream(CameraConfigurationProperty, Boolean)
ストリーミングを開始する
Declaration
public void StartStream(CameraConfigurationProperty configuration, bool isProcessTexture = false)
Parameters
Type | Name | Description |
---|---|---|
CameraConfigurationProperty | configuration | ストリーミングに使用するカメラ設定 |
System.Boolean | isProcessTexture | カメラデータのTexture2D変換処理を実施するかどうか |
StartStream(CameraConfigurationProperty, List<ITofMetadataProperty>, Boolean)
ストリーミングを開始する
Declaration
public void StartStream(CameraConfigurationProperty configuration, List<ITofMetadataProperty> metadataProperties, bool isProcessTexture = false)
Parameters
Type | Name | Description |
---|---|---|
CameraConfigurationProperty | configuration | ストリーミングに使用するConfiguration |
System.Collections.Generic.List<TofAr.V0.Tof.ITofMetadataProperty> | metadataProperties | ストリーミングで使用するメタデータ |
System.Boolean | isProcessTexture | カメラデータのTexture2D変換処理を実施するかどうか |
StartStreamWithColor(CameraConfigurationProperty, Boolean)
Colorと同時にストリーミングを開始する。Colorはデフォルト解像度設定で開始する。カメラデータのTexture2D変換処理は有効となる。
Declaration
public void StartStreamWithColor(CameraConfigurationProperty tofConf, bool processTextureTof = true)
Parameters
Type | Name | Description |
---|---|---|
CameraConfigurationProperty | tofConf | ストリーミングに使用するToFカメラ設定 |
System.Boolean | processTextureTof | ToFカメラデータのTexture2D変換処理を実施するかどうか |
StartStreamWithColor(CameraConfigurationProperty, Boolean, Boolean)
Colorと同時にストリーミングを開始する。Colorはデフォルト解像度設定で開始する。
Declaration
public void StartStreamWithColor(CameraConfigurationProperty tofConf, bool processTextureTof, bool processTextureColor)
Parameters
Type | Name | Description |
---|---|---|
CameraConfigurationProperty | tofConf | ストリーミングに使用するToFカメラ設定 |
System.Boolean | processTextureTof | ToFカメラデータのTexture2D変換処理を実施するかどうか |
System.Boolean | processTextureColor | ColorカメラデータのTexture2D変換処理を実施するかどうか |
StartStreamWithColor(CameraConfigurationProperty, ResolutionProperty, Boolean, Boolean, List<ITofMetadataProperty>, List<IColorMetadataProperty>)
TofとColor同時ストリーミングを開始する
Declaration
public void StartStreamWithColor(CameraConfigurationProperty tofConf, ResolutionProperty colorConf, bool processTextureTof, bool processTextureColor, List<ITofMetadataProperty> metadataPropertiesTof = null, List<IColorMetadataProperty> metadataPropertiesColor = null)
Parameters
Type | Name | Description |
---|---|---|
CameraConfigurationProperty | tofConf | Tofストリーミングに使用するConfiguration |
ResolutionProperty | colorConf | Colorストリーミングで使用するConfiguratio |
System.Boolean | processTextureTof | TofデータのTexture2D変換処理を実施するかどうか |
System.Boolean | processTextureColor | ColorデータのTexture2D変換処理を実施するかどうか |
System.Collections.Generic.List<TofAr.V0.Tof.ITofMetadataProperty> | metadataPropertiesTof | Tofストリーミングで使用するメタデータ |
System.Collections.Generic.List<TofAr.V0.Color.IColorMetadataProperty> | metadataPropertiesColor | Colorストリーミングで使用するメタデータ |
StopPlayback()
録画ファイルの再生を停止する
Declaration
public void StopPlayback()
StopStream()
ストリーミングを停止する
Declaration
public void StopStream()
StopStream(Boolean)
ストリーミングを停止する
Declaration
public void StopStream(bool isRestart = true)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | isRestart | trueの場合はストリームを中止してすぐ再起動する、falseの場合は再起動せずに終了する |
StopStreamWithColor()
Colorと同時にストリーミングを停止する。
Declaration
public void StopStreamWithColor()
UnregisterTofPreProcessing(IPreProcessTofData)
Tofデータ送出前処理を登録解除する
Declaration
public void UnregisterTofPreProcessing(IPreProcessTofData preProcessTof)
Parameters
Type | Name | Description |
---|---|---|
IPreProcessTofData | preProcessTof | Tofデータ処理クラス |
Events
OnApplicationPausing
アプリケーション一時停止開始時
Declaration
public static event TofArTofManager.ApplicationPausingEventHandler OnApplicationPausing
Event Type
Type | Description |
---|---|
TofArTofManager.ApplicationPausingEventHandler |
OnApplicationResuming
アプリケーション復帰開始時
Declaration
public static event TofArTofManager.ApplicationResumingEventHandler OnApplicationResuming
Event Type
Type | Description |
---|---|
TofArTofManager.ApplicationResumingEventHandler |
OnAvailableConfigurationsChanged
設定リスト変更通知
Declaration
public static event TofArTofManager.AvailableConfigurationsChanged OnAvailableConfigurationsChanged
Event Type
Type | Description |
---|---|
TofArTofManager.AvailableConfigurationsChanged |
OnDetectStreamUnexpectedStop
ストリーム異常停止検出通知
Declaration
public static event TofArTofManager.DetectStreamUnexpectedStopEventHandler OnDetectStreamUnexpectedStop
Event Type
Type | Description |
---|---|
TofArTofManager.DetectStreamUnexpectedStopEventHandler |
OnFrameArrived
新しいフレームの到着通知
Declaration
public static event TofArTofManager.FrameArrivedEventHandler OnFrameArrived
Event Type
Type | Description |
---|---|
TofArTofManager.FrameArrivedEventHandler |
OnStreamStarted
ストリーミング開始通知
Declaration
public static event TofArTofManager.StreamStartedEventHandler OnStreamStarted
Event Type
Type | Description |
---|---|
TofArTofManager.StreamStartedEventHandler |
OnStreamStopped
ストリーミング終了通知
Declaration
public static event TofArTofManager.StreamStoppedEventHandler OnStreamStopped
Event Type
Type | Description |
---|---|
TofArTofManager.StreamStoppedEventHandler |