* Copyright (C) 2023 Xiaomi Corporation
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
#pragma once
#include <uORB/uORB.h>
#define DATA_LEN (4)
******************************************************/
typedef enum {
SNAP_GESTURE_REST = 0,
SNAP_GESTURE_FINGER = 1,
SNAP_GESTURE_NUM_TYPES = 2,
SNAP_GESTURE_OTHER = 9,
} snapResult;
typedef enum {
SNAP_CTRLSTATUS_WAITING = 0,
SNAP_CTRLSTATUS_READY = 1,
SNAP_STABLE = 3,
SNAP_QUICK = 4,
SNAP_FIST_TIGHT = 5,
SNAP_WEAR_TIGHT = 6,
} snapStatus;
******************************************************/
typedef enum {
mi_fist_status_waiting = 0,
mi_fist_status_ready = 1,
mi_fist_status_error = 2,
mi_fist_status_stable = 3,
mi_fist_status_quick = 4,
mi_fist_status_fist_tight = 5,
mi_fist_status_wear_tight = 6,
} fistStatus;
typedef enum {
mi_fist_gesture_rest = 0,
mi_fist_gesture_singlefist = 1,
mi_fist_gesture_doublefist = 2,
mi_fist_gesture_singlesnapfinger = 4,
mi_fist_gesture_doublesnapfinger = 5,
mi_fist_gesture_other = 9,
} fistResult;
******************************************************/
typedef enum {
TYPE_GUESTURE_FINGER = 0,
TYPE_GUESTURE_SHAKE = 1,
TYPE_GUESTURE_WRIST = 2,
} quickResult;
******************************************************/
typedef enum {
PISON_OPEN_PLAM = 0,
PISON_POINT_FINGER = 1,
PISON_MONEY_FINGER = 2,
PISON_PINCH_FINGER = 3,
PISON_TAP_FINGER = 4,
PISON_DOUBLE_TAP_FINGER = 5,
PISON_DOUBLE_MONEY_FINGER = 6,
} HandResult;
typedef enum {
PISON_DRAG_STOP = 0,
PISON_DRAG_MOVE = 1,
} HandStatus;
******************************************************/
typedef enum {
MI_ENG_GESTURE_STATUS_DRAG_STOP = 0,
MI_ENG_GESTURE_STATUS_DRAG_RUN = 1,
} MiEngStatus;
typedef enum {
MI_ENG_GESTURE_FIST = 0,
MI_ENG_GESTURE_PINCH = 1,
MI_ENG_GESTURE_PINCHTWICE = 2,
MI_ENG_GESTURE_MONEY = 3,
MI_ENG_GESTURE_SHAKE = 4,
MI_ENG_GESTURE_WRIST = 5,
MI_ENG_GESTURE_FINGERSNAP = 6,
MI_ENG_GESTURE_OTHER = 7,
MI_ENG_GESTURE_REST = 8,
} MiEngResult;
* 自研手势不能同时订阅
******************************************************/
enum {
GUESTURE_SNAP_INSTANCE = 0,
GUESTURE_FIST_INSTANCE = 1,
GUESTURE_QUICK_INSTANCE = 2,
GUESTURE_MI_INSTANCE = 3,
GUESTURE_MI_INSTANCE1 = 4,
GUESTURE_MI_INSTANCE2 = 5,
GUESTURE_PISON_DRAG_INSTANCE = 6,
};
******************************************************/
struct algo_gesture {
uint64_t timeStamp_us;
uint8_t status;
uint8_t result;
float data[DATA_LEN];
};
ORB_DECLARE(algo_gesture);