5.4.9 智能盒子
功能介绍
智能盒子 App 功能为实现 IPC 视频流输入后智能分析,App 由 RTSP 视频流、视频解码、人体人脸检测、图像编码、Web 展示端组成,流程如下图:
对应实际的客户应用中显示部分由客户的业务系统完成,智能盒子的主要功能由 RTSP 视频流、视频解码、人体人脸检测,智能结果和图像发布给客户的业务系统,流程如下图:
代码仓库: (https://github.com/D-Robotics/hobot_rtsp_client.git)
支持平台
| 平台 | 运行方式 |
|---|---|
| RDK X3, RDK X3 Module | Ubuntu 22.04 (Humble) |
| RDK X5, RDK X5 Module | Ubuntu 22.04 (Humble) |
| RDK S100, RDK S100P | Ubuntu 22.04 (Humble) |
| RDK S600 | Ubuntu 24.04 (Jazzy) |
准备工作
-
RDK 已烧录好 RDK OS 系统。
-
RDK 安装 TogetheROS.Bot 参照apt 安装与升级。
-
准备支持传输 H264/H265 码流 RTSP 协议的 IPC 设备,并且配置同一网段的 IP 地址。
-
和 RDK 在同一网段(有线或者连接同一无线网,IP 地址前三段[192.168.1.x]需保持一致)的 PC.
-
系统配置成性能模式
sudo bash -c "echo performance > /sys/devices/system/cpu/cpufreq/policy0/scaling_governor"
- 启动多路时,ion_size 配置成 1G,请参考srpi-config 配置
- 启动多路时,ion_size 配置成 1G,请参考srpi-config 配置
- 启动多路时,ion_size 配置成 1G,请参考srpi-config 配置
- 启动多路时,ion_size 配置成 1G,请参考srpi-config 配置
使用介绍
多路启动的方法
channle 1(终端 1):
- Foxy
- Humble
- Jazzy
# 配置tros.b环境
source /opt/tros/setup.bash
# 配置tros.b环境
source /opt/tros/humble/setup.bash
# 配置tros.b环境
source /opt/tros/jazzy/setup.bash
- Humble
# 配置tros.b环境
source /opt/tros/humble/setup.bash
- Jazzy
# 配置tros.b环境
source /opt/tros/jazzy/setup.bash
# 设置不同的域
export ROS_DOMAIN_ID=101
# 从TogetheROS的安装路径中拷贝出运行示例需要的配置文件。
cp -r /opt/tros/${TROS_DISTRO}/lib/dnn_node_example/config/ .
# 启动launch文件
ros2 launch hobot_rtsp_client hobot_rtsp_client_ai_websocket_plugin.launch.py hobot_rtsp_url_num:=1 hobot_rtsp_url_0:='rtsp://admin:admin123@10.112.148.57:554/0' hobot_transport_0:='udp' websocket_channel:=0
channle 2(终端 2):
- Foxy
- Humble
- Jazzy
# 配置tros.b环境
source /opt/tros/setup.bash
# 配置tros.b环境
source /opt/tros/humble/setup.bash
# 配置tros.b环境
source /opt/tros/jazzy/setup.bash
- Humble
# 配置tros.b环境
source /opt/tros/humble/setup.bash
- Jazzy
# 配置tros.b环境
source /opt/tros/jazzy/setup.bash
# 设置不同的域
export ROS_DOMAIN_ID=102
# 从TogetheROS的安装路径中拷贝出运行示例需要的配置文件。
cp -r /opt/tros/${TROS_DISTRO}/lib/dnn_node_example/config/ .
# 启动launch文件
ros2 launch hobot_rtsp_client hobot_rtsp_client_ai_websocket_plugin.launch.py hobot_rtsp_url_num:=1 hobot_rtsp_url_0:='rtsp://admin:admin123@10.112.148.58:554/0' hobot_transport_0:='udp' websocket_channel:=1
...
注意
- 不同的 channel 设置不同的 ROS_DOMAIN_ID 和 websocket_channel。
- 上述展示 2 个通道的方法,依据相关的方法启动其他通道 3~8 等。
- launch 脚本带"_plugin",将以 component 模式启动;如 hobot_rtsp_client_ai_websocket_plugin.launch.py 和 hobot_rtsp_client_ai_plugin.launch.py
- launch 脚本带"_websocket",可以实现 web 的浏览;如 hobot_rtsp_client_ai_websocket_plugin.launch.py 和 hobot_rtsp_client_ai_websocket.launch.py
- 为了增加连接通道的能力,需要多视频流降帧,需要从 IPC 进行帧率配置。