parent
930ab66199
commit
7b6b7aa0d9
@ -0,0 +1,143 @@
|
||||
{
|
||||
"info": {
|
||||
"_postman_id": "3f0d9a12-7c5e-4b21-9d8a-6e1f2a3b4c5d",
|
||||
"name": "PAVO2 雷达 HTTP API (POST json)",
|
||||
"description": "HTTP 运行模式接口。运行模式 Run_Mode 需改为 \"http\"。\n用法: 程序启动后向 http://{{host}}:{{port}}/ 发送 POST 请求, body 为与 TCP 协议完全相同的 JSON(不带结尾 '>')。响应 body 与 TCP 相同(不带 '>')。\n提示: 修改 collection 变量 host 为服务程序所在电脑的 IP(默认 127.0.0.1); port 与配置 Tcp_Port 一致(默认 9601)。\n注意: HTTP 无长连接, 建议 count/check 使用 start(不带 scanTime) → 完成后 stop 拿结果; 若使用 scanTime 到时自动停止, 结果不会推送(仅打印在服务端日志)。",
|
||||
"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
|
||||
},
|
||||
"variable": [
|
||||
{ "key": "host", "value": "127.0.0.1", "type": "string" },
|
||||
{ "key": "port", "value": "9601", "type": "string" },
|
||||
{ "key": "baseUrl", "value": "http://{{host}}:{{port}}", "type": "string" }
|
||||
],
|
||||
"item": [
|
||||
{
|
||||
"name": "count start (固定时长, 到时自动停止)",
|
||||
"request": {
|
||||
"method": "POST",
|
||||
"header": [
|
||||
{ "key": "Content-Type", "value": "application/json" }
|
||||
],
|
||||
"url": { "raw": "{{baseUrl}}/", "host": ["{{baseUrl}}"], "path": [""] },
|
||||
"body": {
|
||||
"mode": "raw",
|
||||
"raw": "{\n \"function\": \"count\",\n \"scan\": \"start\",\n \"scanTime\": 6,\n \"box\": {\n \"l\": 154,\n \"w\": 153,\n \"h\": 310,\n \"maxPerLayer\": 30\n },\n \"task_id\": \"t1\"\n}",
|
||||
"options": { "raw": { "language": "json" } }
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "count start (手动, 等 stop 拿结果)",
|
||||
"request": {
|
||||
"method": "POST",
|
||||
"header": [
|
||||
{ "key": "Content-Type", "value": "application/json" }
|
||||
],
|
||||
"url": { "raw": "{{baseUrl}}/", "host": ["{{baseUrl}}"], "path": [""] },
|
||||
"body": {
|
||||
"mode": "raw",
|
||||
"raw": "{\n \"function\": \"count\",\n \"scan\": \"start\",\n \"box\": {\n \"l\": 154,\n \"w\": 153,\n \"h\": 310,\n \"maxPerLayer\": 30\n },\n \"task_id\": \"t2\"\n}",
|
||||
"options": { "raw": { "language": "json" } }
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "count stop (拿结果)",
|
||||
"request": {
|
||||
"method": "POST",
|
||||
"header": [
|
||||
{ "key": "Content-Type", "value": "application/json" }
|
||||
],
|
||||
"url": { "raw": "{{baseUrl}}/", "host": ["{{baseUrl}}"], "path": [""] },
|
||||
"body": {
|
||||
"mode": "raw",
|
||||
"raw": "{\n \"function\": \"count\",\n \"scan\": \"stop\",\n \"task_id\": \"t2\"\n}",
|
||||
"options": { "raw": { "language": "json" } }
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "count stop (未扫描时查询, 返回 scan not running + count:0)",
|
||||
"request": {
|
||||
"method": "POST",
|
||||
"header": [
|
||||
{ "key": "Content-Type", "value": "application/json" }
|
||||
],
|
||||
"url": { "raw": "{{baseUrl}}/", "host": ["{{baseUrl}}"], "path": [""] },
|
||||
"body": {
|
||||
"mode": "raw",
|
||||
"raw": "{\n \"function\": \"count\",\n \"scan\": \"stop\",\n \"task_id\": \"none\"\n}",
|
||||
"options": { "raw": { "language": "json" } }
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "check start (手动)",
|
||||
"request": {
|
||||
"method": "POST",
|
||||
"header": [
|
||||
{ "key": "Content-Type", "value": "application/json" }
|
||||
],
|
||||
"url": { "raw": "{{baseUrl}}/", "host": ["{{baseUrl}}"], "path": [""] },
|
||||
"body": {
|
||||
"mode": "raw",
|
||||
"raw": "{\n \"function\": \"check\",\n \"scan\": \"start\",\n \"task_id\": \"c1\"\n}",
|
||||
"options": { "raw": { "language": "json" } }
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "check stop",
|
||||
"request": {
|
||||
"method": "POST",
|
||||
"header": [
|
||||
{ "key": "Content-Type", "value": "application/json" }
|
||||
],
|
||||
"url": { "raw": "{{baseUrl}}/", "host": ["{{baseUrl}}"], "path": [""] },
|
||||
"body": {
|
||||
"mode": "raw",
|
||||
"raw": "{\n \"function\": \"check\",\n \"scan\": \"stop\",\n \"task_id\": \"c1\"\n}",
|
||||
"options": { "raw": { "language": "json" } }
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "config (重载 config/config)",
|
||||
"request": {
|
||||
"method": "POST",
|
||||
"header": [
|
||||
{ "key": "Content-Type", "value": "application/json" }
|
||||
],
|
||||
"url": { "raw": "{{baseUrl}}/", "host": ["{{baseUrl}}"], "path": [""] },
|
||||
"body": {
|
||||
"mode": "raw",
|
||||
"raw": "{\n \"function\": \"config\"\n}",
|
||||
"options": { "raw": { "language": "json" } }
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "ConfigureSpeed (标定速度剖面)",
|
||||
"request": {
|
||||
"method": "POST",
|
||||
"header": [
|
||||
{ "key": "Content-Type", "value": "application/json" }
|
||||
],
|
||||
"url": { "raw": "{{baseUrl}}/", "host": ["{{baseUrl}}"], "path": [""] },
|
||||
"body": {
|
||||
"mode": "raw",
|
||||
"raw": "{\n \"function\": \"ConfigureSpeed\",\n \"scanTime\": 6\n}",
|
||||
"options": { "raw": { "language": "json" } }
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"name": "非 POST 测试 (应返回 405)",
|
||||
"request": {
|
||||
"method": "GET",
|
||||
"header": [],
|
||||
"url": { "raw": "{{baseUrl}}/", "host": ["{{baseUrl}}"], "path": [""] }
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
@ -0,0 +1,32 @@
|
||||
#include "config.h"
|
||||
#include <iostream>
|
||||
|
||||
int main()
|
||||
{
|
||||
load_config("./config/config");
|
||||
std::cout << "radar: " << cfg.radar.ip << ":" << cfg.radar.port
|
||||
<< " hz=" << cfg.radar.hz
|
||||
<< " tail=" << cfg.radar.tail_filter << std::endl;
|
||||
std::cout << "clean_time => " << cfg.log.clean_hour << ":" << cfg.log.clean_minute
|
||||
<< ":" << cfg.log.clean_sec << std::endl;
|
||||
std::cout << "log.enable=" << cfg.log.enable << " retain=" << cfg.log.retain_days << std::endl;
|
||||
std::cout << "poly_n=" << cfg.filter.poly_n << std::endl;
|
||||
std::cout << "tail_cut.enable=" << cfg.filter.tail_cut.enable
|
||||
<< " max_tail=" << cfg.filter.tail_cut.max_tail_length << std::endl;
|
||||
std::cout << "sparse_cut.enable=" << cfg.filter.sparse_cut.enable
|
||||
<< " x_radius=" << cfg.filter.sparse_cut.x_radius
|
||||
<< " circle=" << cfg.filter.sparse_cut.circle_min
|
||||
<< " run=" << cfg.filter.sparse_cut.run_min << std::endl;
|
||||
std::cout << "server: " << cfg.server.mode << ":" << cfg.server.port << std::endl;
|
||||
std::cout << "detect: z=" << cfg.detect.z_range_mm << " y=" << cfg.detect.y_range_mm
|
||||
<< " w=" << cfg.detect.rect_width_px << " ratio=" << cfg.detect.rect_length_ratio << std::endl;
|
||||
std::cout << "count: floor=" << cfg.count.floor_height
|
||||
<< " base_tol=" << cfg.count.base_tolerance
|
||||
<< " per_tol=" << cfg.count.per_level_tolerance
|
||||
<< " dilate=" << cfg.count.point_dilate
|
||||
<< " interp=" << cfg.count.z_interpolate_mode << std::endl;
|
||||
std::cout << "scan: dur=" << cfg.scan.collect_duration_s
|
||||
<< " type=" << cfg.scan.z_speed_type
|
||||
<< " speed=" << cfg.scan.z_speed << std::endl;
|
||||
return 0;
|
||||
}
|
||||
Loading…
Reference in New Issue