Skip to content

Commit d2031d9

Browse files
author
Józef Daniecki
committed
Tracker service v0.3.2: robot vision integration
1 parent 80a5767 commit d2031d9

30 files changed

Lines changed: 2845 additions & 124 deletions

Makefile

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -392,14 +392,6 @@ run_basic_acceptance_tests: setup_tests
392392
$(MAKE) --trace -C tests basic-acceptance-tests -j 1 SUPASS=$(SUPASS) || (echo "Basic acceptance tests failed" && exit 1)
393393
@echo "DONE ==> Running basic acceptance tests"
394394

395-
.PHONY: run_stability_tests
396-
run_stability_tests: setup_tests
397-
$(MAKE) $(DLSTREAMER_SAMPLE_VIDEOS);
398-
@echo "Running stability tests..."
399-
$(eval HOURS ?= 24)
400-
$(MAKE) --trace -C tests system-stability -j 1 SUPASS=$(SUPASS) HOURS=$(HOURS) SECRETSDIR=$(CURDIR)/manager/secrets || (echo "Stability tests failed" && exit 1)
401-
@echo "DONE ==> Running stability tests"
402-
403395
# Temp K8s BAT target
404396
.PHONY: run_basic_acceptance_tests_k8s
405397
run_basic_acceptance_tests_k8s: setup_tests

