Ask Your Question
0

How to load parameter file for global_costmap node started by nav2_planner?

asked 2021-08-20 08:32:50 -0500

ahopsu gravatar image

Hi!

I want to use only the path planning feature in ROS2 Navigation2. My problem is, that when I'm launching the nav2_planner, it starts the global_costmap node automatically. I have a parameter file, which contains only parameters for the global costmap.

How do I provide the parameter file successfully for the global_costmap to load it? (by not launching myself another instance of global_costmap?) Below is the launch file I'm using.

import launch
from launch.substitutions import Command, LaunchConfiguration
import launch_ros
import os

def generate_launch_description():

    lifecycle_nodes = ['map_server',
                       'amcl',
                       'planner_server']

    return launch.LaunchDescription([

        launch_ros.actions.Node(
            package='nav2_map_server',
            executable='map_server',
            name='map_server',
            output='screen',
            parameters=[{'yaml_filename':'~/map.yaml'}]),

        launch_ros.actions.Node(
            package='nav2_amcl',
            executable='amcl',
            name='amcl',
            output='screen'),
            #parameters=[{''}]),

        launch_ros.actions.Node(
            package='nav2_planner',
            executable='planner_server',
            name='planner_server',
            output='screen'),
            #parameters=[{'params_file':'~/path_planner_params.yaml'}]),

        launch_ros.actions.Node(
            package='nav2_lifecycle_manager',
            executable='lifecycle_manager',
            name='lifecycle_manager_planning',
            output='screen',
            parameters=[{'use_sim_time':False},
                {'autostart': True},
                {'node_names': lifecycle_nodes},
                #{'params_file':'~/path_planner_params.yaml'}]),
    ])
edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2021-08-20 08:47:12 -0500

ahopsu gravatar image

I actually solved it by myself: Just put the path/filename to the parameters.

launch_ros.actions.Node(
        package='nav2_planner',
        executable='planner_server',
        name='planner_server',
        output='screen',
        parameters=['~/path_planner_params.yaml']),
edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower

Stats

Asked: 2021-08-20 08:32:50 -0500

Seen: 17 times

Last updated: Aug 20 '21