Connect a non-autopilots device(onboard computer of drone) to QGC

Recently I am required to use DJI vehicle with QGC, the function I want to achieve is display the trajectory of my DJI and send some commands to DJI, and when DJI receive certain msg, I can use their SDK to do somethings. However, when I tried to send mavlink msg(heartbeat, global position, attitude, local position) to QGC from DJI onboard computer, QGC has succeeded in receiving those msgs, and onboard computer has received heartbeat from QGC, but the the UI of QGC never shows it is connected. I don’t know if there is a way to make it work.

Or I can go another way, which is to simply realize my minimum function, display trajectory and send certain commands. Can I jump the instantiation of the Vehicle and some part of the communication flow between Vehicle and QGC, and change code to enable QGC display vehicle is connected when I receive heartbeat and global position and simply draw trajectory based on the global position msgs?

QGC does not work that way. I am afraid you have to do it all by yourself, which basically means you have to rewrite the whole QGC modeling framework.

Make your companion computer to pretend to be a vehicle would be much easier

Thanks for your reply, can you tell me how can I make my companion computer pretend to be a vehicle?

Following the protocol and send proper messages back when QGC challenges your computer.

then translate the vehicle status from DJI flight control and forward to QGC to show flight paths.

Thanks Orico. I will try that.

Hey Orico,

I want know what kind of messages should I send to actually setup a connection?

that you need to investigated into the code. Not sure Px4/QGC has document on that but the code always tell everything.

Since you already tried sending heart beat back, I would suggest to be careful about the mavlink heartbeat type, as that indicates many different things.