PX4 / jMAVSim

Simple multirotor simulator with MAVLink protocol support
BSD 3-Clause "New" or "Revised" License
82 stars 207 forks source link

add random walk noise for GPS (like gazebo) #64

Closed stmoon closed 6 years ago

stmoon commented 6 years ago

I found there is no GPS noise with jMAVSim. I developed the random walk noise like gazebo SITL.

randomwalk gps 2

hamishwillee commented 6 years ago

Seems like a good idea to me. @TSC21 is it useful/reasonable that anyone would ever want to tune this - turn off the noise, or control the level of noise?

stmoon commented 6 years ago

Good idea, @hamishwillee

I will add the plan to make control panel for noise level. ;-)

hamishwillee commented 6 years ago

@stmoon Sounds good. Though I have no idea whether a control panel is the normal/right way to do this for jMAVSim :-) I'd have "guessed" a command line argument.

stmoon commented 6 years ago

Thank you @hamishwillee First time, I will develop simple control panel which can control the noise parameter. Then, I will improve the control panel. :-)

stmoon commented 6 years ago

Hi, @bkueng

I added sqrt(dt) to all generated noised. It seems to be more stable. And, I put the the computation of noise inside setGlobalPosition()

Thanks.

stmoon commented 6 years ago

Hi, @bkueng

I modified the gps noise function according to your comments.

please check it.

bkueng commented 6 years ago

Thanks @stmoon , this looks good now. I just had to increase gpsNoiseStdDev = 0.01f; to 10.f to get to a noticable range (which seems reasonable): screenshot_20171214_112946

What do you think?

stmoon commented 6 years ago

Hi @bkueng

OK. I think it is better than before.

I will modify the default parameter.

bkueng commented 6 years ago

Thanks, I merged it

stmoon commented 6 years ago

Thanks!!!