2026-03-15 15:21:03 -05:00
|
|
|
"""Launch ground_plane_node alongside single_person_loc_node (headless).
|
|
|
|
|
|
|
|
|
|
Runs the keypoint triangulator in headless mode and pipes its output
|
|
|
|
|
into the ground-plane estimator. Both nodes share the mmpose conda
|
|
|
|
|
Python environment.
|
|
|
|
|
"""
|
|
|
|
|
|
|
|
|
|
import os
|
2026-03-15 21:46:34 -05:00
|
|
|
import sys
|
|
|
|
|
|
|
|
|
|
sys.path.insert(0, os.path.dirname(__file__))
|
|
|
|
|
from _conda_utils import find_conda_python # noqa: E402
|
|
|
|
|
|
2026-03-15 15:21:03 -05:00
|
|
|
from launch import LaunchDescription
|
|
|
|
|
from launch.actions import ExecuteProcess
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def generate_launch_description():
|
2026-03-15 21:46:34 -05:00
|
|
|
python_exe = find_conda_python('mmpose')
|
2026-03-15 15:21:03 -05:00
|
|
|
|
|
|
|
|
return LaunchDescription([
|
|
|
|
|
|
|
|
|
|
# ── Keypoint triangulator (headless) ────────────────────────────
|
|
|
|
|
ExecuteProcess(
|
|
|
|
|
cmd=[
|
2026-03-15 15:53:39 -05:00
|
|
|
python_exe, '-m', 'tracking_re_id.single_person_loc_node',
|
2026-03-15 15:21:03 -05:00
|
|
|
'--ros-args',
|
|
|
|
|
'-p', 'threshold:=0.3',
|
|
|
|
|
'-p', 'device:=cuda:0',
|
|
|
|
|
'-p', 'max_residual:=0.10',
|
|
|
|
|
'-p', 'headless:=true',
|
|
|
|
|
],
|
|
|
|
|
output='screen',
|
|
|
|
|
env={**os.environ},
|
|
|
|
|
),
|
|
|
|
|
|
|
|
|
|
# ── Ground-plane estimator ───────────────────────────────────────
|
|
|
|
|
ExecuteProcess(
|
|
|
|
|
cmd=[
|
2026-03-15 15:53:39 -05:00
|
|
|
python_exe, '-m', 'tracking_re_id.ground_plane_node',
|
2026-03-15 15:21:03 -05:00
|
|
|
'--ros-args',
|
|
|
|
|
# Foot must stay within 15 cm for 5 consecutive frames
|
|
|
|
|
'-p', 'stable_frames:=5',
|
|
|
|
|
'-p', 'stable_radius:=0.15',
|
|
|
|
|
# Suppress ground points closer than 12 cm to an existing one
|
|
|
|
|
'-p', 'duplicate_radius:=0.12',
|
|
|
|
|
# Points are collinear if none deviates > 5 cm from best-fit line
|
|
|
|
|
'-p', 'collinearity_threshold:=0.05',
|
|
|
|
|
'-p', 'max_ground_points:=100',
|
|
|
|
|
'-p', 'min_plane_points:=3',
|
|
|
|
|
],
|
|
|
|
|
output='screen',
|
|
|
|
|
env={**os.environ},
|
|
|
|
|
),
|
|
|
|
|
|
|
|
|
|
])
|