forked from Ar-Ray-code/YOLOX-ROS
-
Notifications
You must be signed in to change notification settings - Fork 0
/
yolox_nano_onnx_camera.launch.py
49 lines (42 loc) · 1.45 KB
/
yolox_nano_onnx_camera.launch.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
import launch
import launch_ros.actions
from launch.actions import DeclareLaunchArgument
from ament_index_python.packages import get_package_share_directory
from launch.launch_description_sources import PythonLaunchDescriptionSource
from launch.substitutions import LaunchConfiguration
from urllib.request import urlretrieve
import os
def generate_launch_description():
yolox_ros_share_dir = get_package_share_directory('yolox_ros_py')
video_device = LaunchConfiguration('video_device', default='/dev/video0')
video_device_arg = DeclareLaunchArgument(
'video_device',
default_value='/dev/video0',
description='Video device'
)
webcam = launch_ros.actions.Node(
package="v4l2_camera", executable="v4l2_camera_node",
parameters=[
{"image_size": [640,480]},
{"video_device": video_device},
],
)
yolox_onnx = launch_ros.actions.Node(
package="yolox_ros_py", executable="yolox_onnx",output="screen",
parameters=[
{"input_shape/width": 416},
{"input_shape/height": 416},
{"with_p6" : False},
{"model_path" : yolox_ros_share_dir+"/yolox_nano.onnx"},
{"conf" : 0.3},
],
)
rqt_graph = launch_ros.actions.Node(
package="rqt_graph", executable="rqt_graph",
)
return launch.LaunchDescription([
video_device_arg,
webcam,
yolox_onnx,
# rqt_graph
])