Control a DJI drone through pixhawk and ardupilot

hi, I wonder about the possibility of doing a montage in such a way that a drone that has a dji flight controller installed, can be controlled through a plate like pixhawk with ardupilot in such a way that,
the receiver connects to Pixhawk or APM, the ESC outputs connect to a microcontroller that performs signal conversion for esc to pitch / roll, yaw, thro.
and this is connected to the channel input of the flight controller dji.

I would just find it odd to try, it’s a bit absurd because for you to install 2 flight controllers on the same drone, but I see it as an opportunity to control a drone which can not be removed from the dji flight compactor, so that is, and thus be able to incorporate ardupilot to this equipment without needing to extract the dji driver.
with the advantage that ardupilot is very versatile,
I do not know what they think about this.
I leave the code that would go in a mega arduino placed between the outputs of the Pixhawk / APM, and the inputs of the controller dji,
admitting that you do not need a pwm to ppm converter

arduino code conversor.pdf (19.2 KB)

We fly a DJI S900 frame with a pixhawk 2.1 connected directly to the ESCs. It fyes fine, no need to use your strange hack. What DJI frame are you trying to control ?

O, i dont know, to be true, i dont like dji, but just in case that exist a drone, very dificult to disasamble