PX4 / PX4-SITL_gazebo-classic

Set of plugins, models and worlds to use with OSRF Gazebo Simulator in SITL and HITL.
http://dev.px4.io/simulation-gazebo.html
370 stars 786 forks source link

GPS Noise Computation #1041

Open rafaeljer opened 4 months ago

rafaeljer commented 4 months ago

I have some doubts regarding how GPS noise is being computed.

https://github.com/PX4/PX4-SITL_gazebo-classic/blob/f754540e714642fea897445e69a675245bc6306a/src/gazebo_gps_plugin.cpp#L262-L272

Noise density for XY has, as unit, (m) / sqrt(hz) and the noise has as unit (m). https://github.com/PX4/PX4-SITL_gazebo-classic/blob/f754540e714642fea897445e69a675245bc6306a/include/gazebo_gps_plugin.h#L57

So, by the current formula, noise_gps_pos_.X() = (m) / sqrt(hz) * (1/sqrt(Hz)) = (m) / (Hz).

So, it would make me sense that the formula divides noise density by sqrt(df) [sqrt(s)], so that the result is in (m) instead of multiplying: noise_gps_pos_.X() = ((m) / sqrt(hz)) / (1/sqrt(Hz)) = (m)

The formula I referred is also used in other places of the code, like here https://github.com/PX4/PX4-SITL_gazebo-classic/blob/f754540e714642fea897445e69a675245bc6306a/src/gazebo_imu_plugin.cpp#L198

If you could clarify, I would appreciate.

Jaeyoung-Lim commented 3 months ago

@rafaeljer I think you may be right. If you want to make a PR to make it more correct, it would be greatly appreciated