PX4 HITL using real motor

I am trying to operate the drone motor in both virtual and real environments at the same time using PX4. So, I am trying to modify the firmware, but I do not know which part to modify, so I ask a question.
The virtual environment uses the observation deck environment.
What I want is for drones in virtual and real environments to work simultaneously when doing HITL.

commenting to follow the topic, i am trying to do the same, im having trouble with what i think is the mavlink interface, but i am not sure. I did SITL and tried it and it worked, but cant with HITL with an hexacopter