2026-03-15 19:58:52 -05:00
|
|
|
"""Reid pipeline in headless mode (no cv2 display windows).
|
|
|
|
|
|
|
|
|
|
To view output:
|
|
|
|
|
ros2 run rqt_image_view rqt_image_view → select /reid/annotated
|
|
|
|
|
rviz2 → add MarkerArray on /reid/track_markers and /keypoint_markers
|
|
|
|
|
"""
|
|
|
|
|
|
|
|
|
|
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 19:58:52 -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 19:58:52 -05:00
|
|
|
keyreID_path = os.path.expanduser('~/KeyRe-ID')
|
|
|
|
|
|
|
|
|
|
return LaunchDescription([
|
|
|
|
|
|
|
|
|
|
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},
|
|
|
|
|
),
|
|
|
|
|
|
|
|
|
|
ExecuteProcess(
|
|
|
|
|
cmd=[
|
|
|
|
|
python_exe, '-m', 'tracking_re_id.reid_node',
|
|
|
|
|
'--ros-args',
|
|
|
|
|
'-p', f'keyreID_path:={keyreID_path}',
|
|
|
|
|
'-p', 'num_classes:=150',
|
|
|
|
|
'-p', 'camera_num:=2',
|
|
|
|
|
'-p', 'device:=cuda:0',
|
|
|
|
|
'-p', 'seq_len:=4',
|
|
|
|
|
'-p', 'kp_threshold:=0.3',
|
|
|
|
|
'-p', 'match_threshold:=0.65',
|
|
|
|
|
'-p', 'track_dist_px:=120.0',
|
|
|
|
|
'-p', 'track_timeout:=3.0',
|
|
|
|
|
'-p', 'headless:=true',
|
|
|
|
|
],
|
|
|
|
|
output='screen',
|
|
|
|
|
env={**os.environ},
|
|
|
|
|
),
|
|
|
|
|
|
|
|
|
|
])
|