Files
gdc_atrium/tracking_re_id/launch/ground_plane.launch.py
2026-03-15 21:46:34 -05:00

57 lines
2.0 KiB
Python

"""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
import sys
sys.path.insert(0, os.path.dirname(__file__))
from _conda_utils import find_conda_python # noqa: E402
from launch import LaunchDescription
from launch.actions import ExecuteProcess
def generate_launch_description():
python_exe = find_conda_python('mmpose')
return LaunchDescription([
# ── Keypoint triangulator (headless) ────────────────────────────
ExecuteProcess(
cmd=[
python_exe, '-m', 'tracking_re_id.single_person_loc_node',
'--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=[
python_exe, '-m', 'tracking_re_id.ground_plane_node',
'--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},
),
])