update nav2 launch
This commit is contained in:
parent
a391de527d
commit
8b5f01d0ec
@ -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(<dependency> 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()
|
||||
|
50
locker98_tools_bringup/launch/nav2.launch.py
Normal file
50
locker98_tools_bringup/launch/nav2.launch.py
Normal file
@ -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
|
||||
])
|
@ -1 +0,0 @@
|
||||
|
@ -1 +1,12 @@
|
||||
|
||||
<launch>
|
||||
<arg name="use_sim_time" default="False" />
|
||||
<arg name="map"/>
|
||||
|
||||
<include file="$(find-pkg-share nav2_bringup)/launch/bringup_launch.py">
|
||||
<arg name="map" value="$(arg map)"/>
|
||||
<arg name="use_sim_time" value="$(arg use_sim_time)"/>
|
||||
</include>
|
||||
|
||||
<!--<node pkg="rviz2" executable="rviz2" output="screen" args="-d $(find-pkg-share locker98_tools_bringup)/rviz/nav2_config.rviz" />
|
||||
-->
|
||||
</launch>
|
||||
|
@ -8,6 +8,10 @@
|
||||
<license>GNU 3.0</license>
|
||||
|
||||
<buildtool_depend>ament_cmake</buildtool_depend>
|
||||
|
||||
|
||||
<exec_depend>my_robot1_description</exec_depend>
|
||||
|
||||
|
||||
<test_depend>ament_lint_auto</test_depend>
|
||||
<test_depend>ament_lint_common</test_depend>
|
||||
|
BIN
locker98_tools_bringup/rviz/my_map.pgm
Normal file
BIN
locker98_tools_bringup/rviz/my_map.pgm
Normal file
Binary file not shown.
7
locker98_tools_bringup/rviz/my_map.yaml
Normal file
7
locker98_tools_bringup/rviz/my_map.yaml
Normal file
@ -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
|
Loading…
Reference in New Issue
Block a user