• Home
Name Date Size #Lines LOC

..--

etc/init/22-Oct-2025-5246

figures/22-Oct-2025-

interface/napi/mech_manager/22-Oct-2025-3,2502,716

sa_profile/22-Oct-2025-3330

services/22-Oct-2025-11,5108,924

test/22-Oct-2025-11,8578,310

LICENSED22-Oct-202511.1 KiB202169

OAT.xmlD22-Oct-20254.6 KiB7115

README.mdD22-Oct-20255.5 KiB7244

README_zh.mdD22-Oct-20254.7 KiB6140

bundle.jsonD22-Oct-20252.1 KiB7271

mechbody.gniD22-Oct-2025654 1715

README.md

1# Mechbody Controller
2
3## Introduction
4
5The Mechanical Device Controller provides developers with a set of APIs for discovering and controlling compatible mechanical devices, enabling seamless connectivity and precise control of target devices.
6
7The Mechbody Controller includes the following common features:
8
9- Accessory information query
10- Perception and feedback of accessory status changes
11- Controlling accessory movements
12
13## System Architecture
14
15**Figure 1** OpenHarmony Mechbody Controller Architecture<a name="fig4460722185514"></a></b>
16
17![](figures/mechanic-architecture.png)
18- **Mechanic Kit**: A set of APIs provided by the Mechanical Device Control Service, offering applications the capability to discover and control mechanical devices through standardized interfaces.
19- **Mechanical Device Control Service**: The core service of the mechanical device controller. Currently, it supports managing mechanical devices, controlling their movement by setting position trajectories and motion speeds, and directing mechanical devices to rotate and follow individuals based on camera face recognition results. Motion management capabilities for mechanical devices and the ability to control their movement based on sound direction are under planning.
20- **Universal Interconnect APP**: An optional system application for OpenHarmony devices. It is responsible for discovering and filtering mechanical devices, enabling device developers to quickly identify accessory devices that comply with the OpenHarmony mechanical control protocol, and notifying the mechanical device control service to establish connections.
21- **System Application**: A device system application developed by device developers. System applications can perform advanced control of mechanical devices, such as trajectory control and speed control.
22- **Third-Party Application**: A third-party device application developed by OpenHarmony ecosystem developers. Third-party applications can query connected mechanical control devices and control the activation and deactivation of smart tracking features, among other functions.
23- **Bluetooth Communication Service and Camera Service**: Key capabilities relied upon by the mechanical device control service. It depends on the Bluetooth communication service for Bluetooth interactions with mechanical devices and on the camera service to obtain camera parameters and target detection results from the camera.
24- **Camera Driver**: A module in the system that implements face detection. If device developers need to support the face smart tracking capability of mechanical devices, they must implement face recognition functionality in the camera driver and report face detection results through the OpenHarmony Camera HDI standard interface.
25
26## Directory Structure
27
28The repository directory structure is as follows:
29
30```shell
31distributedhardware_mechbody_controller
32├── etc             # Initialization configuration for mechbody controller service
33├── interface       # Mechbody controller interfaces and NAPI conversion
34├── sa_profile      # SA configuration for mechbody controller
35├── service         # Implementation of mechbody controller interfaces
36├── test            # Test code for mechbody controller
37```
38
39## Constraints
40
41- Mechanical devices only supports equipment from specific manufacturers.
42
43- The development must support BLE (Bluetooth Low Energy).
44
45- The development device must have camera-based face detection capability and support reporting face metadata.
46
47- For the universal connectivity app development, the download path will be provided after release.
48
49- The southbound protocol will be provided later, as it is currently in the standardization process.
50
51## Usage Guide
52
53Three major categories of functional interfaces are provided. Developers can use one or more categories based on their requirements:
54
55- Application developers can use the accessory query interface to query corresponding accessory information.
56
57- When registering for accessory status change notifications, device status changes can be monitored through callbacks.
58
59- The accessory control interface is provided, allowing users to easily develop and control accessories using the interface.
60
61## Example Tutorials
62
63We provide the [Rotation Control Development Guide](https://gitcode.com/openharmony/docs/blob/master/zh-cn/application-dev/mechanicManager/rotation-control-guide.md). System applications can perform advanced control of mechanical devices, such as trajectory control and speed control. Additionally, the [Smart Tracking Development Guide]((https://gitcode.com/openharmony/docs/blob/master/zh-cn/application-dev/mechanicManager/camera-tracking-guide.md)) (supports third-party applications) is available. Third-party applications can query connected mechanical control devices and control the activation and deactivation of smart tracking features. These resources offer richer development references, helping developers understand functional logic and improve development efficiency.
64
65## API Reference
66
67The [System API Reference](https://gitcode.com/openharmony/docs/blob/ca6a74112dca41d78b4bb2ca2612aca7d2bce450/zh-cn/application-dev/reference/apis-mechanic-kit/js-apis-mechanicManager-sys.md) and [Non-System API Reference](https://gitcode.com/openharmony/docs/blob/ca6a74112dca41d78b4bb2ca2612aca7d2bce450/zh-cn/application-dev/reference/apis-mechanic-kit/js-apis-mechanicManager.md) provide interface documentation to help developers quickly find detailed descriptions and invocation methods for specific interfaces.
68
69## Related Repositories
70
71distributedhardware_mechbody_controller
72

README_zh.md

1# 机械体设备控制器
2
3## 简介
4
5机械体设备是一个具备自主运动能力的智能机械(比如云台,机械臂,自动升降架,机械车等)。
6
7机械体设备控制器是OpenHarmony操作系统中用于控制机械体设备的模块。它提供查询机械体设备连接状态和控制机械体设备运动的接口,方便连接和控制机械体设备。
8
9机械体设备控制器包含以下常用功能:
10
11- 机械体设备信息查询。
12- 机械体设备状态查询。
13- 机械体设备运动控制。
14
15## 系统架构
16
17**图 1**  OpenHarmony机械体设备控制器架构图<a name="fig4460722185514"></a></b>
18
19![](figures/mechanic-architecture-zh.png)
20
21- **机械体设备控制服务**: 提供设备管理与运动控制核心能力,支持通过设定位置轨迹和运动速度来操控设备动作;基于摄像头人像识别结果,实现人物自动跟踪转动。后续将新增动作管理及声音方向驱动等能力。轨迹控制、速度控制、动作管理模块属于运动控制。图像跟踪、声音跟踪模块属于状态感知。设备管理模块则作为基础支撑,贯穿全系统。
22- **[通用互联APP(开发中)](https://gitcode.com/ohos-oneconnect/ohos-connect-hap)**: OpenHarmony设备的可选系统应用。负责发现和过滤机械体设备,方便设备开发者快速发现满足OpenHarmony机械体控制协议的配件设备,并通知机械体设备控制服务完成连接。
23- **Mechanic Kit**: 机械体设备控制器开发套件,是机械体设备控制服务对外提供的接口集合。它为应用提供查询机械体设备、控制机械体设备等接口能力。
24- **蓝牙通信服务和相机服务**:机械体设备控制服务依赖的关键能力。依赖蓝牙通信服务与机械体设备进行通信;依赖相机服务获取相机参数和目标检测结果。
25- **蓝牙驱动**: 实现无线通信的核心组件,包含蓝牙的通信控制协议栈,负责管理机械体设备控制器与机械体设备之间的蓝牙连接,支持数据传输、指令下发与状态反馈,确保远程控制与实时交互的稳定可靠。
26- **相机驱动**: 系统中实现人脸检测的模块,如果设备开发者需要支持机械体设备的人脸智能跟踪能力,必须在相机驱动中实现人像识别功能,并通过OpenHarmony相机HDI标准接口上报人脸检测结果。
27
28## 目录
29
30仓目录结构如下:
31
32```shell
33distributedhardware_mechbody_controller
34├── etc             # 机械体设备控制器服务初始化配置
35├── interface       # 机械体设备控制器接口及NAPI转换
36├── sa_profile      # 机械体设备控制器SA配置
37├── service         # 机械体设备控制器接口实现
38├── test            # 机械体设备控制器测试代码
39```
40
41## 约束
42
43- OpenHarmony开发设备必须支持 BLE(Bluetooth Low Energy)协议。
44- OpenHarmony开发设备的相机驱动具备摄像头人脸检测能力,支持上报人脸Metadata数据,否则人脸跟踪功能不可用。
45- 被控的机械体设备必须符合OpenHarmony MechanicKit南向协议标准(该标准待发布),如厂商已对外宣称该设备支持OpenHarmony MechanicKit。
46- [通用互联APP](https://gitcode.com/ohos-oneconnect/ohos-connect-hap)中该功能正在开发。目前,可以使用test目录下的测试Demo进行机械体设备发现,或自行开发设备发现功能。
47- 机械体设备南向协议正在标准化过程中,当前待提供。
48
49## [指南及API](https://gitcode.com/onetwothreedrink/docs/blob/master/zh-cn/application-dev/reference/apis-mechanic-kit/Readme-CN.md)
50
51## 示例教程
52机械体设备控制器模块提供了[设备转动控制开发指南](https://gitcode.com/openharmony/docs/blob/master/zh-cn/application-dev/mechanicManager/rotation-control-guide.md),系统应用可以对机械体设备进行高阶控制,如轨迹控制和速度控制等。同时提供了[智能拍摄跟踪开发指南](https://gitcode.com/openharmony/docs/blob/master/zh-cn/application-dev/mechanicManager/camera-tracking-guide.md)(支持三方应用),三方应用可以查询已连接的机械体设备,控制启动和关闭智能跟踪功能等。
53
54## API参考
55
56[系统API参考](https://gitcode.com/openharmony/docs/blob/ca6a74112dca41d78b4bb2ca2612aca7d2bce450/zh-cn/application-dev/reference/apis-mechanic-kit/js-apis-mechanicManager-sys.md)和[开放API参考](https://gitcode.com/openharmony/docs/blob/ca6a74112dca41d78b4bb2ca2612aca7d2bce450/zh-cn/application-dev/reference/apis-mechanic-kit/js-apis-mechanicManager.md)分别提供了接口的说明文档,可以帮助开发者快速查找到指定接口的详细描述和调用方法。
57
58## 相关仓
59
60distributedhardware_mechbody_controller
61