diff --git a/locker98_tools_bringup/CMakeLists.txt b/locker98_tools_bringup/CMakeLists.txt index 9df360e..9b35e1b 100644 --- a/locker98_tools_bringup/CMakeLists.txt +++ b/locker98_tools_bringup/CMakeLists.txt @@ -7,20 +7,10 @@ endif() # find dependencies find_package(ament_cmake REQUIRED) -# uncomment the following section in order to fill in -# further dependencies manually. -# find_package( REQUIRED) -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() +install( + DIRECTORY launch rviz worlds + DESTINATION share/${PROJECT_NAME}/ +) ament_package() diff --git a/locker98_tools_bringup/launch/nav2.launch.py b/locker98_tools_bringup/launch/nav2.launch.py new file mode 100644 index 0000000..c3f76b1 --- /dev/null +++ b/locker98_tools_bringup/launch/nav2.launch.py @@ -0,0 +1,50 @@ +from launch import LaunchDescription +import os +from ament_index_python import get_package_share_directory +from launch_ros.parameter_descriptions import ParameterValue +from launch.substitutions import LaunchConfiguration +from launch_ros.actions import Node +from launch.actions import DeclareLaunchArgument, IncludeLaunchDescription + +def generate_launch_description(): + + # Declare the arguments + use_sim_time = LaunchConfiguration('use_sim_time', default='False') + map = LaunchConfiguration('map') + + # Define RViz config path + rviz_config_path = os.path.join( + get_package_share_directory('locker98_tools_bringup'), + 'rviz', 'nav2_config.rviz' + ) + + # Include the bringup launch file + bringup_launch_file = os.path.join( + get_package_share_directory('nav2_bringup'), + 'launch', 'bringup_launch.py' + ) + + # Include the bringup launch file and pass arguments + include_bringup = IncludeLaunchDescription( + bringup_launch_file, + launch_arguments={ + 'use_sim_time': use_sim_time, + 'map': map + }.items() + ) + + # RViz node + rviz2_node = Node( + package='rviz2', + executable='rviz2', + output='screen', + arguments=['-d', rviz_config_path] + ) + + # Return LaunchDescription + return LaunchDescription([ + DeclareLaunchArgument('use_sim_time', default_value='False', description='Use simulation time'), + DeclareLaunchArgument('map', default_value='', description='Map input'), + include_bringup, + rviz2_node + ]) diff --git a/locker98_tools_bringup/launch/nav2.launch.xml b/locker98_tools_bringup/launch/nav2.launch.xml deleted file mode 100644 index 8d1c8b6..0000000 --- a/locker98_tools_bringup/launch/nav2.launch.xml +++ /dev/null @@ -1 +0,0 @@ - diff --git a/locker98_tools_bringup/launch/slam.launch.xml b/locker98_tools_bringup/launch/slam.launch.xml index 8d1c8b6..67e7033 100644 --- a/locker98_tools_bringup/launch/slam.launch.xml +++ b/locker98_tools_bringup/launch/slam.launch.xml @@ -1 +1,12 @@ - + + + + + + + + + + + diff --git a/locker98_tools_bringup/package.xml b/locker98_tools_bringup/package.xml index e8a56f3..66e1713 100644 --- a/locker98_tools_bringup/package.xml +++ b/locker98_tools_bringup/package.xml @@ -8,6 +8,10 @@ GNU 3.0 ament_cmake + + + my_robot1_description + ament_lint_auto ament_lint_common diff --git a/locker98_tools_bringup/rviz/my_map.pgm b/locker98_tools_bringup/rviz/my_map.pgm new file mode 100644 index 0000000..f1133f3 Binary files /dev/null and b/locker98_tools_bringup/rviz/my_map.pgm differ diff --git a/locker98_tools_bringup/rviz/my_map.yaml b/locker98_tools_bringup/rviz/my_map.yaml new file mode 100644 index 0000000..0bac341 --- /dev/null +++ b/locker98_tools_bringup/rviz/my_map.yaml @@ -0,0 +1,7 @@ +image: my_map.pgm +mode: trinary +resolution: 0.05 +origin: [-3.25, -3.99, 0] +negate: 0 +occupied_thresh: 0.65 +free_thresh: 0.25 \ No newline at end of file