Skip to content

Commit 94fa393

Browse files
committed
support model path parameter from launch file
1 parent 3e418f2 commit 94fa393

File tree

3 files changed

+21
-8
lines changed

3 files changed

+21
-8
lines changed

turtlebot3_applications/CHANGELOG.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ Changelog for package turtlebot3_applications
66
------------------
77
* Added turtlebot3_yolo_object_detection pkg
88
* Added a Python script that runs the YOLO model on live camera images and publishes detection results with bounding boxes
9-
* Contributor: YeonSoo Noh
9+
* Contributors: YeonSoo Noh
1010

1111
1.2.0 (2025-04-25)
1212
------------------

turtlebot3_yolo_object_detection/CHANGELOG.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,4 +6,4 @@ Changelog for package turtlebot3_yolo_object_detection
66
------------------
77
* Added turtlebot3_yolo_object_detection pkg
88
* Added a Python script that runs the YOLO model on live camera images and publishes detection results with bounding boxes
9-
* Contributor: YeonSoo Noh
9+
* Contributors: YeonSoo Noh

turtlebot3_yolo_object_detection/launch/turtlebot3_yolo_object_detection.launch.py

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,28 @@
1717
# Author: YeonSoo Noh
1818

1919
from launch import LaunchDescription
20+
from launch.actions import DeclareLaunchArgument
21+
from launch.substitutions import LaunchConfiguration
2022
from launch_ros.actions import Node
2123

2224

2325
def generate_launch_description():
26+
model_path_arg = DeclareLaunchArgument(
27+
'model_path',
28+
default_value='~/Downloads/best.pt',
29+
description='Path to the YOLO model file'
30+
)
31+
model_path = LaunchConfiguration('model_path')
32+
33+
object_detection_node = Node(
34+
package='turtlebot3_yolo_object_detection',
35+
executable='turtlebot3_yolo_object_detection',
36+
name='turtlebot3_object_detection_node',
37+
output='screen',
38+
parameters=[{'model_path': model_path}]
39+
)
40+
2441
return LaunchDescription([
25-
Node(
26-
package='turtlebot3_yolo_object_detection',
27-
executable='turtlebot3_yolo_object_detection',
28-
name='turtlebot3_object_detection_node',
29-
output='screen'
30-
)
42+
model_path_arg,
43+
object_detection_node,
3144
])

0 commit comments

Comments
 (0)