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

Calling constructor of custom global planner

asked 2021-06-15 13:51:59 -0600

Eman.m gravatar image

updated 2021-06-15 14:07:29 -0600

Hi

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

I followed this tutorial:

http://wiki.ros.org/navigation/Tutori...

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?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2021-06-16 07:29:05 -0600

mgruhler gravatar image

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.

edit flag offensive delete link more

Comments

Thank you. I will work on that.

Eman.m gravatar image Eman.m  ( 2021-06-16 13:28:11 -0600 )edit

Question Tools

1 follower

Stats

Asked: 2021-06-15 13:51:59 -0600

Seen: 79 times

Last updated: Jun 16 '21