diff --git a/demo_cmakelists/12_home.txt b/demo_cmakelists/12_home.txt new file mode 100644 index 0000000..3f995fe --- /dev/null +++ b/demo_cmakelists/12_home.txt @@ -0,0 +1,32 @@ +cmake_minimum_required(VERSION 3.8) +project(home_pkg) + +if(CMAKE_COMPILER_IS_GNUCXX OR CMAKE_CXX_COMPILER_ID MATCHES "Clang") + add_compile_options(-Wall -Wextra -Wpedantic) +endif() + +# find dependencies +find_package(ament_cmake REQUIRED) +# uncomment the following section in order to fill in +# further dependencies manually. +# find_package( REQUIRED) + +install( +DIRECTORY + launch +DESTINATION + share/${PROJECT_NAME}) + +if(BUILD_TESTING) + find_package(ament_lint_auto REQUIRED) + # the following line skips the linter which checks for copyrights + # comment the line when a copyright and license is added to all source files + set(ament_cmake_copyright_FOUND TRUE) + # the following line skips cpplint (only works in a git repo) + # comment the line when this package is in a git repo and when + # a copyright and license is added to all source files + set(ament_cmake_cpplint_FOUND TRUE) + ament_lint_auto_find_test_dependencies() +endif() + +ament_package() diff --git a/demo_launch/12_home.launch.py b/demo_launch/12_home.launch.py new file mode 100644 index 0000000..bdf45dc --- /dev/null +++ b/demo_launch/12_home.launch.py @@ -0,0 +1,86 @@ +import os +from launch import LaunchDescription +from launch_ros.actions import Node +from ament_index_python.packages import get_package_share_directory +from launch.actions import IncludeLaunchDescription +from launch.launch_description_sources import PythonLaunchDescriptionSource + +def generate_launch_description(): + launch_file_dir = os.path.join(get_package_share_directory('wpr_simulation2'), 'launch') + home_mani_cmd = IncludeLaunchDescription( + PythonLaunchDescriptionSource( + os.path.join(launch_file_dir, 'robocup_home_mani.launch.py') + ) + ) + + map_file = os.path.join( + get_package_share_directory('wpr_simulation2'), + 'maps', + 'map.yaml' + ) + + nav_param_file = os.path.join( + get_package_share_directory('wpr_simulation2'), + 'config', + 'nav2_params.yaml' + ) + + nav2_launch_dir = os.path.join( + get_package_share_directory('nav2_bringup'), + 'launch' + ) + + navigation_cmd = IncludeLaunchDescription( + PythonLaunchDescriptionSource([nav2_launch_dir, '/bringup_launch.py']), + launch_arguments={ + 'map': map_file, + 'use_sim_time': "True", + 'params_file': nav_param_file}.items(), + ) + + wp_edit_cmd = Node( + package='wp_map_tools', + executable='wp_edit_node', + name='wp_edit_node' + ) + + wp_navi_server_cmd = Node( + package='wp_map_tools', + executable='wp_navi_server', + name='wp_navi_server' + ) + + objects_publisher_cmd = Node( + package='wpr_simulation2', + executable='objects_publisher', + name='objects_publisher', + parameters=[ + {"auto_start": False} + ] + ) + + grab_object_cmd = Node( + package='wpr_simulation2', + executable='grab_object_sim', + name='grab_object_sim' + ) + + rviz_file = os.path.join(get_package_share_directory('wpr_simulation2'), 'rviz', 'fetch.rviz') + + rviz_cmd = Node( + package='rviz2', + executable='rviz2', + name='rviz2', + arguments=['-d', rviz_file] + ) + + ld = LaunchDescription() + ld.add_action(home_mani_cmd) + ld.add_action(navigation_cmd) + ld.add_action(wp_edit_cmd) + ld.add_action(wp_navi_server_cmd) + ld.add_action(objects_publisher_cmd) + ld.add_action(grab_object_cmd) + ld.add_action(rviz_cmd) + + return ld \ No newline at end of file