chore(agv_pro_navigation2): clean nav launch and example script
This commit is contained in:
@@ -3,11 +3,7 @@ import os
|
||||
from ament_index_python.packages import get_package_share_directory
|
||||
|
||||
from launch import LaunchDescription
|
||||
from launch.actions import (
|
||||
DeclareLaunchArgument,
|
||||
GroupAction,
|
||||
IncludeLaunchDescription,
|
||||
)
|
||||
from launch.actions import DeclareLaunchArgument, GroupAction, IncludeLaunchDescription
|
||||
from launch.conditions import IfCondition
|
||||
from launch.launch_description_sources import PythonLaunchDescriptionSource
|
||||
from launch.substitutions import LaunchConfiguration
|
||||
@@ -19,26 +15,16 @@ def generate_launch_description():
|
||||
use_rviz = LaunchConfiguration('use_rviz', default='true')
|
||||
map_dir = LaunchConfiguration(
|
||||
'map',
|
||||
default=os.path.join(
|
||||
get_package_share_directory('agv_pro_navigation2'),
|
||||
'map',
|
||||
'map.yaml'))
|
||||
default=os.path.join(get_package_share_directory('agv_pro_navigation2'), 'map', 'map.yaml'))
|
||||
|
||||
param_file_name = 'agvpro.yaml'
|
||||
param_dir = LaunchConfiguration(
|
||||
'params_file',
|
||||
default=os.path.join(
|
||||
get_package_share_directory('agv_pro_navigation2'),
|
||||
'param',
|
||||
param_file_name))
|
||||
default=os.path.join(get_package_share_directory('agv_pro_navigation2'), 'param', param_file_name))
|
||||
|
||||
nav2_launch_file_dir = os.path.join(
|
||||
get_package_share_directory('nav2_bringup'), 'launch')
|
||||
nav2_launch_file_dir = os.path.join(get_package_share_directory('nav2_bringup'), 'launch')
|
||||
|
||||
rviz_config_dir = os.path.join(
|
||||
get_package_share_directory('agv_pro_navigation2'),
|
||||
'rviz',
|
||||
'agvpro_navigation2.rviz')
|
||||
rviz_config_dir = os.path.join(get_package_share_directory('agv_pro_navigation2'), 'rviz', 'agvpro_navigation2.rviz')
|
||||
|
||||
return LaunchDescription([
|
||||
DeclareLaunchArgument(
|
||||
|
||||
@@ -16,11 +16,6 @@ Basic navigation demo to go to pose.
|
||||
|
||||
def parse_arguments():
|
||||
parser = argparse.ArgumentParser(description='Send navigation test goals.')
|
||||
parser.add_argument(
|
||||
'--localization',
|
||||
choices=('amcl', 'slam'),
|
||||
default='amcl',
|
||||
help='Localization backend started by navigation2_active.launch.py.')
|
||||
parser.add_argument(
|
||||
'targets',
|
||||
nargs='*',
|
||||
@@ -99,14 +94,9 @@ if __name__ == '__main__':
|
||||
rclpy.init()
|
||||
navigator = BasicNavigator()
|
||||
|
||||
if cli_args.localization == 'slam':
|
||||
# slam_toolbox on Humble is not a Nav2 lifecycle-managed localizer.
|
||||
navigator._waitForNodeToActivate('bt_navigator')
|
||||
navigator.info('Nav2 is ready for use!')
|
||||
else:
|
||||
# AMCL obtains its initial origin pose from agvpro.yaml.
|
||||
navigator.initial_pose_received = True
|
||||
navigator.waitUntilNav2Active()
|
||||
# AMCL obtains its initial origin pose from agvpro.yaml.
|
||||
navigator.initial_pose_received = True
|
||||
navigator.waitUntilNav2Active()
|
||||
|
||||
# Try to load waypoints from YAML, fallback to hardcoded defaults
|
||||
waypoints = {}
|
||||
|
||||
Reference in New Issue
Block a user