TangoEventの
通知コールバックはエラー状態の説明などの重要なセンサーイベントを知らせます。TangoEvent
を受信するためには、onTangoEvent()
コールバックをTangoService_connectOnTangoEvent()
にアタッチします。このコールバックは、タンゴのイベントが発生するたびに呼び出されます。
TangoEventは次のように定義されます
typedef struct TangoEvent {
double timestamp;
TangoEventType type;
const char* event_key;
const char* event_value;
} TangoEvent;
timestamp
は、イベントが発生した時間を示し、他のプロジェクトタンゴのAPIのタイムスタンプと比較することができます。
The type
is designated by the TangoEventType
enumeration, and tells you which sensor triggered the event:type
はTangoEventType
の列挙体によって設計され、
イベントを発行したセンサーを知らせます
typedef enum {
TANGO_EVENT_UNKNOWN,
TANGO_EVENT_GENERAL,
TANGO_EVENT_FISHEYE_CAMERA,
TANGO_EVENT_COLOR_CAMERA,
TANGO_EVENT_IMU,
TANGO_EVENT_FEATURE_TRACKING,
} TangoEventType;
event_key
とevent_value
は発生した特定のイベントを説明します。とりうるキーのテーブルは、次のとおりです。
Event Key | Explanation |
---|---|
TangoServiceException |
サービスに例外が発生したため、テキストの説明をevent_value で与えます。 |
FisheyeOverExposed |
The fisheye image is overexposed with average pixel value event_value px.魚眼画像が露光過度です。event_valueは平均画素値 です。 |
FisheyeUnderExposed |
The fisheye image is underexposed with average pixel value event_value px.魚眼画像が露光不足です。event_value は平均画素値 です。 |
ColorOverExposed |
The color image is overexposed with average pixel value event_value px.カラー画像が露光過度です。event_valueは平均画素値 です。 |
ColorUnderExposed |
The color image is underexposed with average pixel value event_value px.カラー画像が露光不足です。event_value は平均画素値 です。 |
TooFewFeaturesTracked |
魚眼画像で追跡した特徴が少なすぎます。 event_value は追跡した特徴点の数です。 |
Unknown |
未知の記述です。 |
Based on the specific event description, you may choose to display instructions
for users to correct the circumstances leading to the event. For example, if you
are receiving ColorUnderExposed
, it is likely that the user is in an area that
is too dark for the Project Tango framework to function well.特定のイベントの記述に基づいて、イベントにつながるような状況を修正するためにユーザーへの指示を表示することもできます。たとえば、ColorUnderExposed
を受信している場合は、ユーザがプロジェクトタンゴフレームワークがうまく機能するためには暗すぎる領域である可能性が高いです。