-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathkenning-instance-segmentation.py
64 lines (56 loc) · 1.89 KB
/
kenning-instance-segmentation.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
55
56
57
58
59
60
61
62
63
64
# Copyright (c) 2022-2024 Antmicro <www.antmicro.com>
#
# SPDX-License-Identifier: Apache-2.0
import launch
from launch_ros.actions import ComposableNodeContainer
from launch_ros.descriptions import ComposableNode
from launch.actions import ExecuteProcess
from launch.actions import DeclareLaunchArgument
from launch.substitutions import LaunchConfiguration
def generate_launch_description():
camera_path = DeclareLaunchArgument(
"camera_path",
default_value="/dev/video0",
description="Path to camera device"
)
camera_node_container = ComposableNodeContainer(
name='camera_node_container',
namespace='camera_node',
package='rclcpp_components',
executable='component_container',
composable_node_descriptions=[
ComposableNode(
package='camera_node',
plugin='camera_node::CameraNode',
name='camera_node',
parameters=[
{'camera_path': LaunchConfiguration("camera_path")}
]
),
],
output='both',
)
gui_node = ComposableNodeContainer(
name='gui_container',
namespace='',
package='rclcpp_components',
executable='component_container',
composable_node_descriptions=[
ComposableNode(
package='gui_node',
plugin='gui_node::KenningYolactGuiComponent',
name='sample_gui_node')
],
output='both',
on_exit=launch.actions.Shutdown()
)
kenning_node = ExecuteProcess(
name="kenning_node",
cmd='kenning flow --json-cfg ./src/gui_node/examples/kenning-instance-segmentation/kenning-instance-segmentation.json'.split(' ') # noqa: E501
)
return launch.LaunchDescription([
camera_path,
camera_node_container,
gui_node,
kenning_node,
])