Set new waypoints during auto-mode for collision avoidance

Hello
I’m new to px4 and also not very experienced in programming.

My goal is to implement a useful Collision-Avoidance-System during mission-mode. For that i wrote (for my school Project) a mathematical solution based on a Collision-Conus-System. For collision detection we rewrote “Navigator::check_traffic”, which works fine based on tests with FLARMs.

Now basic question: I know where another UAV is coming from and how I have to react theoretically, but how do i tell the system? How do i set new waypoints (local or global), that my UAV has to go to?

Thanks for help!