Indoor flight with external navigation data

Lat, Lon, and Alt values do not change.

You may need to use SET_GPS_GLOBAL_ORIGIN to set lat, lon of EKF origin (any valid lat, lon will do)

Hey @XerxMaleki,
did you manage to only update position and yaw values? I’m also interested in this.


hi @XerxMaleki @xfly
I am not the anther of ekf2 lib, but according to following code, only yaw is used in heading fuse

Thank you for the help.
It works now :slight_smile:

Soon I will publish some video of what I did.

Hi Niki @XerxMaleki,

I am doing something similar as your above mentioned project. Mind sharing with me your software setup for the system and procedure? Your assistance is deeply appreciated.

Hi @chobitsfan,

I’ve seen from your parameter list that you, like me, are using WP_NAV_RADIUS values below 10cm, but it seems that WP_NAV_RADIUS cannot be set lower than 10cm .

1 Like

hi @guglie

Yes, set WP_NAV_RADIUS less than 10 has no effect because _wp_radius_cm = MAX(_wp_radius_cm, WPNAV_WP_RADIUS_MIN); So I change WPNAV_WP_RADIUS_MIN to 1.0f and re-build the firmware myself

This is exactly what I’m currently doing (except that I set WPNAV_WP_RADIUS_MIN to 0.1f), let us know if that enhances your tests.

I’ve created a PR on this

Got the same error message as below when trying to build skyviper v2450 and the Journey GPS -f412 firmware:

ArduCopter/toy_mode.cpp:939:47: error: cannot convert ‘const mavlink_message_t {aka const __mavlink_message}’ to ‘const mavlink_message_t* {aka const __mavlink_message*}’ for argument ‘1’ to ‘void mavlink_msg_named_value_int_decode(const mavlink_message_t*, mavlink_named_value_int_t*)’

Any thoughts?

Hi , did u also set the home_position , if yes what about the orientation , i mean the quaternion ?
I am also try to send external position coming from pozyx. i think i did not send the right mocap since i did not get the quaternion from the pozyx tag . A little question is waht do i need to change if the yaw agnle is different to zero ?
any help will be welcome

I am facing a new problem in Arducopter 3.6.10. @rmackay9 @chobitsfan @tiffo

I am feeding the Black Cube equipped with Arducopter 3.6.10 with mocap data (as I did before on earlier versions) but after a while (2~5 minutes) it automatically disregards the external navigation data and loses its (Alt, Lat, Lon, and yaw)!!!
I checked the connection and everything appears to be OK and I cannot figure out what is going on in the arducopter.
you can find the log file here:

I also attached an interesting graph I got from my telemetry log which kinda shows ekf status when everything goes wrong.

Also, note that in this test, the quad is on the ground and not moving (motors are off) the whole time.

hi @ziranwu did you git submodule update --init --recursive?

Yes, did the submodule update for both the Ardupilot master and the Chobitsfan/ardupilot master. Both repo gave this same error message when compiling skyviper-v2450,
skyviper-f412, and skyviper-f412-rev1.

Looks like it involves dealing with this ToyMode on Skyviper drones.



did you do ./waf clean and ./waf distclean?

Tried and still got the same error message regarding toy_mode.cpp:939:47.

My input of command lines in the /ardupilot repo are:

./waf clean

./waf distclean

./waf configure --board skyviper-f412 (since I am using a Skyviper Journey Pro drone)

./waf copter



you can edit libraries/AP_HAL_ChibiOS/hwdef/skyviper-f412/hwdef.dat

This option was originally ENABLED. I disabled it and the copter build passed. Will try the firmware.



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