# Logging VEHICLE\_GLOBAL\_POSITON

**URL:** <https://discuss.px4.io/t/logging-vehicle-global-positon/1708>\
**Category:** PX4 Autopilot\
**Created:** [November 10, 2016, 7:24pm UTC](https://discuss.px4.io/t/logging-vehicle-global-positon/1708 "2016-11-10T19:24:10Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![geebd](https://discuss.px4.io/letter_avatar_proxy/v4/letter/g/9dc877/32.png) [@geebd](https://discuss.px4.io/u/geebd)\
**Post date:** [November 10, 2016, 7:24pm UTC](https://discuss.px4.io/t/logging-vehicle-global-positon/1708/1 "2016-11-10T19:24:10Z")

</div>

I’m trying to log `VEHICLE_GLOBAL_POSITION` message from the exf2 module but seem to be having issues.

1. The message is only published when after this check. `_ekf.global_position_is_valid()` What is the purpose of this check.

I then started the `position_estimator_inav` and started to get the message and came across this issue.

1. The message output of long was only displaying 0.01 os precision which is about 1000m.

All I’m trying to do is log the vehicle position in global space (gps coordinants and altitude) to see how accurate it is. I preferred a fused solution rather than the raw gps from `VEHICLE_GPS_POSITION`

What is the best way to log this type of data?

---

<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:** [November 12, 2016, 1:14am UTC](https://discuss.px4.io/t/logging-vehicle-global-positon/1708/2 "2016-11-12T01:14:31Z")

</div>

If you’re using sdlog2, then it’s logged as GPOS. If you’re using the new logger it directly logs uorb messages (vehicle\_global\_position).

Why would you want ekf2 to publish a position it doesn’t think is valid?

---

<div class="post-metadata">

**Author:** ![geebd](https://discuss.px4.io/letter_avatar_proxy/v4/letter/g/9dc877/32.png) [@geebd](https://discuss.px4.io/u/geebd)\
**Post date:** [November 15, 2016, 5:58pm UTC](https://discuss.px4.io/t/logging-vehicle-global-positon/1708/3 "2016-11-15T17:58:56Z")

</div>

I don’t want to publish an invalid position. I was just wondering when/how does it become valid. I prefer to shutdown `position_estimator_inav` and just use `ekf2` for the `VEHICLE_GLOBAL_POSITION` message because I read in another post that it may not be as accurate. However I don’t know how to get `ekf2` to publish it b/c of the `_ekf.global_position_is_valid()` flag.

Also ideas on why the gps data in message `VEHICLE_GLOBAL_POSITION` only has 0.01 of precision?

> [@Local\_position\_estimator details](http://discuss.px4.io/t/local-position-estimator-details/1694):
>
> Hi, I have developed a custom controller. I am accessing current altitude value from the file vehicle\_local\_position. altitude value that I am getting using local\_position\_estimator is always zero. If I use position\_estimator\_inav than it is working fine . I want to know which one is better among position\_estimator\_inav, local\_position\_estimator and ekf2?. and If I need to use local\_position\_estimator data than how can I use it?. Note : If I am uploading the px4 stack using qgroundcontrol than…

---

<div class="post-metadata">

**Author:** ![Onix\_Tarrats](https://discuss.px4.io/letter_avatar_proxy/v4/letter/o/b77776/32.png) [@Onix\_Tarrats](https://discuss.px4.io/u/Onix_Tarrats)\
**Post date:** [March 10, 2017, 3:59pm UTC](https://discuss.px4.io/t/logging-vehicle-global-positon/1708/4 "2017-03-10T15:59:03Z")

</div>

Hello, I’m trying to get the vehicles current position, to pass as a parameter to a C++ program I’m trying to write. I was redirected to this thread, but I do not understand the usage of the Vheicle\_Global\_Position any pointers as to where I can learn how to use it?

---

<div class="post-metadata">

**Author:** ![geebd](https://discuss.px4.io/letter_avatar_proxy/v4/letter/g/9dc877/32.png) [@geebd](https://discuss.px4.io/u/geebd)\
**Post date:** [March 12, 2017, 6:31pm UTC](https://discuss.px4.io/t/logging-vehicle-global-positon/1708/5 "2017-03-12T18:31:16Z")

</div>

The default estimator is ekf2 so as long as you don’t change that everything should be automatic. Once the ekf2 solution is valid the urob messaging will reflect this. Just subscribe to the vehicle\_global\_position message and you’ll get the data you need.
