ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
2

How to change global planner of move_base

asked 2012-07-19 23:39:20 -0600

Febo gravatar image

updated 2012-07-20 07:23:22 -0600

joq gravatar image

Hello, I would like to change global planer from navfn to carrot_planner. I have changed the MoveBase.cfg in navigation/movebase to

gen.add("base_global_planner", str_t, 0, "The name of the plugin for the global planner to use with move_base.", "carrot_planner/CarrotPlanner")

But when I start my turtlebot simulator (gazebo) I think it still uses navfn. If I type rostopic list, there are still all the topics of navfn but no topic of carrot_planner. Is this even the correct way to check what global planner move_base is using?

What am I doing wrong? Or rather what is the proper way to change planner? Keep in mind that I'm still a beginner.

EDIT1: I have tried adding that line in launch file but I don't think it changed anything. Here is my launch file: Here is my move_base cfg file:

    #!/usr/bin/env python

PACKAGE = 'move_base'
import roslib;roslib.load_manifest(PACKAGE)

from dynamic_reconfigure.parameter_generator import *

gen = ParameterGenerator()

gen.add("base_global_planner", str_t, 0, "The name of the plugin for the global planner to use with move_base.", "carrot_planner/CarrotPlanner")
gen.add("base_local_planner", str_t, 0, "The name of the plugin for the local planner to use with move_base.", "base_local_planner/TrajectoryPlannerROS")

#gen.add("recovery_behaviors", str_t, 0, "A list of recovery behavior plugins to use with move_base.", "[{name: conservative_reset, type: clear_costmap_recovery/ClearCostmapRecovery}, {name: rotate_recovery, type: rotate_recovery/RotateRecovery}, {name: aggressive_reset, type: clear_costmap_recovery/ClearCostmapRecovery}]")

gen.add("planner_frequency", double_t, 0, "The rate in Hz at which to run the planning loop.", 0, 0, 100)
gen.add("controller_frequency", double_t, 0, "The rate in Hz at which to run the control loop and send velocity commands to the base.", 20, 0, 100)
gen.add("planner_patience", double_t, 0, "How long the planner will wait in seconds in an attempt to find a valid plan before space-clearing operations are performed.", 5.0, 0, 100)
gen.add("controller_patience", double_t, 0, "How long the controller will wait in seconds without receiving a valid control before space-clearing operations are performed.", 5.0, 0, 100)
gen.add("conservative_reset_dist", double_t, 0, "The distance away from the robot in meters at which obstacles will be cleared from the costmap when attempting to clear space in the map.", 3, 0, 50)

gen.add("recovery_behavior_enabled", bool_t, 0, "Whether or not to enable the move_base recovery behaviors to attempt to clear out space.", True)
# Doesnt exist
gen.add("clearing_rotation_allowed", bool_t, 0, "Determines whether or not the robot will attempt an in-place rotation when attempting to clear out space.", True)
gen.add("shutdown_costmaps", bool_t, 0, "Determines whether or not to shutdown the costmaps of the node when move_base is in an inactive state", False)

gen.add("oscillation_timeout", double_t, 0, "How long in seconds to allow for oscillation before executing recovery behaviors.", 0.0, 0, 60)
gen.add("oscillation_distance", double_t, 0, "How far in meters the robot must move to be considered not to be oscillating.", 0.5, 0, 10)

gen.add("restore_defaults", bool_t, 0, "Restore to the original configuration", False)
exit(gen.generate(PACKAGE, "move_base_node", "MoveBase"))

EDIT2: I've updated my ... (more)

edit retag flag offensive close merge delete

Comments

can you share your cfg file?

prince gravatar image prince  ( 2012-07-20 00:33:21 -0600 )edit
1

you should insert that line inside your move_base node. in your case that should be somewhere inside your move_base_turtlebot.launch file (see example in edited answer). cheers

Procópio gravatar image Procópio  ( 2012-07-20 02:13:36 -0600 )edit

2 Answers

Sort by » oldest newest most voted
3

answered 2012-07-20 00:48:50 -0600

Procópio gravatar image

updated 2012-07-20 02:12:06 -0600

If you are using a launch file to start your simulations, you can include this line INSIDE your move_base node part:

  <!--- Run Move Base -->
  <node pkg="move_base" type="move_base" respawn="false" name="move_base" output="screen">
    <param name="base_global_planner" value="carrot_planner/CarrotPlanner"/>
    <rosparam file="$(find roomba_navigation)/params/costmap_common_params.yaml" command="load" ns="global_costmap" />
    <rosparam file="$(find roomba_navigation)/params/costmap_common_params.yaml" command="load" ns="local_costmap" />
    <rosparam file="$(find roomba_navigation)/params/local_costmap_params.yaml" command="load" />
    <rosparam file="$(find roomba_navigation)/params/global_costmap_params.yaml" command="load" />
    <rosparam file="$(find roomba_navigation)/params/base_local_planner_params.yaml" command="load" />
  </node>
edit flag offensive delete link more
0

answered 2021-03-16 04:20:07 -0600

N.N.Huy gravatar image

Hello, can i change the global planner by my own algorithm, such as A* which i coded by my self ?

edit flag offensive delete link more

Comments

Please delete your answer and add it as a comment.

skpro19 gravatar image skpro19  ( 2021-06-10 07:17:14 -0600 )edit

Question Tools

2 followers

Stats

Asked: 2012-07-19 23:39:20 -0600

Seen: 5,942 times

Last updated: Mar 16 '21