Using Hokuyo Lidar for Obstacle avoidance and Ardupilot for GPS Navigation

I am currently working on building an autonomous drone in the simulation middleware of Gazebo using ROS.

I have an Iris Copter model available in SDF format, which I am programming using the Dronekit API. I have integrated a Hokuyo Lidar sensor on the top of the drone from which I get the distances from all the 360 degrees respectively from the ROS topic the sensor generates. In all the values that I get from 360 degrees of direction, I get around 1024 values. I only had to get the values from 90, 180, 270, and 360(or 0). After getting them I fed those values into the script I made in python and somehow made it possible for the drone to avoid obstacles using the drone kit functions that are available.
Now, the problem I am facing is with the integration of the obstacle avoidance system in the waypoint navigation system that is done using Ardupilot (using the map in Ardupilot Plugin / Mission Planner).

How do I make such a project in which the drone tends to move autonomously using GPS whilst being able to avoid obstacles that come in its path?

I agree that the firmware of Ardupilot comes with a feature of something called the Bendy Ruler Algorithm. U I have no idea how to make use of it in the simulation environment of Gazebo. The details about this feature are also not available much.

Any help on this would be really awesome for me to continue with further development of the task!
Sanil Jain