Converting QGC mission plan json file to offboard setpoints

[I am using ROS2 foxy and fastRTPS]

I would like to convert the waypoints in the .plan JSON file generated from QGC to setpoints to control my drone in the offboard mode.

The reason why I am doing this is that I would like to implement a collision avoidance algorithm and to perform the avoidance maneuver, I will change setpoints that are sent by ROS2 in the middle of the flight.

Is there a guide on how to map the JSON file to offboard setpoint?
Also, do you think it would be better if I avoid the offboard mode and modify the mission waypoints directly in the middle of a flight? if yes, is that possible with the current state of px4_ros_com?

Did you see there is an obstacle avoidance available with PX4 and using ROS for Mission and Offboard mode right ?

Simple example of parsing mission json you may find here:

Simple example of steereng offboard node to hit the red baloon is here: (but description is in Rissian)

But obstacle avoidance, imho, does not require the mission change, see link in above Katawan post.

The offboard obstacle avoidance here sends local coordinated. However, I am trying to send the global coordinates (LLA) similar to the waypoints in the QGC mission plan file. I tried to send the latitude/longitude/altitude in a position_setpoint message from micrortps_agent to micrortps_client but it didn’t move the drone. I wrote another issue here