2023-06-07 09:44:38 +00:00
|
|
|
# Copyright 2022 Factor Robotics
|
|
|
|
#
|
|
|
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
# you may not use this file except in compliance with the License.
|
|
|
|
# You may obtain a copy of the License at
|
|
|
|
#
|
|
|
|
# http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
#
|
|
|
|
# Unless required by applicable law or agreed to in writing, software
|
|
|
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
# See the License for the specific language governing permissions and
|
|
|
|
# limitations under the License.
|
|
|
|
|
|
|
|
import os
|
|
|
|
from launch import LaunchDescription
|
|
|
|
from launch.substitutions import Command, FindExecutable, PathJoinSubstitution
|
|
|
|
from launch_ros.actions import Node
|
|
|
|
from launch_ros.substitutions import FindPackageShare
|
|
|
|
from ament_index_python.packages import get_package_share_directory
|
|
|
|
from launch_ros.actions import LifecycleNode
|
|
|
|
from launch_ros.descriptions import ParameterValue
|
|
|
|
|
2023-12-07 11:13:16 +00:00
|
|
|
from launch.substitutions import LaunchConfiguration, PythonExpression
|
|
|
|
from launch.actions import DeclareLaunchArgument, GroupAction, SetEnvironmentVariable
|
2023-06-07 09:44:38 +00:00
|
|
|
|
|
|
|
def generate_launch_description():
|
|
|
|
|
2023-12-07 11:13:16 +00:00
|
|
|
namespace = LaunchConfiguration('namespace')
|
|
|
|
use_sim_time = LaunchConfiguration('use_sim_time')
|
2023-06-07 09:44:38 +00:00
|
|
|
|
2023-12-07 11:13:16 +00:00
|
|
|
declare_namespace_cmd = DeclareLaunchArgument(
|
|
|
|
'namespace',
|
|
|
|
default_value='',
|
|
|
|
description='Top-level namespace')
|
2023-06-07 09:44:38 +00:00
|
|
|
|
2023-12-07 11:13:16 +00:00
|
|
|
declare_use_sim_time_cmd = DeclareLaunchArgument(
|
|
|
|
'use_sim_time',
|
|
|
|
default_value='false',
|
|
|
|
description='Use simulation (Gazebo) clock if true')
|
2023-06-07 09:44:38 +00:00
|
|
|
|
|
|
|
cam_node = Node(
|
|
|
|
package="ros2_cam_openCV",
|
2023-12-07 11:13:16 +00:00
|
|
|
executable="cam_node",
|
|
|
|
namespace=namespace
|
2023-06-07 09:44:38 +00:00
|
|
|
)
|
|
|
|
|
|
|
|
lidar_dir = os.path.join(get_package_share_directory('lslidar_driver'), 'params', 'lsx10.yaml')
|
|
|
|
lidar_node = LifecycleNode(
|
|
|
|
package='lslidar_driver',
|
|
|
|
executable='lslidar_driver_node',
|
|
|
|
name='lslidar_driver_node',
|
|
|
|
output='screen',
|
|
|
|
emulate_tty=True,
|
|
|
|
namespace='',
|
|
|
|
parameters=[lidar_dir],
|
|
|
|
)
|
|
|
|
|
|
|
|
return LaunchDescription([
|
2023-12-07 11:13:16 +00:00
|
|
|
cam_node
|
2023-06-07 09:44:38 +00:00
|
|
|
])
|