|
| 1 | +# Copyright (C) 2023 Miguel Ángel González Santamarta |
| 2 | + |
| 3 | +# This program is free software: you can redistribute it and/or modify |
| 4 | +# it under the terms of the GNU General Public License as published by |
| 5 | +# the Free Software Foundation, either version 3 of the License, or |
| 6 | +# (at your option) any later version. |
| 7 | + |
| 8 | +# This program is distributed in the hope that it will be useful, |
| 9 | +# but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 10 | +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 11 | +# GNU General Public License for more details. |
| 12 | + |
| 13 | +# You should have received a copy of the GNU General Public License |
| 14 | +# along with this program. If not, see <https://www.gnu.org/licenses/>. |
| 15 | + |
| 16 | + |
| 17 | +import os |
| 18 | +from launch import LaunchDescription |
| 19 | +from launch.substitutions import LaunchConfiguration |
| 20 | +from launch.actions import IncludeLaunchDescription |
| 21 | +from launch.launch_description_sources import PythonLaunchDescriptionSource |
| 22 | +from ament_index_python.packages import get_package_share_directory |
| 23 | + |
| 24 | + |
| 25 | +def generate_launch_description(): |
| 26 | + |
| 27 | + return LaunchDescription([ |
| 28 | + IncludeLaunchDescription( |
| 29 | + PythonLaunchDescriptionSource( |
| 30 | + os.path.join(get_package_share_directory( |
| 31 | + "yolov8_bringup"), "launch", "yolov8.launch.py")), |
| 32 | + launch_arguments={ |
| 33 | + "model": LaunchConfiguration("model", default="yolov10m.pt"), |
| 34 | + "tracker": LaunchConfiguration("tracker", default="bytetrack.yaml"), |
| 35 | + "device": LaunchConfiguration("device", default="cuda:0"), |
| 36 | + "enable": LaunchConfiguration("enable", default="True"), |
| 37 | + "threshold": LaunchConfiguration("threshold", default="0.5"), |
| 38 | + "input_image_topic": LaunchConfiguration("input_image_topic", default="/camera/rgb/image_raw"), |
| 39 | + "image_reliability": LaunchConfiguration("image_reliability", default="2"), |
| 40 | + "namespace": LaunchConfiguration("namespace", default="yolo"), |
| 41 | + }.items(), |
| 42 | + ) |
| 43 | + ]) |
0 commit comments