2021-08-04 02:33:15 +00:00
|
|
|
import os
|
2021-08-10 03:49:18 +00:00
|
|
|
|
2021-08-04 02:33:15 +00:00
|
|
|
from ament_index_python.packages import get_package_share_directory
|
|
|
|
from launch_ros.actions import Node
|
|
|
|
|
2021-08-10 03:49:18 +00:00
|
|
|
from launch import LaunchDescription
|
|
|
|
from launch.actions import DeclareLaunchArgument
|
|
|
|
from launch.substitutions import LaunchConfiguration
|
|
|
|
|
2021-08-04 02:33:15 +00:00
|
|
|
|
|
|
|
def generate_launch_description():
|
|
|
|
ld = LaunchDescription()
|
|
|
|
config = os.path.join(
|
|
|
|
get_package_share_directory("explore_lite"), "config", "params.yaml"
|
|
|
|
)
|
2021-08-10 03:49:18 +00:00
|
|
|
use_sim_time = LaunchConfiguration("use_sim_time")
|
|
|
|
|
|
|
|
declare_use_sim_time_argument = DeclareLaunchArgument(
|
|
|
|
"use_sim_time", default_value="true", description="Use simulation/Gazebo clock"
|
|
|
|
)
|
2021-08-04 02:33:15 +00:00
|
|
|
|
|
|
|
node = Node(
|
|
|
|
package="explore_lite",
|
|
|
|
name="explore_node",
|
|
|
|
executable="explore",
|
2021-08-10 03:49:18 +00:00
|
|
|
parameters=[config, {"use_sim_time": use_sim_time}],
|
2021-08-04 02:33:15 +00:00
|
|
|
output="screen",
|
|
|
|
)
|
2021-08-10 03:49:18 +00:00
|
|
|
ld.add_action(declare_use_sim_time_argument)
|
2021-08-04 02:33:15 +00:00
|
|
|
ld.add_action(node)
|
|
|
|
return ld
|