README.md

To connect to the SIYI gimbal camera link this library, include sdk.h (core header file) to your project and create SIYI_SDK class object with camera’s IP address as a single argument, e.g. SIYI_SDK sdk("192.168.144.25").


To control gimbal camera through class methods use created object, e.g. sdk.request_photo(). Below is the list of currently released and supported control methods.

Request methods:

  • request_firmware_version() sends a request to obtain camera’s firmware versions.

  • request_hardware_id() sends a request to obtain camera’s unique hardware ID.

  • request_autofocus() sends a request for camera to turn on autofocus mode.

  • request_zoom_in() sends a request for camera to zoom in. It will keep zooming in until request_zoom_halt() is called.

  • request_zoom_out() sends a request for camera to zoom out. It will keep zooming out until request_zoom_halt() is called.

  • request_zoom_halt() sends a request for camera to halt either zooming in or out.

  • request_maximum_zoom() sends a request for camera to obtain camera’s maximum zoom level defined by integer and fractional values.

  • request_focus_far() sends a request for camera to lengthen its focus. It will keep lengthening its focus until request_focus_halt() is called.

  • request_focus_close() sends a request for camera to shorten its focus. It will keep shortening its focus until request_focus_halt() is called.

  • request_focus_halt() sends a request for camera to halt either lengthening or shortening its focus.

  • request_gimbal_center() sends a request for camera to set its yaw and pitch angles to 0 values.

  • request_gimbal_info() sends a request to obtain camera’s recording state, mounting direction and motion mode.

  • request_lock_mode() sends a request for camera to enter lock mode.

  • request_follow_mode() sends a request for camera to enter follow mode.

  • request_fpv_mode() sends a request for camera to enter FPV mode.

  • request_function_feedback() sends a request to obtain camera’s feedback information.

  • request_photo() sends a request for camera to take photo and save it on microSD card if present.

  • request_record() sends a request for camera to start a recording or stop it if requested again. The video will then be saved on microSD card if present.

  • request_gimbal_attitude() sends a request to obtain camera’s current yaw, pitch and roll attitude angles.

Set methods:

  • set_absolute_zoom(int integer, int fractional) sends a request for camera to zoom into specific absolute zoom level defined by integer and fractional values, e.g. sdk.set_absolute_zoom(5, 9) zooms into 5.9X level.

  • set_gimbal_speed(int yaw_speed, int pitch_speed) sends a request for camera to start rotating in both yaw and pitch axes with given speeds. Speed values are in 0..100 range, where 100 rotates camera with maximum speed and 0 halts rotation.

  • set_gimbal_angles(float yaw, float pitch) sends a request for camera to set specific yaw and pitch angles. Values are given in degrees, where yaw is in -135,0..135,0 range and pitch is in -90,0..25,0 range.

Get methods:

  • get_firmware_version() returns a tuple of 3 strings containing camera’s code board version, gimbal firmware version and zoom firmware version. request_firmware_version() should be called and acknowledged in order for this method to return proper values.

  • get_hardware_id() returns a string containing camera’s gimbal hardware ID. request_hardware_id() should be called and acknowledged in order for this method to return proper value.

  • get_zoom_level() returns a float value containing camera’s current zoom level. Updates whenever manual zoom command is used.

  • get_maximum_zoom() returns a float value containing camera’s maximum zoom level (e.g. 30.0 for ZR10).

  • get_recording_state() returns an integer value that corresponds to the camera’s recording state. 0 if the recording is offline. 1 if the recording is online. 2 if microSD card is missing. 3 if data is corrupted. request_gimbal_info() should be called to update recording state.

  • get_motion_mode() returns an integer value that corresponds to the camera’s motion mode. 0 stands for lock mode. 1 stands for follow mode. 2 stands for FPV mode. request_gimbal_info() should be called to update motion mode.

  • get_mounting_direction() returns an integer value that corresponds to the camera’s mounting direction. 1 stands for normal. 2 stands for upside down. request_gimbal_info() should be called and acknowledged in order for this method to return proper value.

  • get_function_feedback() returns an integer value that corresponds to the camera’s feedback information. 0 stands for command delivery success. 1 stands for photo failure. 2 stands for HDR on. 3 stands for HDR off. 4 stands for recording failure. request_function_feedback() should be called to update feedback information.

  • get_gimbal_attitude() returns a tuple of 3 float values containing camera’s yaw, pitch and roll attitude angles. Values are updated whenever request_gimbal_attitude() is acknowledged by the gimbal camera successfully.

  • get_gimbal_attitude_speed() returns a tuple of 3 float values containing camera’s yaw, pitch and roll attitude angular speeds. Values are updated whenever request_gimbal_attitude() is acknowledged by the gimbal camera successfully.


set_absolute_zoom(int integer, int fractional) and set_gimbal_angles(float yaw, float pitch) were not properly tested yet, thus they might not work as expected. E.g. gimbal angles control may not rely on reversed yaw angle that is being sent through the built-in SDK by default.

Latest firmware package (from 28.08.23) has broken zoom level receiving from manual zoom commands as well as previously mentioned set_gimbal_speed(int yaw_speed, int pitch_speed) on the testing frame (ZR10). Might be fixed eventually.

Описание

A C++ library that can be used to connect to SIYI gimbal cameras (e.g. A8 mini) and control them via UDP using in-built SDK capabilities. More info on official in-built SDK is on Google Drive linked below (User Manual - Section 3.3)

Конвейеры
0 успешных
0 с ошибкой