PX4 - avoidance

Hello,

should I ask for some questions about avoidance? How will I make avoidance system which will be autonomous?
How does parameter CP_DIST from QGC function? How does OBSTACLE DISTANCE function? How I add a sensor to firmware?

My task, which I managed, is that iris will take off, then will fly to wall, then he will recognise that it staying nearby to wall and then it will land.

How will be this task in OFFBOARD or autonomous mode function?

I installed linux, ROS(melodic), Gazebo, avoidance libraries and QGroundControl.

Thx for responding
BV