AirSim icon indicating copy to clipboard operation
AirSim copied to clipboard

Internal GPS Noise From Simulator When Connected to Mavros

Open exploke opened this issue 9 years ago • 27 comments

I am attempting to run the drone simulator through a program on another laptop connected by mavros. There is a stable connection, and I am able to arm, takeoff, and somewhat fly the drone through the program, but mavros and the program are receiving a skewed GPS location that is fluctuating between a range of points from the actual GPS location which messes with the program. Is there anyway I can have the simulator give a more exact and constant GPS location?

exploke avatar May 03 '17 06:05 exploke

Can you provide a log file so we can see how much it is fluctuating? Some amount of noise is being simulated, but it should be relatively small.

lovettchris avatar May 03 '17 08:05 lovettchris

logs.zip

I inputted the 'pos', 'arm' , 'takeoff 10', 'disarm', 'x' commands in that order for this log file.

exploke avatar May 05 '17 16:05 exploke

I'm definitely seeing something funky with lat/lon, it seems to be oscillating out of control. I need one more log file though. Can you grab the output to port 14389 ? This will capture the HIL GPS simulated values as well. And make sure you are using the latest bits: MavLinkTest -server:127.0.0.1:14389 -logdir:d:\temp image

lovettchris avatar May 05 '17 18:05 lovettchris

Sorry Chris I am getting this error "parameter name 'CBRK_USB_CHK' was not found" when I type arm while trying to log. Would you have any idea as to why I am running into this problem?

exploke avatar May 05 '17 19:05 exploke

That usually means you need to restart mavlinktest. You have to start it after you hit Play.

lovettchris avatar May 05 '17 19:05 lovettchris

I was unable to get it to run with port 14389. I could obtain the pos of the quad but could not arm it. I am getting the same error as above. I ran it on port 14388 if that helps at all. I am attaching the files here. logsPort14388.zip

exploke avatar May 05 '17 19:05 exploke

Also a little Off Topic, but would you have any idea what the focal length of the front Camera view in air sim is?

exploke avatar May 05 '17 19:05 exploke

I was unable to get it to run with port 14389. I could obtain the pos of the quad but could not arm it. I am getting the same error as above. I ran it on port 14388 if that helps at all. I am attaching the files here. logsPort14388.zip

Oh, you can run two separate instances of mavlinktest. One on port 14550 to control it and the other on 14389 to get the logs.

You can find the camera properties in the Unreal Editor, if you open BP_PIPCamera, and select CameraComponent you will see this: image

lovettchris avatar May 05 '17 20:05 lovettchris

I am attaching the log files from ports 14550 and 14389. They are all in the attached folder.

LogsPort14389.zip

exploke avatar May 05 '17 21:05 exploke

Thanks, looking at the hilgps in the LogViewer I can see GPS is moving by about this much:

image

And the hilgps message is oscillating :

image

I'm not sure why it would be doing this, we'll have to debug some more...

lovettchris avatar May 05 '17 22:05 lovettchris

Chris how is airsim simulating gps noise? Is it possible to turn that off?

vatsagandhi avatar Jun 05 '17 20:06 vatsagandhi

It is done in ~\AirSim\AirLib\include\sensors\gps\GpsSimple.hpp,

ghost avatar Jun 05 '17 20:06 ghost

Which lines do we change to rid of the GPS Noise? Would we be messing with the parameters in GpsSimpleParams.hpp or just modifying the GpsSimple.hpp?

vatsagandhi avatar Jun 06 '17 15:06 vatsagandhi

I attempted to change the values of GpsSimpleParams.hpp and the noise parameters on QGroundControl with no solution to the GPS noise. When I play my unreal environment as the drone is in disarm mode, QGroundControl still shows the drone fluctuating sporadically. I was thinking it might be a Pixhawk firmware issue. This is the firmware I am using right now.

px4fmu-v2_default (1).px4.zip

I would greatly appreciate any more solutions you might have.

exploke avatar Jun 08 '17 20:06 exploke

I synced latest PX4 master branch and it works really well, best yet. So I attached that version here. One of the things I'm noticing in this version of PX4 is that there is no longer any IMU slippage after performing a long banked turn.

px4fmu-v2_default.zip

lovettchris avatar Jun 10 '17 00:06 lovettchris

I rebuild the plugins folder with the latest git repo and also am using the firmware you have posted above. It seems that the quad isn't staying stable in attitude mode either and position seems to be fluctuating. I am attaching the log file in this comment. I ran into this issue when I was using the old firmware as well. MavLinkLogs.zip

vatsagandhi avatar Jun 10 '17 20:06 vatsagandhi

I am also attaching the logs for HilGPS. The zipped folder contains logs from port 14550 and 14389. HilGPSLogs.zip

vatsagandhi avatar Jun 10 '17 21:06 vatsagandhi

Sensor data looks good, but there is a weird oscillation in the z-acceleration that we should look into. THe other thing you should check is your computer performance, CPU/GPU load. See performance info.

image

lovettchris avatar Jun 12 '17 07:06 lovettchris

The computer seems to be fine. Attached images show the cpu usage and disc. We are also using a Nvidia GTX 1070 cpu disc

vatsagandhi avatar Jun 12 '17 14:06 vatsagandhi

Yep, that looks fine. I haven't tried the 1070, but it should be fine also. If you type the backquote key (`), in AirSim it brings up the Unreal Console where you can type "StartFpsChart", do some flying then "StopFpsChart", this should generate an excel chart of render times. This should tell us for sure if the 1070 is keeping up.

lovettchris avatar Jun 12 '17 16:06 lovettchris