|
| 1 | +# Copyright 2024 Intelligent Robotics Lab |
| 2 | +# |
| 3 | +# Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | +# you may not use this file except in compliance with the License. |
| 5 | +# You may obtain a copy of the License at |
| 6 | +# |
| 7 | +# http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | +# |
| 9 | +# Unless required by applicable law or agreed to in writing, software |
| 10 | +# distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | +# See the License for the specific language governing permissions and |
| 13 | +# limitations under the License. |
| 14 | + |
| 15 | +import os |
| 16 | + |
| 17 | +from ament_index_python.packages import get_package_share_directory |
| 18 | + |
| 19 | +from launch import LaunchDescription |
| 20 | +from launch.actions import IncludeLaunchDescription |
| 21 | +from launch.launch_description_sources import PythonLaunchDescriptionSource |
| 22 | + |
| 23 | +from launch_ros.actions import Node |
| 24 | + |
| 25 | + |
| 26 | +def generate_launch_description(): |
| 27 | + pkg_dir = get_package_share_directory('local_navigation') |
| 28 | + param_file = os.path.join(pkg_dir, 'config', 'params_perro.yaml') |
| 29 | + |
| 30 | + lidarslam_cmd = IncludeLaunchDescription( |
| 31 | + PythonLaunchDescriptionSource(os.path.join( |
| 32 | + get_package_share_directory('lidarslam'), |
| 33 | + 'launch', |
| 34 | + 'lidarslam_perro.launch.py'))) |
| 35 | + |
| 36 | + statictf_cmd = IncludeLaunchDescription( |
| 37 | + PythonLaunchDescriptionSource(os.path.join( |
| 38 | + get_package_share_directory('go2_description'), |
| 39 | + 'launch', |
| 40 | + 'robot.launch.py'))) |
| 41 | + |
| 42 | + |
| 43 | + |
| 44 | + local_navigation_cmd = Node(package='local_navigation', |
| 45 | + executable='local_navigation_program', |
| 46 | + output='screen', |
| 47 | + parameters=[param_file], |
| 48 | + # prefix=['xterm -e gdb -ex run --args'], |
| 49 | + # prefix=['perf record --call-graph dwarf -o perf.data'], |
| 50 | + arguments=[], |
| 51 | + remappings=[]) |
| 52 | + |
| 53 | + ld = LaunchDescription() |
| 54 | + ld.add_action(local_navigation_cmd) |
| 55 | + ld.add_action(lidarslam_cmd) |
| 56 | + ld.add_action(statictf_cmd) |
| 57 | + |
| 58 | + return ld |
0 commit comments