How to setup Dijkstra's in copter SITL?

Hi all,
I am following this Object Avoidance with Dijkstra’s — Copter documentation ( and use Dijkstra’s to plan a new path around the fence. I have a couple of questions.

  1. Where do I set OA_TYPE=2? I tried param set OA_TYPE=2 in the console, the copter detects fence and activates RTL instead of finding a new path using dijkstra’s.

  2. I also tried changing OA_PATHPLAN_DISABLED to OA_PATHPLAN_DIJKSTRA in AC_Avoidance/AP_OAPathPlanner.cpp. This results in the following error - APM: Dijkstra: overlapping polygon points.

Any suggestions is highly appreciated.