Robotics StackExchange | Archived questions

How to make a "preferred" area

Hi , My goal is to make the robot prefer to plan a path through a zone on the map, therefore i changed the FREE_SPACE ( you can find it in cost_values.h) cost from 0 to 50 and i made a layer that draws a zone that has 0 as cost. The problem is when the robot gets close to the zone, its cost goes from 0 to 50 which means that the cost of the map and the zone become similar but I need the cost of the zone to stay 0.

Thank you in advance.

EDIT:

Hi, I found out that the problem is coming from the obstacle layer it is replacing any cost below the FREE_SPACE with the value of FREE_SPACE, I am not really sure if what I am doing is correct, did anybody do something similar before or has an idea how this could be done. Do not hesitate if you have questions, thank you.

Asked by starter on 2018-05-30 06:17:42 UTC

Comments

Maybe you can assign cost to rest of the map, leaving the zone as free_space, this should solve the problem you are having.

Asked by Choco93 on 2018-06-08 05:46:31 UTC

Yes it worked ! I just made a layer with cost 50 over all the points that has 0 as cost and on top of that layer I am drawing my "preferred layer", Thank you.

Asked by starter on 2018-06-26 09:17:44 UTC

@starter Hi sir can you elaborate on how you added the extra layer with 50 costs, and how are you drawing the layer? form rviz or something else?

Asked by Ammar Albakri on 2022-06-01 09:45:10 UTC

Answers