# 什么是感知应用？

> **弃用通知**
> 此页面描述的功能已在Luxonis Hub中移除或替换。功能可能受限，仅对Hub原始客户可用。请参考最新指南来配置设备、管理集群和部署应用。

感知应用是Luxonis Hub生态系统的基石，使开发者能够在设备集群中部署和管理复杂的感知与AI应用。这些应用专为在Luxonis
Hub代理上运行而设计，利用OAK相机的强大功能提供先进的感知能力。感知应用主要使用Python编写，并利用robothub库与depthai配合，提供从开发到部署的简化路径，强调易用性、可扩展性和可靠性。

## 感知应用的工作原理

感知应用无缝集成到Luxonis Hub平台，遵循从开发到部署再到运行的完整生命周期。其工作原理如下：

### 开发

开发者使用Python编写感知应用，通过robothub库与云端交互，并利用depthai进行相机操作。这些应用被容器化，确保在所有设备上提供一致的运行环境。无论部署规模如何，容器化对于维持应用的稳定性和兼容性至关重要。

### cloud.perception-apps.development.toml

```toml
[config]
height = 500

[[nodes]]
id = "developer"
type = "text"
position.x = -300
position.y = 10
style.width = 200
style.fontSize = '1.3rem'
data.text = "Developer"

[[nodes]]
id = "developer_web_browser"
type = "input"
sourcePosition = "right"
position.x = -300
position.y = 180
style.width = 200
data.label = "Web Browser"
data.badge = "IDE"

[[nodes]]
id = "robot"
type = "standalone"
position.x = 0
position.y = 50
style.width = 350
style.height = 450

[[nodes]]
id = "app"
type = "standalone"
position.x = 25
position.y = 100
style.width = 300
style.height = 280
style.border = "none"
style.backgroundColor = "var(--colors-brand-50)"

[[nodes]]
id = "robothub_studio"
type = "output"
targetPosition = "left"
position.x = 50
position.y = 190
style.width = 250
data.label = "Luxonis Hub Studio"

[[nodes]]
id = "container_text"
type = "text"
position.x = 50
position.y = 115
style.width = 250
data.text = "Container"
data.badge = "Runtime"

[[nodes]]
id = "python_app"
type = "custom_handles"
position.x = 50
position.y = 270
style.width = 250
data.label = "Python Code"
data.badge = "Your business logic"

[[nodes.handles]]
type = "source"
position = "right"
id = "python_app_right"

[[nodes.handles]]
type = "source"
position = "bottom"
id = "python_app_bottom"

[[nodes]]
id = "agent"
type = "output"
position.x = 50
position.y = 410
style.width = 250
data.label = "Luxonis Hub Agent"

[[nodes]]
id = "robot_text"
type = "text"
position.x = 0
position.y = 10
style.width = 350
style.fontSize = '1.3rem'
data.text = "Robot"

[[nodes]]
id = "oak"
type = "output"
targetPosition = "left"
position.x = 400
position.y = 260
style.width = 100
data.imageSrc = "hardware/oak-d-pro.webp"

[[nodes]]
id = "oak_text"
type = "text"
position.x = 400
position.y = 10
style.width = 100
style.fontSize = '1.3rem'
data.text = "OAK"

[[edges]]
id = "developer_web_browser__robothub_studio"
source = "developer_web_browser"
target = "robothub_studio"
zIndex = 100

[[edges]]
id = "python_app__agent"
source = "python_app"
sourceHandle = "python_app_bottom"
target = "agent"
zIndex = 100

[[edges]]
id = "python_app__oak"
source = "python_app"
sourceHandle = "python_app_right"
target = "oak"
zIndex = 100
```

### 部署

感知应用开发完成后，开发者将其上传至Luxonis Hub。该过程包括在平台上创建新的应用条目，并上传容器化的应用包。Luxonis Hub会维护每个应用的版本列表/历史记录，便于轻松管理和版本控制。
