forked from Ar-Ray-code/YOLOX-ROS
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathyolox_nano_onnx_gazebo.launch.py
54 lines (45 loc) · 1.62 KB
/
yolox_nano_onnx_gazebo.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
50
51
52
53
54
import os
from ament_index_python.packages import get_package_share_directory
from launch import LaunchDescription
from launch.actions import IncludeLaunchDescription
from launch.launch_description_sources import PythonLaunchDescriptionSource
import launch_ros
def generate_launch_description():
gazebo_ros_share_dir = get_package_share_directory('gazebo_ros')
yolox_ros_share_dir = get_package_share_directory('yolox_ros_py')
gazebo_plugins_share_dir = get_package_share_directory('gazebo_plugins')
world = os.path.join(
gazebo_plugins_share_dir,
'worlds',
'gazebo_ros_camera_demo.world'
)
gzserver_cmd = IncludeLaunchDescription(
PythonLaunchDescriptionSource(
os.path.join(gazebo_ros_share_dir, 'launch', 'gzserver.launch.py')
),
launch_arguments={'world': world}.items()
)
gzclient_cmd = IncludeLaunchDescription(
PythonLaunchDescriptionSource(
os.path.join(gazebo_ros_share_dir, 'launch', 'gzclient.launch.py')
)
)
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},
{"sensor_qos_mode" : True},
],
remappings=[
("/image_raw", "/demo_cam/camera1/image_raw"),
],
)
return LaunchDescription([
gzserver_cmd,
gzclient_cmd,
yolox_onnx,
])