What this Skill does
Helps integrator developers correctly write integration code that calls the four AI domain modules of the DJI Cloud API 2 Java SDK:AIBoxModule(10 methods),
OnboardAiModule(18 methods),AIInsideManageModule(9 methods),AiAlertModule(7 methods), 44 methods in total.
The four modules serve the same broad scenario (drone AI capabilities), but their responsibilities do not overlap:
AIBoxModule: manages the external AI box hardware itself (query info, install apps, export files) — pure HTTP + 1 internal STS direct uploadOnboardAiModule: manages onboard AIreal-time control and subscription(recognition on/off, thresholds, model selection, target tracking, active alerts) — all via DRCAIInsideManageModule: manages the onboard algorithm packages themselveslifecycle(list, bind devices, load/unload, private deployment upload) — pure HTTPAiAlertModule: managesconfiguration and history queries of target detection alerts(device-level switches, algorithm-level thresholds, sortie statistics, detail records) — pure HTTP
Core value: The most costly pitfalls in this domain areirregularities in method naming and parameter types——OnboardAiModule has 14 methods with a capitalized first letter (AIIdentifySet、
DrcAIAlarmStart), and 6 methods whose parameter types are snake_case classes under the generated package rather than conventional camelCase beans;AIBoxModule.getAIBoxModule()
does not log when module retrieval fails (the getters of the other three modules all log);AiAlertModule 's HTTP path has the /drc/ prefix but does not depend on the DRC link.
Fabricating these details based on general SDK intuition will inevitably lead to compilation failures or misjudgment of runtime behavior.
When to trigger
- The user wants to write code to query/manage the AI Box (info query, app list, installation, file export, file upload)
- The user wants to write code to control onboard AI recognition switches, filter conditions, score thresholds, model selection
- The user wants to write code for AI target tracking (Spotlight Zoom: box selection, confirmation, follow, stop)
- The user wants to write code to enable/disable onboard AI active alerts, configure alert models
- The user wants to write code to manage AI Inside onboard algorithms (list query, query bound devices, batch load/unload, upload private algorithm packages)
- The user wants to write code to configure AI target detection alerts (device-level switches, algorithm-level thresholds) or query alert sorties/detail records
- The user encounters related errors:
AIIdentifySetfails to compile,getAIBoxModule()returns null without logging,droneSNListcompilation error
Do not trigger:
- The user wants tocall MCP Tools directly at runtime →
cloudapi2-mcp-guide - General SDK rules (initialization, authentication, callback order, listen/cancel pairing), flight control, waypoint missions, camera/gimbal control →
cloudapi2-sdk-core - Map domain (flight areas, offline maps, unlock certificates, map elements) →
cloudapi2-map - PSDK third-party payload control (searchlight, speaker, Widget) →
cloudapi2-payload - Device lifecycle, firmware upgrade, HMS alarms (non-AI target detection alarms) →
cloudapi2-device-management - SEI/OSD telemetry, video stream →
cloudapi2-sei-osd
Module locations (first confirm which module it is attached to)
// ✅ AIBoxModule / OnboardAiModule 在 Drone 上
AIBoxModule aiBox = drone.getAIBoxModule();
OnboardAiModule onboardAi = drone.getOnboardAiModule();
// ✅ AIInsideManageModule / AiAlertModule 在 Workspace 上
AIInsideManageModule aiInside = workspace.getAIInsideManageModule();
AiAlertModule aiAlert = workspace.getAIAlertModule();
| Module | Attachment target | Number of methods (verified from source) | Capability | Detailed documentation |
|---|---|---|---|---|
AIBoxModule |
Drone |
10 | AI box information/application management (HTTP + 1 internal direct transfer) | references/ai-box.md |
OnboardAiModule |
Drone |
18 | Real-time control of AI recognition/tracking/alarms (DRC + DRC Northbound) | references/onboard-ai.md |
AIInsideManageModule |
Workspace |
9 | Onboard algorithm lifecycle management (HTTP) | references/ai-inside.md |
AiAlertModule |
Workspace |
7 | Target detection alarm configuration and query (HTTP) | references/ai-alert.md |
The four getters do not behave consistently when checking for null:
| getter | When the underlying layer is null |
|---|---|
drone.getAIBoxModule() |
Silently returns null without logging(the only exception) |
drone.getOnboardAiModule() |
On construction exception, Logger.error and returns null |
workspace.getAIInsideManageModule() |
Logger.error(TAG, "...module is null") and returns null |
workspace.getAIAlertModule() |
Logger.error(TAG, "...module is null") and returns null |
Core rules
Rule 1: InOnboardAiModule , the first letters of 14 method names are uppercase and must be called exactly as written
AIIdentifySet、AIIdentifyFilterSet、AIIdentifyScoreSet、AIIdentifyScoreModeSet、AIIdentifyScoreReset、AIModelSelect、
DrcAISpotlightZoomSet/Select/Confirm/Stop/Track、DrcAIAlarmStart/Stop、DrcAIModelsConfig—these are not camelCase naming typos;
"fixing" them to start with a lowercase letter will fail to compile. Only listenAIDataInfo/cancelListenAIDataInfo/listenDrcAIAlarmState/cancelListenDrcAIAlarmState
is normal lowercase camelCase. See references/onboard-ai.md。
Rule 2: The 6 AI recognition methods use generated to wrap snake_case parameters, not camelCase beans
AIIdentifySet/AIIdentifyFilterSet/AIIdentifyScoreSet/AIIdentifyScoreModeSet/AIIdentifyScoreReset/AIModelSelect
The parameter type is com.dji.flighthubsdk.generated.Ai*Param, and the field accessors are snake_case such as setLight_type/setScore_mode ,
do notinvent a camelCase bean wrapper class. Only DrcAISpotlightZoomSelect/DrcAIAlarmStart/DrcAIModelsConfig uses
com.dji.flighthubsdk.bean.*Params(camelCase, internally goes through FlightHubSdkConvert to convert to native). The two parameter systems must not be mixed.
Rule 3:AIBoxModule.getAIBoxModule() does not log on failure, so null checks cannot rely on logs for troubleshooting
Unlike the getters of the other three modules,drone.getAIBoxModule() directly returns the cached null when the underlying module is null, without Logger.error.
The business layer must explicitly check for null and provide a prompt; it cannot rely on searching logs to locate the problem.
Rule 4: TheAiAlertModule path has the /drc/paas/v2/ prefix, but does not depend on the DRC link
AiAlertModule All 6 business methods ofdo not need connectDrcLink. Seeing /drc/ in the path and adding a DRC prerequisite check is a misjudgment.
Rule 5: The three groups of methodsAIBoxModule - fetchXxxProgress are one-off queries, not listen/cancel subscriptions
fetchAppListProgress/exportFileProgress/installAppProgress is essentially another HTTP query; the caller must write its own polling loop.
It is not a long-lived subscription and has no corresponding cancel method.
Rule 6: Bean field naming has several irregular capitalizations; check the source before copying
OperateAIInsideModelParam.droneSNList(SNis all uppercase)—notdroneSnListPostAiAlertDeviceSettingParam.enableTargetAlert's getter isisEnableTargetAlert()—notgetEnableTargetAlert()GetAiAlertRecordsParam.flightIdisList<String>but the field name is singular—notflightIds/flightIdList
See the field tables in each references/ file.
Decision tree routing
用户问题
├─ AI Box 信息查询 / 应用列表 / 安装 / 导出文件 / 上传文件
│ → references/ai-box.md
├─ 机载 AI 识别开关 / 过滤 / 分数阈值 / 模型选择
│ → references/onboard-ai.md#2-ai-识别开关过滤阈值6-个-action
├─ AI 目标跟踪(框选 / 确认 / 跟随 / 停止)
│ → references/onboard-ai.md#3-drc-ai-spotlight-zoomai-跟踪5-方法
├─ AI 主动告警开启/关闭/模型配置(机载 DRC 侧)
│ → references/onboard-ai.md#4-drc-ai-alarm主动告警3-方法--1-对订阅
├─ AI 数据订阅 / AI 告警状态推送(DRC Northbound)
│ → references/onboard-ai.md#1-ai-数据订阅1-对-listencancel
├─ AI Inside 机载算法列表 / 绑定设备 / 批量装载卸载
│ → references/ai-inside.md
├─ 私有化场景算法包上传(STS / 直传)
│ → references/ai-inside.md#私有化场景上传算法两条路径不要混用
├─ AI 目标检测告警配置(设备级开关 / 算法级阈值)
│ → references/ai-alert.md#两层配置设备级--算法级
├─ 告警架次统计 / 告警明细记录查询
│ → references/ai-alert.md#查询告警架次与明细两段式不要混用
├─ `getAIBoxModule()`/其它 getter 返回 null 排查
│ → 本文件「规则 3」
└─ 要调 MCP 工具做运维(不写代码)
→ 转交 cloudapi2-mcp-guide
Workflow
This Skill follows the 7-chapter SOP defined in skills/_shared/sop-template.md and automatically selects the tier by L1/L2/L3.
Ch2 Clarifying questions
Points that must be clarified for AI domain requirements (missing one may lead to incorrect implementation):
- Which module is the target: AI Box hardware management, onboard AI real-time control, algorithm lifecycle management, or alarm configuration/query—the responsibilities of these four do not overlap, and choosing the wrong module will lead you in the wrong direction
- Whether a DRC link is required:
OnboardAiModuleaction method requires firstconnectDrcLink;AIBoxModule/AIInsideManageModule/AiAlertModulenot required - Whether it is a production environment scenario or a private deployment scenario:
AIInsideManageModulethree algorithm upload methods (create/file-upload/upload) are only used in private deployment scenarios - Whether querying real-time status or historical records: The alarm domain distinguishes "device-level switch query" (
getDeviceSetting) from "historical sortie/detail query" (getAiAlertFlights/getAiAlertRecords)
Ch5 Encoding Constraints
See constraints.yaml; all critical rules must be satisfied when generating code; general SDK rules (initialization, authentication, null checks,
listen/cancel pairing) reference _shared/constraints-common.yamland are not repeated in this file.
Ch6 Verification Extension
In addition to general verification, code in this domain must check:
- module getter retrieves the correct object (AIBox/OnboardAi →
drone,AIInside/AiAlert →workspace), all null-checked -
OnboardAiModule14 method names starting with uppercase letters have not been "corrected" to lowercase camelCase - AI recognition 6 methods use
generatedpackage snake_case parameter classes, no fabricated camelCase beans -
OnboardAiModuleaction call is preceded byconnectDrcLinksuccess branch -
AiAlertModulecall does not attach unnecessary DRC pre-validation -
fetchAppListProgress/exportFileProgress/installAppProgressimplemented according to polling logic, not treated as a subscription -
droneSNList/isEnableTargetAlert()/flightIdand other irregular naming is not rewritten into regular camelCase guesses -
AIInsideManageModule/AiAlertModulecallsdestroy()
Anti-hallucination rules (mandatory)
- Example code must come from this Skill's references/ or user-provided documentation, and API signatures, field names, and enum values must not be generated from model memory
- It is forbidden to infer field accessors according to general camelCase rules—this domain has confirmed multiple irregular namings (
droneSNList、isEnableTargetAlert(), singularflightId), and the tables listed inreferences/must be used as the source of truth - References must be traceable—any suggestion must be traceable to a
references/documentation path or official SDK source code (core/AIBoxModule.java、core/OnboardAiModule.java、core/AIInsideManageModule.java、core/AiAlertModule.java)
Authoritative Reference
| Document | Content |
|---|---|
references/ai-box.md |
AIBoxModule all 10 methods: null-check pitfalls, two methods that deviate from the standard pattern, polling patterns for app list/export/install |
references/onboard-ai.md |
OnboardAiModule all 18 methods: uppercase naming list, two parameter systems, Spotlight Zoom tracking flow, proactive alarm flow |
references/ai-inside.md |
AIInsideManageModule all 9 methods:destroy() lifecycle, two private deployment upload paths, field naming pitfalls |
references/ai-alert.md |
AiAlertModule all 7 methods: DRC path does not depend on DRC pitfall, two-layer configuration, two-stage sortie/detail query |
skills/_shared/constraints-common.yaml |
Cross-Skill general constraints (callback/initialization/null checks) |
Shared Conventions
Cross-Skill shared constraints see
skills/_shared/constraints-common.yaml. Cross-Skill routing rules seeskills/_shared/skill-routing.md. When user intent is found to belong to another Skill's responsibility, switch according to the handover protocol. Output format seeskills/_shared/output-format.md. References are lazy-loaded on demand; do not read all references/ at once.