Program a flight with LiDAR

I am using a SF30 LiDAR in my drone with Pixhawk for laser altimeter. I can see the values of the sensor in mission planner without any problem, that’s my first step. Now I want to make an autonomous flight, but the altitude will depend of the value of the sensor. How can I program this? Do I need to code in Mission Planner? How is the process? Thank you