docs/design/tracker-service.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ See full schema: [`scene-data.schema.json`](../../tracker/schema/scene-data.sche
114114
"timestamp": "2026-01-20T10:05:01.590Z",
115115
"objects": [
116116
{
117-
"id": "8cce2bc7-51fc-4a6e-8c5d-a73ac72d3eb2",
117+
"id": 42,
118118
"category": "person",
119119
"translation": [-0.33, 2.48, 0.0],
120120
"velocity": [-0.04, 0.2, 0.0],

tests/Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,6 @@ randomly-failing-tests:
115115
persistence \
116116
scenes-summary \
117117
3d-scene-control-panel \
118-
auto-calibration-ui \
119118

120119
# Not sorted alphabetically on purpose
121120
basic-acceptance-tests: \
@@ -197,6 +196,7 @@ ui-tests:
197196
_ui-tests: \
198197
3d-camera-control-panel \
199198
add-delete-3d-object \
199+
auto-calibration-ui \
200200
bounding-box \
201201
calibrate-all-sensor-types \
202202
camera-perspective \
@@ -263,7 +263,7 @@ build-time: # NEX-T12520
263263

264264
system-stability: # NEX-T10411
265265
$(eval HOURS ?= 24)
266-
$(call common-recipe, $(COMPOSE)/dlstreamer/broker.yml:$(COMPOSE)/ntp.yml:$(COMPOSE)/pgserver.yml:$(COMPOSE)/dlstreamer/retail_video.yml:$(COMPOSE)/scene.yml:$(COMPOSE)/web.yml:$(COMPOSE)/cams.yml, tests/system/stability/tc_sscape_stability.py --hours=$(HOURS),'pgserver web scene',true)
266+
$(call common-recipe, $(COMPOSE)/dlstreamer/broker.yml:$(COMPOSE)/ntp.yml:$(COMPOSE)/pgserver.yml:$(COMPOSE)/dlstreamer/retail_video.yml:$(COMPOSE)/scene.yml:$(COMPOSE)/web.yml, tests/system/stability/tc_sscape_stability.py --hours=$(HOURS),'pgserver web scene',true)
267267

268268
python-indent-check: # NEX-T10448
269269
$(eval LOGFILE=$(TEST_DATA)/code_check/$@-$(shell date -u +"%F-%T").log)

tracker/.vscode/launch.json

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,14 @@
2121
],
2222
"sourceFileMap": {
2323
"/scenescape/tracker": "${workspaceFolder}"
24-
}
24+
},
25+
"environment": [
26+
{"name": "http_proxy", "value": ""},
27+
{"name": "https_proxy", "value": ""},
28+
{"name": "HTTP_PROXY", "value": ""},
29+
{"name": "HTTPS_PROXY", "value": ""},
30+
{"name": "TRACKER_LOG_LEVEL", "value": "debug"},
31+
]
2532
},
2633
{
2734
"name": "Tracker: Debug native",
@@ -35,6 +42,16 @@
3542
"stopAtEntry": false,
3643
"cwd": "${workspaceFolder}",
3744
"envFile": "${workspaceFolder}/build-debug/debug.env",
45+
"environment": [
46+
{"name": "http_proxy", "value": ""},
47+
{"name": "https_proxy", "value": ""},
48+
{"name": "HTTP_PROXY", "value": ""},
49+
{"name": "HTTPS_PROXY", "value": ""},
50+
{"name": "TRACKER_LOG_LEVEL", "value": "debug"},
51+
{"name": "TRACKER_MQTT_INSECURE", "value": "false"},
52+
{"name": "TRACKER_MQTT_TLS_CA_CERT", "value": "${workspaceFolder}/../manager/secrets/certs/scenescape-ca.pem"},
53+
{"name": "TRACKER_MQTT_TLS_VERIFY_SERVER", "value": "true"}
54+
],
3855
"externalConsole": false,
3956
"MIMode": "gdb",
4057
"miDebuggerPath": "/usr/bin/gdb",

tracker/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@ set(PROJECT_SOURCE_LIST
7070
${CMAKE_CURRENT_SOURCE_DIR}/src/cli.cpp
7171
${CMAKE_CURRENT_SOURCE_DIR}/src/config_loader.cpp
7272
${CMAKE_CURRENT_SOURCE_DIR}/src/scene_loader.cpp
73+
${CMAKE_CURRENT_SOURCE_DIR}/src/coordinate_transformer.cpp
7374
${CMAKE_CURRENT_SOURCE_DIR}/src/healthcheck_server.cpp
7475
${CMAKE_CURRENT_SOURCE_DIR}/src/healthcheck_command.cpp
7576
${CMAKE_CURRENT_SOURCE_DIR}/src/mqtt_client.cpp

tracker/Makefile

Lines changed: 28 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -176,18 +176,34 @@ build-relwithdebinfo: dependencies-relwithdebinfo
176176
TRACKER_SCHEMA_PATH ?= $(CURDIR)/schema/config.schema.json
177177
TRACKER_CONFIG_PATH ?= $(CURDIR)/config/tracker.json
178178

179-
# MQTT broker connection (auto-detect from test broker, fallback to 1883)
180-
export TRACKER_MQTT_HOST ?= localhost
181-
export TRACKER_MQTT_PORT ?= $(shell cd test/service && docker compose port broker 1883 2>/dev/null | cut -d: -f2 || echo 1883)
179+
# MQTT broker connection - preconfigured for SceneScape demo (docker compose up)
180+
# These variables are exported only in run/run-debug targets to avoid polluting test environment
181+
TRACKER_MQTT_HOST ?= localhost
182+
TRACKER_MQTT_PORT ?= $(shell cd test/service && docker compose port broker 1883 2>/dev/null | cut -d: -f2 || echo 1883)
183+
TRACKER_MQTT_INSECURE ?= false
182184

183-
# Export empty proxy vars - Paho MQTT library fails with proxy env vars,
185+
# TLS CA certificate path (host path for native runs, container path set in tracker.json)
186+
TRACKER_TLS_CA_CERT_HOST ?= $(CURDIR)/../manager/secrets/certs/scenescape-ca.pem
187+
TRACKER_MQTT_TLS_CA_CERT ?= $(TRACKER_TLS_CA_CERT_HOST)
188+
189+
# For insecure test broker: make run TRACKER_MQTT_INSECURE=true
190+
191+
# Export MQTT env vars and empty proxy vars - Paho MQTT library fails with proxy env vars,
184192
# tracker code detects empty vars and unsets them (see mqtt_client.cpp)
185193
run: build
186-
export http_proxy= https_proxy= HTTP_PROXY= HTTPS_PROXY= && \
194+
export TRACKER_MQTT_HOST="$(TRACKER_MQTT_HOST)" \
195+
TRACKER_MQTT_PORT="$(TRACKER_MQTT_PORT)" \
196+
TRACKER_MQTT_INSECURE="$(TRACKER_MQTT_INSECURE)" \
197+
TRACKER_MQTT_TLS_CA_CERT="$(TRACKER_MQTT_TLS_CA_CERT)" \
198+
http_proxy= https_proxy= HTTP_PROXY= HTTPS_PROXY= && \
187199
. build/conanrun.sh && ./build/$(NAME) --config $(TRACKER_CONFIG_PATH) --schema $(TRACKER_SCHEMA_PATH)
188200

189201
run-debug: build-debug
190-
export http_proxy= https_proxy= HTTP_PROXY= HTTPS_PROXY= && \
202+
export TRACKER_MQTT_HOST="$(TRACKER_MQTT_HOST)" \
203+
TRACKER_MQTT_PORT="$(TRACKER_MQTT_PORT)" \
204+
TRACKER_MQTT_INSECURE="$(TRACKER_MQTT_INSECURE)" \
205+
TRACKER_MQTT_TLS_CA_CERT="$(TRACKER_MQTT_TLS_CA_CERT)" \
206+
http_proxy= https_proxy= HTTP_PROXY= HTTPS_PROXY= && \
191207
. build-debug/conanrun.sh && ./build-debug/$(NAME) --config $(TRACKER_CONFIG_PATH) --schema $(TRACKER_SCHEMA_PATH)
192208

193209
# Profile with perf using optimized build with debug symbols.
@@ -319,8 +335,7 @@ test-service: build-image
319335
@test/service/.venv/bin/pip install -q --upgrade pip
320336
@test/service/.venv/bin/pip install -q -r test/service/requirements.txt
321337
@echo "Running service tests..."
322-
unset TRACKER_MQTT_PORT TRACKER_MQTT_HOST TRACKER_MQTT_INSECURE && \
323-
cd test/service && .venv/bin/pytest -v --tb=short
338+
cd test/service && .venv/bin/pytest -v --tb=short
324339

325340
#####################################################################
326341
# Docker build targets
@@ -339,17 +354,21 @@ build-image-debug:
339354
build-image-relwithdebinfo:
340355
$(MAKE) build-image TARGET=runtime BUILD_TYPE=RelWithDebInfo IMAGE=scenescape-tracker-relwithdebinfo
341356

342-
# Use host network to reach broker on localhost; empty proxy vars for Paho workaround
357+
# Use host network to reach broker; empty proxy vars for Paho workaround
358+
# Container uses secure defaults from tracker.json (TLS to broker.scenescape.intel.com)
343359
run-image: build-image
344360
docker run --rm -it --network=host \
345361
-e http_proxy= -e https_proxy= -e HTTP_PROXY= -e HTTPS_PROXY= \
362+
-v $(TRACKER_TLS_CA_CERT_HOST):/run/secrets/certs/scenescape-ca.pem:ro \
346363
$(IMAGE):$(VERSION)
347364

348365
run-image-debug: build-image-debug
349366
-docker stop tracker-debug 2>/dev/null || true
350367
-docker rm tracker-debug 2>/dev/null || true
351368
docker run --rm -d --name tracker-debug --init -p 2345:2345 \
352369
--cap-add=SYS_PTRACE --security-opt seccomp=unconfined \
370+
-e http_proxy= -e https_proxy= -e HTTP_PROXY= -e HTTPS_PROXY= \
371+
-v $(TRACKER_TLS_CA_CERT_HOST):/run/secrets/certs/scenescape-ca.pem:ro \
353372
scenescape-tracker-debug:$(VERSION)
354373
@echo "Debug container started. Attach debugger to localhost:2345"
355374

tracker/README.md

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -44,14 +44,38 @@ make build-relwithdebinfo
4444

4545
#### Run
4646

47+
The run targets are preconfigured to work with SceneScape demo. Start SceneScape first:
48+
49+
```bash
50+
# From repository root
51+
docker compose up -d
52+
```
53+
54+
Then run the tracker:
55+
4756
```bash
48-
# Run with default settings
57+
# Run release build
4958
make run
5059

51-
# Debug build
60+
# Run debug build
5261
make run-debug
5362
```
5463

64+
**Environment overrides:** The following variables can be overridden:
65+
66+
| Variable | Default | Description |
67+
| -------------------------- | -------------------------------------------- | ----------------------------- |
68+
| `TRACKER_MQTT_HOST` | `localhost` | MQTT broker hostname |
69+
| `TRACKER_MQTT_PORT` | `1883` | MQTT broker port |
70+
| `TRACKER_MQTT_INSECURE` | `false` | Disable TLS (for test broker) |
71+
| `TRACKER_MQTT_TLS_CA_CERT` | `../manager/secrets/certs/scenescape-ca.pem` | CA certificate path |
72+
73+
Example with insecure test broker:
74+
75+
```bash
76+
make run TRACKER_MQTT_INSECURE=true
77+
```
78+
5579
**Manual execution:** If not using Make targets, you must source the Conan environment
5680
first. Conan-managed libraries (e.g., OpenCV) are not installed system-wide, so
5781
`LD_LIBRARY_PATH` must be set:

tracker/config/tracker.json

Lines changed: 14 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
11
{
22
"infrastructure": {
33
"mqtt": {
4-
"host": "localhost",
4+
"host": "broker.scenescape.intel.com",
55
"port": 1883,
6-
"insecure": true
6+
"insecure": false,
7+
"tls": {
8+
"ca_cert_path": "/run/secrets/certs/scenescape-ca.pem",
9+
"verify_server": true
10+
}
711
},
812
"tracker": {
913
"healthcheck": {
@@ -16,6 +20,14 @@
1620
"level": "info"
1721
}
1822
},
23+
"tracking": {
24+
"max_lag_s": 1.0,
25+
"time_chunking_rate_fps": 15,
26+
"max_workers": 50,
27+
"max_unreliable_time_s": 1.0,
28+
"non_measurement_time_dynamic_s": 0.8,
29+
"non_measurement_time_static_s": 1.6
30+
},
1931
"scenes": {
2032
"source": "file",
2133
"file_path": "scenes.json"

tracker/inc/config_loader.hpp

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,11 @@ struct TrackingConfig {
7676
double max_lag_s = 1.0; ///< Max lag for detection frames (seconds)
7777
int time_chunking_rate_fps = 15; ///< Chunk dispatch rate (frames per second)
7878
int max_workers = 50; ///< DoS protection: max worker threads (scene+category)
79+
80+
// RobotVision tracker parameters
81+
double max_unreliable_time_s = 1.0; ///< Max time track can be unreliable
82+
double non_measurement_time_dynamic_s = 0.8; ///< Time before dynamic track dropped
83+
double non_measurement_time_static_s = 1.6; ///< Time before static track dropped
7984
};
8085

8186
/**
@@ -112,6 +117,10 @@ constexpr char INFRASTRUCTURE_MQTT_TLS_VERIFY_SERVER[] = "/infrastructure/mqtt/t
112117
constexpr char TRACKING_MAX_LAG_S[] = "/tracking/max_lag_s";
113118
constexpr char TRACKING_TIME_CHUNKING_RATE_FPS[] = "/tracking/time_chunking_rate_fps";
114119
constexpr char TRACKING_MAX_WORKERS[] = "/tracking/max_workers";
120+
constexpr char TRACKING_MAX_UNRELIABLE_TIME_S[] = "/tracking/max_unreliable_time_s";
121+
constexpr char TRACKING_NON_MEASUREMENT_TIME_DYNAMIC_S[] =
122+
"/tracking/non_measurement_time_dynamic_s";
123+
constexpr char TRACKING_NON_MEASUREMENT_TIME_STATIC_S[] = "/tracking/non_measurement_time_static_s";
115124

116125
// Scenes
117126
constexpr char SCENES_SOURCE[] = "/scenes/source";

0 commit comments

Comments
 (0)