相机心跳包(输出)
<h1>简要描述:</h1>
<p>1、该接口主要用于和客户端握手,客户端通过监听改topic,判断算法服务是否正常
2、其中每个相机的状态是独立的
3、内容如下:</p>
<ul>
<li>project_version项目版本(主要用于区分项目,算法服务框架组成:公共部分+具体的项目)</li>
<li>project_name项目名字</li>
<li>project_version_num框架版本号(包含了:公共部分+具体的项目)</li>
<li>project_version_date框架版本更新时间</li>
<li>相机key:
<ul>
<li>ping:边缘设备ping相机ip的延迟</li>
<li>cam_status:相机状态是否正常,主要看能不能取到图像,取不到则为False</li>
<li>alg_status: 算法状态,算法异常则为False</li>
<li>相机的配置参数</li>
</ul></li>
</ul>
<h1>topic话题名称规则</h1>
<pre><code>/aiserver_status</code></pre>
<p>aiserver_status为固定字段,不会改变</p>
<h1>话题地址:</h1>
<pre><code>工控机的地址</code></pre>
<h1>话题数据格式</h1>
<pre><code>{
&#039;cam_rtsp_left&#039;: {
&#039;ping&#039;: 0.8749961853027344,
&#039;cam_status&#039;: True,
&#039;alg_status&#039;: True,
&#039;camconfig&#039;: {
&#039;CamAction&#039;: &#039;open&#039;,
&#039;CamKey&#039;: &#039;cam_rtsp_left&#039;,
&#039;CamName&#039;: &#039;双目左视&#039;,
&#039;CamType&#039;: &#039;Network&#039;,
&#039;CamUrl&#039;: &#039;rtsp://admin:Asb11023@192.168.1.88:554/Streaming/Channels/101&#039;,
&#039;CamGs&#039;: False,
&#039;CamGsGpu&#039;: False,
&#039;CamSkip&#039;: 1,
&#039;CamPort&#039;: 8000,
&#039;Side&#039;: &#039;Client&#039;,
&#039;AlgConfig&#039;: {
&#039;Algtype&#039;: [9],
&#039;Polygon&#039;: [[0, 0, 1, 1]],
&#039;AlgThred&#039;: [[0.5]],
&#039;MinPixel&#039;: [[1, 1]],
&#039;Positioning&#039;: False,
&#039;Specialdata&#039;: {
&#039;savevideo&#039;: False
}
}
}
},
&#039;cam_rtsp_right&#039;: {
&#039;ping&#039;: 0.7822513580322266,
&#039;cam_status&#039;: True,
&#039;alg_status&#039;: True,
&#039;camconfig&#039;: {
&#039;CamAction&#039;: &#039;open&#039;,
&#039;CamKey&#039;: &#039;cam_rtsp_right&#039;,
&#039;CamName&#039;: &#039;双目右视&#039;,
&#039;CamType&#039;: &#039;Network&#039;,
&#039;CamUrl&#039;: &#039;rtsp://admin:Asb11023@192.168.1.89:554/Streaming/Channels/101&#039;,
&#039;CamGs&#039;: False,
&#039;CamGsGpu&#039;: False,
&#039;CamSkip&#039;: 1,
&#039;CamPort&#039;: 8001,
&#039;Side&#039;: &#039;Client&#039;,
&#039;AlgConfig&#039;: {
&#039;Algtype&#039;: [10, 17],
&#039;Polygon&#039;: [[0, 0, 1, 1], [0, 0, 1, 1]],
&#039;AlgThred&#039;: [[0.5], [0.5]],
&#039;MinPixel&#039;: [[1, 1], [1, 1]],
&#039;Positioning&#039;: False,
&#039;Specialdata&#039;: {
&#039;savevideo&#039;: False
}
}
}
},
&#039;project_version&#039;: &#039;v0.0.0&#039;,
&#039;project_name&#039;: &#039;item_FC&#039;,
&#039;project_version_num&#039;: &#039;1.0.11.6&#039;,
&#039;project_version_date&#039;: &#039;20240712&#039;
}</code></pre>
<h1>心跳包数据说明</h1>
<table>
<thead>
<tr>
<th>参数名</th>
<th>必选</th>
<th>类型</th>
<th>说明</th>
</tr>
</thead>
<tbody>
<tr>
<td>project_version</td>
<td>是</td>
<td>string</td>
<td>框架版本号</td>
</tr>
<tr>
<td>project_name</td>
<td>是</td>
<td>string</td>
<td>框架名称</td>
</tr>
<tr>
<td>project_version_num</td>
<td>否</td>
<td>string</td>
<td>视觉版本号</td>
</tr>
<tr>
<td>project_version_date</td>
<td>否</td>
<td>string</td>
<td>视觉版本号发布日期</td>
</tr>
<tr>
<td>CamKey</td>
<td>是</td>
<td>dict</td>
<td>相机唯一标识key</td>
</tr>
</tbody>
</table>
<h1>心跳包中 CamKey 数据说明</h1>
<table>
<thead>
<tr>
<th>参数名</th>
<th>必选</th>
<th>类型</th>
<th>说明</th>
</tr>
</thead>
<tbody>
<tr>
<td>ping</td>
<td>是</td>
<td>string</td>
<td>ping此相机的延迟</td>
</tr>
<tr>
<td>cam_status</td>
<td>是</td>
<td>bool</td>
<td>相机状态</td>
</tr>
<tr>
<td>alg_status</td>
<td>是</td>
<td>bool</td>
<td>相机算法状态</td>
</tr>
<tr>
<td>camconfig</td>
<td>是</td>
<td>dict</td>
<td>相机参数</td>
</tr>
</tbody>
</table>
<p>camconfig详情见接口 <a href="https://www.showdoc.com.cn/DXRAPI/11558474059845706">https://www.showdoc.com.cn/DXRAPI/11558474059845706</a></p>
<h1>心跳包中 camconfig 数据说明</h1>
<table>
<thead>
<tr>
<th>参数名</th>
<th>必选</th>
<th>类型</th>
<th>说明</th>
</tr>
</thead>
<tbody>
<tr>
<td>CamAction</td>
<td>是</td>
<td>string</td>
<td>相机控制 open/close</td>
</tr>
<tr>
<td>CamKey</td>
<td>是</td>
<td>string</td>
<td>相机唯一key值</td>
</tr>
<tr>
<td>CamName</td>
<td>是</td>
<td>string</td>
<td>相机中文名称</td>
</tr>
<tr>
<td>CamType</td>
<td>是</td>
<td>string</td>
<td>相机流类型 Network——网络相机 /Usb——usb相机 /Mp4——视频</td>
</tr>
<tr>
<td>CamUrl</td>
<td>是</td>
<td>string</td>
<td>相机流地址</td>
</tr>
<tr>
<td>CamGs</td>
<td>是</td>
<td>bool</td>
<td>视频流是否需要gs解码</td>
</tr>
<tr>
<td>CamGsGpu</td>
<td>是</td>
<td>bool</td>
<td>视频流是否需要gs GPU解码</td>
</tr>
<tr>
<td>CamSkip</td>
<td>是</td>
<td>int</td>
<td>视频流抽帧帧数</td>
</tr>
<tr>
<td>CamPort</td>
<td>是</td>
<td>int</td>
<td>相机port号 暂无意义</td>
</tr>
<tr>
<td>Side</td>
<td>是</td>
<td>string</td>
<td>指令最后从哪边发出 Web——视觉 /Client——客户端</td>
</tr>
<tr>
<td>AlgConfig</td>
<td>是</td>
<td>dict</td>
<td>相机算法处理参数</td>
</tr>
</tbody>
</table>
<h1>心跳包中 AlgConfig 数据说明</h1>
<table>
<thead>
<tr>
<th>参数名</th>
<th>必选</th>
<th>类型</th>
<th>说明</th>
</tr>
</thead>
<tbody>
<tr>
<td>Algtype</td>
<td>是</td>
<td>list</td>
<td>算法类型</td>
</tr>
<tr>
<td>Polygon</td>
<td>是</td>
<td>list</td>
<td>图像处理区域</td>
</tr>
<tr>
<td>AlgThred</td>
<td>是</td>
<td>list</td>
<td>算法类型对应的阈值</td>
</tr>
<tr>
<td>MinPixel</td>
<td>是</td>
<td>list</td>
<td>目标最小尺寸</td>
</tr>
<tr>
<td>Positioning</td>
<td>是</td>
<td>bool</td>
<td>是否定点任务</td>
</tr>
<tr>
<td>Specialdata</td>
<td>是</td>
<td>dict</td>
<td>额外事务配置参数</td>
</tr>
</tbody>
</table>
<p>Specialdata详情见额外事务接口 <a href="https://www.showdoc.com.cn/DXRAPI/11558474009752268">https://www.showdoc.com.cn/DXRAPI/11558474009752268</a></p>
<h1>接口变更记录</h1>
<p>20240311 视觉版本1.0.11.3增加心跳包功能
20240712 视觉版本1.0.11.6增加视觉版本号和视觉版本号发布日期</p>