How to build an anti-collision system using iris_rplidar?

I want to know how to move a certain distance in the opposite direction to the obstacle when the obstacle and the drone are located within a certain distance.
The parameters to be changed (CP_DIST, MPC_POS_MODE…etc) within QGC have been changed, and forward and backward moves do not work and obstacle avoidance does not work when running in position mode. What should I try?