nodding_lidar
Toggle main menu visibility
読み取り中…
検索中…
一致する文字列を見つけられません
nav_launch.py
[詳解]
1
"""機体の制御、EKFによる位置推定、首振り2D LiDAR、保存済み地図を使うNav2を起動する。"""
2
from
launch
import
LaunchDescription
3
from
launch.actions
import
DeclareLaunchArgument, IncludeLaunchDescription
4
from
launch.launch_description_sources
import
PythonLaunchDescriptionSource
5
from
launch.substitutions
import
LaunchConfiguration, PathJoinSubstitution
6
from
launch_ros.substitutions
import
FindPackageShare
7
8
9
def
generate_launch_description
():
10
mirs = IncludeLaunchDescription(
11
PythonLaunchDescriptionSource(PathJoinSubstitution([
12
FindPackageShare(
'mirs'
),
'launch'
,
'mirs_launch.py'
])),
13
launch_arguments={
14
'esp_port'
: LaunchConfiguration(
'esp_port'
),
15
'lidar_port'
: LaunchConfiguration(
'lidar_port'
),
16
'lidar_baudrate'
: LaunchConfiguration(
'lidar_baudrate'
),
17
'map'
: LaunchConfiguration(
'map'
),
18
'use_sim_time'
: LaunchConfiguration(
'use_sim_time'
),
19
'enable_lidar'
:
'false'
,
20
'enable_ekf_local'
:
'true'
,
21
'enable_rviz'
:
'true'
,
22
'enable_nav2'
:
'true'
,
23
'enable_slam_toolbox'
:
'false'
,
24
}.items(),
25
)
26
nodding = IncludeLaunchDescription(
27
PythonLaunchDescriptionSource(PathJoinSubstitution([
28
FindPackageShare(
'nodding_lidar'
),
'launch'
,
'lidar_launch.py'
])),
29
launch_arguments={
30
'enable_nodding_lidar'
:
'true'
,
31
'servo_serial_port'
: LaunchConfiguration(
'servo_angle_port'
),
32
'lidar_port'
: LaunchConfiguration(
'lidar_port'
),
33
'lidar_baudrate'
: LaunchConfiguration(
'lidar_baudrate'
),
34
'enable_lidar'
:
'true'
,
35
'use_sim_time'
: LaunchConfiguration(
'use_sim_time'
),
36
'fixed_frame'
:
'odom'
,
37
'enable_rviz'
:
'false'
,
38
}.items(),
39
)
40
return
LaunchDescription([
41
DeclareLaunchArgument(
'esp_port'
, default_value=
'/dev/ttyUSB1'
),
42
DeclareLaunchArgument(
'lidar_port'
, default_value=
'/dev/ttyUSB0'
),
43
DeclareLaunchArgument(
'servo_angle_port'
, default_value=
'/dev/ttyACM0'
),
44
DeclareLaunchArgument(
'lidar_baudrate'
, default_value=
'256000'
),
45
DeclareLaunchArgument(
'use_sim_time'
, default_value=
'false'
),
46
DeclareLaunchArgument(
'map'
, default_value=PathJoinSubstitution([
47
FindPackageShare(
'mirs'
),
'maps'
,
'es.yaml'
])),
48
mirs,
49
nodding,
50
])
nav_launch.generate_launch_description
generate_launch_description()
定義
nav_launch.py:9
launch
nav_launch.py
構築:
1.18.0