# VectorNav vs. EKF2 data

**URL:** <https://discuss.px4.io/t/vectornav-vs-ekf2-data/4717>\
**Category:** PX4 Autopilot\
**Created:** [October 23, 2017, 10:03pm UTC](https://discuss.px4.io/t/vectornav-vs-ekf2-data/4717 "2017-10-23T22:03:31Z")\
**Posts on this page:** 12\
**Page:** 1

<div class="post-metadata">

**Author:** ![bgat](https://discuss.px4.io/letter_avatar_proxy/v4/letter/b/eb9ed0/32.png) [@bgat](https://discuss.px4.io/u/bgat)\
**Post date:** [October 23, 2017, 10:03pm UTC](https://discuss.px4.io/t/vectornav-vs-ekf2-data/4717/1 "2017-10-23T22:03:31Z")

</div>

Should vehicles that fully utilize a VectorNav GPS+IMU device, i.e. the VN-300, bypass EKF2 altogether?

My vehicle has only the VN-300, and we’re running it with most of the bells and whistles turned on. Practically speaking, it provides us the authoritative measurements for vehicle pose and position.

The engineer in me says that since the VN data has already been extensively filtered, we should skip EKF2 to avoid the risk of introducing errors and lag. The software guy in me somewhat agrees, but the result is a configuration that’s pretty different from (what I think is) a traditional PX4 setup. Then again, how many “traditional” systems have a $5K-ish GPS+IMU package onboard?

The other software guy in me complains that, for situations where VectorNav isn’t the sole sensor, a chunk of code that writes directly to the same uORB topics as EKF2 will just get into everyone else’s way.

So, do I (a) leave EKF2 off, and send VectorNav data directly to uORB topics including vehicle\_attitude; (b) dissect incoming VectorNav data to pretend that it’s an ordinary GPS receiver and IMU, and feed the stream to EKF2 as usual; or, (c) something else entirely?

---

<div class="post-metadata">

**Author:** ![AlexisTM](https://discuss.px4.io/user_avatar/discuss.px4.io/alexistm/32/3456_2.png) [@AlexisTM](https://discuss.px4.io/u/AlexisTM)\
**Post date:** [October 24, 2017, 1:11pm UTC](https://discuss.px4.io/t/vectornav-vs-ekf2-data/4717/2 "2017-10-24T13:11:12Z")

</div>

Don’t you have an IMU? What’s your flight controller?  
Can you verify that the VN IMU gives a proper Attitude? What about the VN IMU calibration?

Setups I would try:

- EKF2
- Q\_attitude\_estimator & publishing position directly
- Publishing position and attitude directly

---

<div class="post-metadata">

**Author:** ![bgat](https://discuss.px4.io/letter_avatar_proxy/v4/letter/b/eb9ed0/32.png) [@bgat](https://discuss.px4.io/u/bgat)\
**Post date:** [October 24, 2017, 4:32pm UTC](https://discuss.px4.io/t/vectornav-vs-ekf2-data/4717/3 "2017-10-24T16:32:24Z")

</div>

Alexis:

The VectorNav VN-300 is a “Dual Antenna GNSS-Aided Inertial Navigation System” [1]. It fuses all that stuff together via Kalman filtering and provides position, velocity, orientation, and heading measurements at rates of up to 800Hz or so.

It’s got EKF2/Q\_attitude\_estimator already inside, which is why I asked if I should bypass the comparable functions in PX4 or not.

My FMU is a VN-300 tethered to a Beaglebone Black, along with half a ton of additional stuff.

After bleeding my eyeballs out some more last night, I realized that position\_estimator\_inav is mixed up in all of this, too. I think I’m going to leave it turned on, though, because it’s doing some useful sanity checking too.

[1] - [https://www.vectornav.com/products/vn-300](https://www.vectornav.com/products/vn-300)

---

<div class="post-metadata">

**Author:** ![AlexisTM](https://discuss.px4.io/user_avatar/discuss.px4.io/alexistm/32/3456_2.png) [@AlexisTM](https://discuss.px4.io/u/AlexisTM)\
**Post date:** [October 25, 2017, 8:11am UTC](https://discuss.px4.io/t/vectornav-vs-ekf2-data/4717/4 "2017-10-25T08:11:07Z")

</div>

What is the precision of the navigation (filtered ouput) of the VN-300, it says 3 meters but is it 3 meters to absolute GPS position or up to 3 meters jumps? Did you consider an RTK solution (~1k€, 2mm position) or geostationary satellite solution (drifting but 20cm position)?

Let’s keep it simple. If the output of the VN-300 is continuous, simply publish the data to the uORB topics and do not start any other estimator.

---

<div class="post-metadata">

**Author:** ![bgat](https://discuss.px4.io/letter_avatar_proxy/v4/letter/b/eb9ed0/32.png) [@bgat](https://discuss.px4.io/u/bgat)\
**Post date:** [October 30, 2017, 1:19am UTC](https://discuss.px4.io/t/vectornav-vs-ekf2-data/4717/5 "2017-10-30T01:19:42Z")

</div>

Publishing directly to the uORB topics seems to be working fine so far.

---

<div class="post-metadata">

**Author:** ![bgat](https://discuss.px4.io/letter_avatar_proxy/v4/letter/b/eb9ed0/32.png) [@bgat](https://discuss.px4.io/u/bgat)\
**Post date:** [April 17, 2018, 6:21am UTC](https://discuss.px4.io/t/vectornav-vs-ekf2-data/4717/6 "2018-04-17T06:21:52Z")

</div>

As a followup, we did indeed deploy with code that pushes the VN data more or less directly to uORB. The main sticking points ended up being topics that came from LPE that we lost by not running LPE, which seemed to confuse navigator the most. We basically had to track them down one-by-one, but since there weren’t very many of them, we got it resolved fairly quickly once we realized what was going on.

---

<div class="post-metadata">

**Author:** ![joshuawhitehead](https://discuss.px4.io/user_avatar/discuss.px4.io/joshuawhitehead/32/3480_2.png) [@joshuawhitehead](https://discuss.px4.io/u/joshuawhitehead)\
**Post date:** [August 29, 2018, 12:36pm UTC](https://discuss.px4.io/t/vectornav-vs-ekf2-data/4717/7 "2018-08-29T12:36:19Z")

</div>

Hi @bgat, first of all thanks for posting this question, I know this post is fairly old, but in regard to your last message, do you happen to recall or have a list of the topics that were lost by not running the LPE?

I’m currently working on getting a VN300 to talk to PX4 on a different (Nuttx based) board. It sounds like I ended up taking a similar path, where it makes more sense to skip the PX4 EKF2 and publish directly to uORB using the already filtered data. Any other pointers or gotchas that you might be aware of when using this IMU would be welcome as well. Thank you for your time! 🙂

---

<div class="post-metadata">

**Author:** ![Juan\_Tapiero](https://discuss.px4.io/user_avatar/discuss.px4.io/juan_tapiero/32/7466_2.png) [@Juan\_Tapiero](https://discuss.px4.io/u/Juan_Tapiero)\
**Post date:** [November 18, 2020, 5:41pm UTC](https://discuss.px4.io/t/vectornav-vs-ekf2-data/4717/8 "2020-11-18T17:41:50Z")

</div>

Hi @joshuawhitehead I know this post was a long time ago, but how are you sending the vectorNav data to the PX4 in order to bypass the EKF2. Are you using something like direct MAVLINK messages or MAVROS? I image you are building a new PX4 module that reads said messages and simply publishes?

Hopefully you see this message in modern times. I am trying to do the same but can’t figure out the best way to proceed.

Thank you.

---

<div class="post-metadata">

**Author:** ![dagar](https://discuss.px4.io/user_avatar/discuss.px4.io/dagar/32/22_2.png) [@dagar](https://discuss.px4.io/u/dagar)\
**Post date:** [January 24, 2021, 6:30pm UTC](https://discuss.px4.io/t/vectornav-vs-ekf2-data/4717/9 "2021-01-24T18:30:44Z")

</div>

@Juan_Tapiero you either publish all the same data that ekf2 would (vehicle\_attitude, vehicle\_local\_position, vehicle\_global\_position) or you can feed the VectorNav sensor data (already calibrated and corrected) into the system like any other sensor.

---

<div class="post-metadata">

**Author:** ![Danduril](https://discuss.px4.io/user_avatar/discuss.px4.io/danduril/32/10295_2.png) [@Danduril](https://discuss.px4.io/u/Danduril)\
**Post date:** [January 24, 2021, 8:27pm UTC](https://discuss.px4.io/t/vectornav-vs-ekf2-data/4717/10 "2021-01-24T20:27:46Z")

</div>

It seems @bgat found some unexpected side effects of bypassing LPE, but left those gatchas to be rediscovered. At least we have a heads-up, tho, and that is appreciated.

@joshuawhitehead, any chance we can get the VN300 module pushed upstream? If it would take work to make a an acceptable PR, I’d be happy to help.

---

<div class="post-metadata">

**Author:** ![joshuawhitehead](https://discuss.px4.io/user_avatar/discuss.px4.io/joshuawhitehead/32/3480_2.png) [@joshuawhitehead](https://discuss.px4.io/u/joshuawhitehead)\
**Post date:** [January 25, 2021, 3:14am UTC](https://discuss.px4.io/t/vectornav-vs-ekf2-data/4717/11 "2021-01-25T03:14:32Z")

</div>

Unfortunately that work was done on behalf of a contract client and I have not yet gotten their permission to push that work back to the public repos. I think they’re open to it, and plan to do it eventually, but I get the impression they’re concerned about some “first to market” aspects of their product and I don’t know what their timeline for allowing that to happen looks like.

---

<div class="post-metadata">

**Author:** ![Pawel](https://discuss.px4.io/user_avatar/discuss.px4.io/pawel/32/13961_2.png) [@Pawel](https://discuss.px4.io/u/Pawel)\
**Post date:** [July 21, 2023, 5:27pm UTC](https://discuss.px4.io/t/vectornav-vs-ekf2-data/4717/12 "2023-07-21T17:27:04Z")

</div>

Hi  
My apology for opening an old post, but I need to find out which messages and which format VectorNav VN-300 outputs to Ardupilot to provide position, attitude and heading.  
You mentioned you can feed this information as any other sensor. Would you have reference to how it is done with Ardupilot to provide all these (either via MavLink or NMEA) and avoid using internal GNSS/INS?  
thanks  
Pawel
