-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathonline_01_runcam.launch.py
62 lines (54 loc) · 1.62 KB
/
online_01_runcam.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
55
56
57
58
59
60
61
62
from launch import LaunchDescription
from launch_ros.actions import Node
from launch.actions import ExecuteProcess
from ament_index_python.packages import get_package_prefix
def generate_launch_description():
# Get realsense2_camera package path
# realsense2_camera_prefix = get_package_prefix('realsense2_camera')
# # Define the nodes
# realsense_node = Node(
# package='realsense2_camera',
# executable='realsense2_camera_node',
# name='realsense2_camera_node',
# parameters=[{
# 'rgb_camera.profile': '1920x1080x30'
# }],
# output='screen'
# )
# ros2 bag record command
record_node = ExecuteProcess(
cmd=['ros2', 'bag', 'record', '--all'],
output='screen'
)
# rviz2 command
rviz_node = ExecuteProcess(
cmd=[get_package_prefix('rviz2') + '/lib/rviz2/rviz2', '-d','.l.rviz/realsense.rviz'],
output='screen'
)
# cam2image command
cam2image_node = Node(
package='image_tools',
executable='cam2image',
name='cam2image_node',
parameters=[{
'device_id': 2,
'width': 1280,
'height': 720,
'frequency': 30.0
}],
output='screen'
)
# republish command
republish_node = Node(
package='image_transport',
executable='republish',
name='republish_node',
arguments=['raw', 'in:=image', 'raw', 'out:=/camera/image_raw'],
output='screen'
)
return LaunchDescription([
#record_node,
rviz_node,
cam2image_node,
republish_node
])