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已烧录好Ubuntu 22.04系统镜像。
-
RDK安装TogetheROS.Bot参照5.1.2 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配置
使用介绍
多路启动的方法
channle 1(终端1):
- Humble
# 配置tros.b环境
source /opt/tros/humble/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):
- Humble
# 配置tros.b环境
source /opt/tros/humble/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