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

Run algorithm Dijkstra and A star

asked 2017-03-13 15:39:50 -0500

SofiaG gravatar image

I would like to know if someone can help me by indicating how the launch file is built in order to execute the Dijkstra and A starr algorithms available in ROS, since the page only brings the parameters and I am new to this.

edit retag flag offensive close merge delete


This is very vague and so I will need more details in order to help you. What 'page' are you referring to. Can you provide a link? If you haven't already check out the navigation stack tutorials.. Also what version of ROS are you using?

shoemakerlevy9 gravatar image shoemakerlevy9  ( 2017-03-13 17:44:38 -0500 )edit

Hello Shoemakerlevy9 thanks for replying. I am using the Indigo version of ROS, and there is no way to execute the algorithms that are in the "global_planner" package, the page where the parameters are in the following . And take a look at the link pr

SofiaG gravatar image SofiaG  ( 2017-03-14 23:58:52 -0500 )edit

I believe that ROS indigo uses navfn by default, which can only do dijkstra. In order to use A* you must download global_planner. I think I was able to use apt-get to install it. Once you do that the page you linked to will make a lot more sense.

shoemakerlevy9 gravatar image shoemakerlevy9  ( 2017-03-15 00:27:15 -0500 )edit

Ok thanks!! I think I'm going to read a little more because I'm lost, I understand that it installs separately, because it enters in super user mode to my folders of global_planner and it does not bring any algorithm. Sorry for being a bit silly but I am very new to this and I work hard to understan

SofiaG gravatar image SofiaG  ( 2017-03-28 00:02:54 -0500 )edit

3 Answers

Sort by ยป oldest newest most voted

answered 2017-03-29 08:39:11 -0500

I personally use the move_base package with ROS Indigo to run both Dijkstra and A*. In my launch file i have:

<!-- Move_Base node -->
<node pkg="move_base" type="move_base" name="move_base" output="screen" >
    <rosparam file="/path/to/file/costmap_common_params.yaml" command="load" ns="global_costmap" />
    <rosparam file="/path/to/file/costmap_common_params.yaml" command="load" ns="local_costmap" />
    <rosparam file="/path/to/file/local_costmap_params.yaml" command="load" />
    <rosparam file="/path/to/file/global_costmap_params.yaml" command="load" />
    <rosparam file="/path/to/file/base_local_planner_params.yaml" command="load" />    

Inside base_local_planner_params.yaml I specify

# Global Planner Parameters
  allow_unknown: false
  use_dijkstra: false #Use A* instead
  use_quadratic: true
  use_grid_path: false
  old_navfn_behavior: false

The use_dijikstra parameter is the one that specifies whether A* or Dijkstra will be used.

1) ROS indigo uses navfn by default, which can only do Dijkstra. In order to use A* you must download global_planner.
2) Once things are setup you should verify that the parameters are actually getting loaded correctly by using rosparam. This type of thing won't give you an error and so you could be using Dijkstra for a long time while thinking that your actually using A*.
3) If the parameters aren't being loaded correctly, the first thing I usually check is the namespaces (ns). They can be tricky.

edit flag offensive delete link more


Thanks friend, I think with these indications if it is possible to run the algorithm. I'll try it and talk to you as I did.

SofiaG gravatar image SofiaG  ( 2017-04-03 12:14:27 -0500 )edit

I apologize and follow all the indications that you provided but I can not make the algorithm work, I do not know if I am missing something or doing something wrong

SofiaG gravatar image SofiaG  ( 2017-04-18 01:51:25 -0500 )edit

Hello, sorry to bother you so much, but I already followed all the steps that you indicated in my workspace to execute the algorithm and I did not work, I do not know if something is wrong but I would appreciate it if you could send the package to my email,

SofiaG gravatar image SofiaG  ( 2017-04-20 22:43:48 -0500 )edit

Amiga already sent you mail with some things that can help you check it

Monserrat gravatar image Monserrat  ( 2017-06-19 14:53:40 -0500 )edit

answered 2017-06-19 14:54:09 -0500

Monserrat gravatar image

Hi, I could already execute them but I can not see in the terminal the runtime and the length of the path of each algorithm. I like to know how to edit the Dijkstra (dijkstra.cpp) and A * (astar.cpp) codes to see this information in the terminal Is there any code that contains this information? Or what do I do to modify or add the code to see the runtime and the length of the path? I even read the motion packet in the database but I do not know how to get the information or what topic helps me with this.

edit flag offensive delete link more

answered 2017-07-06 03:21:40 -0500

dmkarage gravatar image

Hi guys, I would like to ask you if it is possible to run the A* or Dijkstra algorithm to plan a path for a human. Let's say that I have the costmap, the start and end desired position and I want to guess a possible path for the human between these two positions. Can I run one of the algorithms on their own (without having to start move_base) to compute this path?

edit flag offensive delete link more

Question Tools

1 follower


Asked: 2017-03-13 15:39:50 -0500

Seen: 4,033 times

Last updated: Jul 06 '17