Indoor flight with external navigation data

Hello Chobitsfan,

Your great job is exactly what I want to do. I have bebop2 running the ardupilot, and have a optitrack. I followed your tutorial and modified the SampleClientML.exe. I think it keep sending feedback to bebop( But when I connect with bebop and let it arm in loiter mode, the pre-arm keeps warning that EKF2 still initializing. I don’t know what to do with this situation. I have tried GPS_TYPE=0, or GPS_TYPE=14.

For those who’s also looking for this feature, I created a new PR based on @chobitsfan 's work, and rebase on master branch, the PR is here.

Also, I’ve tested this feature with a copter for many times, and the result is quite satisfying for me.
I would share some information to help those who might need it as following:

Here’s the video
This is the flight plan
And this is the parameters I use
Hardware: Pixhawk 2.4
Vision: Intel Realsense T265
Companion Computer: Raspberry Pi 3B+
script running on companion computer to feed position data to flight control is here


When we put the drone in the origin point (0,0,0) of the optitrack system. The drone have a proper position on MP, but if we put the drone in the other place of the optitrack system ( like -3m, -2m, 0 ), The drone will lost proper position on MP, the phenomenon is like the drone’s position is added with the offset distance (-3m,-2m) of the optitrack system. in addition, the offset distance in MP is enlarged compared with the distance in the optitack system. The drone cannot fly properly with bad position health. Can anyone help? thanks

Did you use ekf2?

What is your “poor man’s indoor positioning system” ?

There is a post above.

Hi all,

I am using NATNet SDK and developing an app that will feed optitrack data like the one above. I have 2 questions, and any input would be very helpful.

  1. I am planning on feeding the data to the autopilot using MAVlink library with the message ATT_POS_MOCAP and Ardupilot like below.

Is this all that is needed or am I missing anything else?

  1. Is there a way to see what messages are received by the autopilot? I couldnt find an answer online about that.

Hi ntouev
Do you have any answers to your questions?
I am trying to connect Mavlink to my copter but it not working.
I am so tired, please help me a lot.
Thank you so much