Last Updated on : 2024-06-25 03:46:38download
The basic features of pan-tilt-zoom (PTZ) control include key control and self-check.
The PTZ module has two important threads:
Movement management thread: manages the movement of the PTZ and priority switching.
Message processing thread: handles the exchange of commands between the PTZ component and the external program.
```mermaid graph LR a("Movement processing thread") -- --> b("External") -- --> c("The message processing thread parses the message") c -- --> a c -- --> b ```
Drive the motor to move in the direction of self-check at the maximum step size to reach the limit position, and then reset the current coordinates to zero.
```mermaid graph TD a("Initialize the self-check module") --> b("Determine the self-check type") --> c("Horizontal self-check only") --> d("Return coordinates") --> e("Privacy mode") --> f("Not return coordinates") --> g("End") --> h("Vertical self-check only") --> --> i("A complete self-check") --> --> j("Panorama stitching") --> --> --> k("Other") --> l("Return the specified coordinates") --> g ```
Cameras with an infinite position structure require a limit switch for self-check. Drive the motor to move in the direction of self-check until reaching the limit switch, then reset the current coordinates to zero. After the self-check, the camera returns to the position before the self-check.
If this is the first self-check after power on, the camera returns to the position before power off.
If this is the first self-check after pairing, the camera returns to the home position (horizontal and vertical intermediate position).
The following snippet shows the function to customize the self-check.
/**
* @brief
* @param[in] TY_SYS_PTZ_CHECK_MODE_E Self-check mode
* @param[in] TY_SYS_PTZ_POS_TYPE_E The position the camera returns to after a patrol.
* @retval void
* @attention None.
*/
static void __ptz_check(TY_SYS_PTZ_CHECK_MODE_E mode, TY_SYS_PTZ_POS_TYPE_E back_type)
The user controls the keypad on the mobile app to send a DP command to the camera, which then moves accordingly.
The camera does not respond to key control in the following two cases:
Is this page helpful?
YesFeedbackIs this page helpful?
YesFeedback