SMACC2
Functions
bringup_launch Namespace Reference

Functions

def generate_launch_description ()
 

Function Documentation

◆ generate_launch_description()

def bringup_launch.generate_launch_description ( )

Definition at line 32 of file bringup_launch.py.

33 # Get the launch directory
34 sm_aws_warehouse_navigation_dir = get_package_share_directory("sm_aws_warehouse_navigation")
35 launch_dir = os.path.join(sm_aws_warehouse_navigation_dir, "launch")
36
37 # Create the launch configuration variables
38 namespace = LaunchConfiguration("namespace")
39 use_namespace = LaunchConfiguration("use_namespace")
40 # slam = LaunchConfiguration("slam")
41 # map_yaml_file = LaunchConfiguration("map")
42 use_sim_time = LaunchConfiguration("use_sim_time")
43 # params_file = LaunchConfiguration("params_file")
44 # default_nav_to_pose_bt_xml = LaunchConfiguration("default_nav_to_pose_bt_xml")
45 # autostart = LaunchConfiguration("autostart")
46
47 stdout_linebuf_envvar = SetEnvironmentVariable("RCUTILS_LOGGING_BUFFERED_STREAM", "1")
48
49 declare_namespace_cmd = DeclareLaunchArgument(
50 "namespace", default_value="", description="Top-level namespace"
51 )
52
53 declare_use_namespace_cmd = DeclareLaunchArgument(
54 "use_namespace",
55 default_value="false",
56 description="Whether to apply a namespace to the navigation stack",
57 )
58
59 # declare_slam_cmd = DeclareLaunchArgument(
60 # "slam", default_value="False", description="Whether run a SLAM"
61 # )
62
63 # declare_map_yaml_cmd = DeclareLaunchArgument(
64 # "map", description="Full path to map yaml file to load"
65 # )
66
67 declare_use_sim_time_cmd = DeclareLaunchArgument(
68 "use_sim_time", default_value="false", description="Use simulation (Gazebo) clock if true"
69 )
70
71 # declare_params_file_cmd = DeclareLaunchArgument(
72 # "params_file",
73 # default_value=os.path.join(
74 # sm_aws_warehouse_navigation_dir, "params", "nav2z_client", "nav2_params.yaml"
75 # ),
76 # description="Full path to the ROS2 parameters file to use for all launched nodes",
77 # )
78
79 # declare_bt_xml_cmd = DeclareLaunchArgument(
80 # "default_nav_to_pose_bt_xml",
81 # default_value=os.path.join(
82 # sm_aws_warehouse_navigation_dir, "params", "nav2z_client", "navigation_tree.xml"
83 # ),
84 # description="Full path to the behavior tree xml file to use",
85 # )
86
87 declare_autostart_cmd = DeclareLaunchArgument(
88 "autostart", default_value="true", description="Automatically startup the nav2 stack"
89 )
90
91 # Specify the actions
92 bringup_cmd_group = GroupAction(
93 [
94 PushRosNamespace(condition=IfCondition(use_namespace), namespace=namespace),
95 # IncludeLaunchDescription(
96 # PythonLaunchDescriptionSource(os.path.join(launch_dir, "slam_launch.py")),
97 # condition=IfCondition(slam),
98 # launch_arguments={
99 # "namespace": namespace,
100 # "use_sim_time": use_sim_time,
101 # "autostart": autostart,
102 # "params_file": params_file,
103 # }.items(),
104 # ),
105 # IncludeLaunchDescription(
106 # PythonLaunchDescriptionSource(os.path.join(launch_dir, "localization_launch.py")),
107 # condition=IfCondition(PythonExpression(["not ", slam])),
108 # launch_arguments={
109 # "namespace": namespace,
110 # "map": map_yaml_file,
111 # "use_sim_time": use_sim_time,
112 # "autostart": autostart,
113 # "params_file": params_file,
114 # "use_lifecycle_mgr": "false",
115 # }.items(),
116 # ),
117 IncludeLaunchDescription(
118 PythonLaunchDescriptionSource(os.path.join(launch_dir, "navigation_launch.py")),
119 launch_arguments={
120 "namespace": namespace,
121 "use_sim_time": use_sim_time,
122 # "autostart": autostart,
123 # "default_nav_to_pose_bt_xml": default_nav_to_pose_bt_xml,
124 "use_lifecycle_mgr": "false",
125 "map_subscribe_transient_local": "false",
126 }.items(),
127 ),
128 ]
129 )
130
131 # Create the launch description and populate
132 ld = LaunchDescription()
133
134 # Set environment variables
135 ld.add_action(stdout_linebuf_envvar)
136
137 # Declare the launch options
138 ld.add_action(declare_namespace_cmd)
139 ld.add_action(declare_use_namespace_cmd)
140 # ld.add_action(declare_slam_cmd)
141 # ld.add_action(declare_map_yaml_cmd)
142 ld.add_action(declare_use_sim_time_cmd)
143 # ld.add_action(declare_params_file_cmd)
144 ld.add_action(declare_autostart_cmd)
145 # ld.add_action(declare_bt_xml_cmd)
146
147 # Add the actions to launch all of the navigation nodes
148 ld.add_action(bringup_cmd_group)
149
150 return ld
def generate_launch_description()