0
$\begingroup$

Rosanswers logo

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 launch file to this:

<launch>
  <!-- start gazebo with an empty plane -->
  <param name="/use_sim_time" value="true" />
  
  <node name="gazebo" pkg="gazebo" type="gazebo" args="-u $(find rins_simulation)/worlds/world3_obstacles.world" respawn="false" output="screen"/>

  <include file="$(find rins_simulation)/launch/turtlebot_kinect.launch">
     <arg name="robot_pose" value="-x 3.5 -y 1" />
  </include>

    <param name="base_global_planner" value="carrot_planner/CarrotPlanner"/>

  <!--- Run gmapping -->
  <include file="$(find rins_navigation)/config/gmapping_turtlebot.launch" />


    <!--- Run Move Base -->
  <node pkg="move_base" type="move_base" respawn="false" name="move_base" output="screen">
        <include file="$(find turtlebot_navigation)/config/move_base_turtlebot.launch" />
    <param name="base_global_planner" value="carrot_planner/CarrotPlanner"/>
  </node>

</launch>

If I add

<rosparam file="$(find turtlebot_navigation)/config/costmap_common_params.yaml" command="load" ns="global_costmap" />
<rosparam file="$(find turtlebot_navigation)/config/costmap_common_params.yaml" command="load" ns="local_costmap" />
<rosparam file="$(find turtlebot_navigation)/config/local_costmap_params.yaml" command="load" />
<rosparam file="$(find turtlebot_navigation)/config/global_costmap_params.yaml" command="load" />
<rosparam file="$(find turtlebot_navigation)/params/base_local_planner_params.yaml" command="load" />
d="load" file="$(find turtlebot_navigation

It works fine now. Thanke you!


Originally posted by Febo on ROS Answers with karma: 27 on 2012-07-19

Post score: 2


Original comments

Comment by prince on 2012-07-20:
can you share your cfg file?

Comment by Procópio on 2012-07-20:
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

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

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>

Originally posted by Procópio with karma: 4402 on 2012-07-20

This answer was ACCEPTED on the original site

Post score: 3

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.