0

Rosanswers logo

Hi

I have created a custom global planner based on Genetic Algorithm.

I followed this tutorial:

http://wiki.ros.org/navigation/Tutorials/Writing%20A%20Global%20Path%20Planner%20As%20Plugin%20in%20ROS

In the constructor:

GeneticAlgorithmGlobalPlanner(std::string name, costmap_2d::Costmap2DROS* costmap_ros,

int numberOfIterations, int populationSize, int crossType, float crossProbability, float mutationProbability, int raduis);

The parameters in bold are specific to GA and used in any implementation for GA

My question is:

When I use the planner:

<param name="base_global_planner" value="ga_global_planner/GeneticAlgorithmGlobalPlanner"/>

How can I pass these parameters?


Originally posted by Eman.m on ROS Answers with karma: 65 on 2021-06-15

Post score: 0

1 Answers1

0

Rosanswers logo

You can't (such that they are used by the global planners constructor).

If you plan to use the global planner as a plugin to move_base you need to adhere to the respective interface. You cannot simply change the constructor and assume everything works. You'd need to adapt move_base to pass the additional parameters, which doesn't really make sense...

However, the other global planners also have parameters that are read from the Parameter Server after the Planner class is constructed. I suggest you follow the same route.


Originally posted by mgruhler with karma: 12390 on 2021-06-16

This answer was ACCEPTED on the original site

Post score: 1


Original comments

Comment by Eman.m on 2021-06-16:
Thank you. I will work on that.

Matthias
  • 5,805
  • 1
  • 1
  • 1