# How to get GPS velocity NED?

**URL:** <https://discuss.px4.io/t/how-to-get-gps-velocity-ned/1771>\
**Category:** Uncategorized\
**Created:** [November 22, 2016, 4:53am UTC](https://discuss.px4.io/t/how-to-get-gps-velocity-ned/1771 "2016-11-22T04:53:42Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![1102sc](https://discuss.px4.io/user_avatar/discuss.px4.io/1102sc/32/590_2.png) [@1102sc](https://discuss.px4.io/u/1102sc)\
**Post date:** [November 22, 2016, 4:53am UTC](https://discuss.px4.io/t/how-to-get-gps-velocity-ned/1771/1 "2016-11-22T04:53:43Z")

</div>

Hello guys,

How to get GPS NED velocity,as follow?

float32 vel\_n\_m\_s # GPS North velocity, (metres/sec)  
float32 vel\_e\_m\_s # GPS East velocity, (metres/sec)  
float32 vel\_d\_m\_s # GPS Down velocity, (metres/sec)

I know the float32 vel\_m\_s # GPS ground speed, (metres/sec) ;  
but I can’t get NED velocity from GPS.

Thanks

---

<div class="post-metadata">

**Author:** ![tumbili](https://discuss.px4.io/user_avatar/discuss.px4.io/tumbili/32/3779_2.png) [@tumbili](https://discuss.px4.io/u/tumbili)\
**Post date:** [November 22, 2016, 6:41am UTC](https://discuss.px4.io/t/how-to-get-gps-velocity-ned/1771/2 "2016-11-22T06:41:12Z")

</div>

@1102sc What do you mean by “you can’t get it”? Is is always zero?  
The gps message has exactly the fields you are looking for.

---

<div class="post-metadata">

**Author:** ![1102sc](https://discuss.px4.io/user_avatar/discuss.px4.io/1102sc/32/590_2.png) [@1102sc](https://discuss.px4.io/u/1102sc)\
**Post date:** [November 22, 2016, 12:44pm UTC](https://discuss.px4.io/t/how-to-get-gps-velocity-ned/1771/4 "2016-11-22T12:44:40Z")

</div>

I want to get the gps NED velocity through NEMA Deal, but there are lattitude、longitude、altitude and time from GPS.  
I know that the UBX Deal can do it , but I don’t get UBX Deal.

---

<div class="post-metadata">

**Author:** ![Rasp](https://discuss.px4.io/user_avatar/discuss.px4.io/rasp/32/1047_2.png) [@Rasp](https://discuss.px4.io/u/Rasp)\
**Post date:** [August 19, 2017, 5:15pm UTC](https://discuss.px4.io/t/how-to-get-gps-velocity-ned/1771/5 "2017-08-19T17:15:55Z")

</div>

Does these parameter (vx, vy, vz) from[GLOBAL\_POSITION\_INT](https://github.com/mavlink/c_library_v1/blob/master/common/mavlink_msg_global_position_int.h) is a velocity in GPS coordinate?, If yes, how to convert these value to NED coordinate and Is it accuracy better than velocity from [HIGHRES\_IMU](https://github.com/mavlink/c_library_v1/blob/master/common/mavlink_msg_highres_imu.h) (xacc, yacc, zacc)?.

---

<div class="post-metadata">

**Author:** ![Nicolas](https://discuss.px4.io/user_avatar/discuss.px4.io/nicolas/32/4467_2.png) [@Nicolas](https://discuss.px4.io/u/Nicolas)\
**Post date:** [August 19, 2017, 8:35pm UTC](https://discuss.px4.io/t/how-to-get-gps-velocity-ned/1771/6 "2017-08-19T20:35:10Z")

</div>

The velocities in GLOBAL\_POSITION\_INT are in NED frame, as stated in your link.  
xacc, yacc, zacc in HIGHRES\_IMU are accelerations, not velocities.

---

<div class="post-metadata">

**Author:** ![im.rasp](https://discuss.px4.io/letter_avatar_proxy/v4/letter/i/d07c76/32.png) [@im.rasp](https://discuss.px4.io/u/im.rasp)\
**Post date:** [August 26, 2017, 8:53am UTC](https://discuss.px4.io/t/how-to-get-gps-velocity-ned/1771/7 "2017-08-26T08:53:04Z")

</div>

Thank you so much @Nicolas, I have tried to convert the velocity from GPS to acceleration using formula a = Δv / Δt, the result is totally different from HIGHRES\_IMU acceleration. Am I using a wrong formula?

 ![](https://discuss.px4.io/uploads/default/original/2X/f/fd10bb57707799bde0d99fc803fb0ad3a013b8af.png)

I am searching for the way to get the most accurate acceleration. Is there any possible solution to obtain acceleration which more accurate than HIGHRES\_IMU message.

---

<div class="post-metadata">

**Author:** ![Nicolas](https://discuss.px4.io/user_avatar/discuss.px4.io/nicolas/32/4467_2.png) [@Nicolas](https://discuss.px4.io/u/Nicolas)\
**Post date:** [August 28, 2017, 7:28am UTC](https://discuss.px4.io/t/how-to-get-gps-velocity-ned/1771/8 "2017-08-28T07:28:05Z")

</div>

Both the IMU data and the discrete derivative of the velocity estimate will be quite noisy.  
Have you tried plotting the results? I’m assuming you’re using more data than you showed here, I would use several hundred samples.  
Does this dataset contain significant accelerations? If so, I would expect that you see the two correlate.

---

<div class="post-metadata">

**Author:** ![Rasp](https://discuss.px4.io/user_avatar/discuss.px4.io/rasp/32/1047_2.png) [@Rasp](https://discuss.px4.io/u/Rasp)\
**Post date:** [August 31, 2017, 1:53am UTC](https://discuss.px4.io/t/how-to-get-gps-velocity-ned/1771/9 "2017-08-31T01:53:36Z")

</div>

I have tried plotting the result for 600 samples, as in the graph below:

 ![](https://discuss.px4.io/uploads/default/original/2X/7/7277921e9b6f4bead43b9fb18fe3405180c07e45.png)  
xacc is acceleration on x axis from HIGHRES\_IMU message, and gpsxacc is acceleration converted from velocity(vx) from GLOBAL\_POSITION\_INT. In the graph, at some periods of time, the both data are contrast together. Is this because of noise? or is it relate to the coordination of both messages as I understand so far both are the same local NED. and Is there any possible solution for the discrete derivative of the velocity estimate with less noise than the simple one I’m using now.

Sorry for asking you so many questions, I’m not engineering, I still have some trouble to find and understand maths myself. Thank you for your kindly help. 🙂

---

<div class="post-metadata">

**Author:** ![Nicolas](https://discuss.px4.io/user_avatar/discuss.px4.io/nicolas/32/4467_2.png) [@Nicolas](https://discuss.px4.io/u/Nicolas)\
**Post date:** [August 31, 2017, 8:35am UTC](https://discuss.px4.io/t/how-to-get-gps-velocity-ned/1771/10 "2017-08-31T08:35:13Z")

</div>

You don’t have a lot of excitement in these signals. Are you moving the vehicle around significantly?  
Also remember that the IMU data is in the body frame (X pointing forward of the vehicle) while the GPS data is in NED frame, i.e. your computed X values will point north.
