Gps heading versus compass/imu heading

Work continues slowly on my monster robot. One of the problems is that it moves very slowly (2-3 meters/min) and I think it weaves because the gps heading varies a lot when moving slow. I think the compass/imu heading should be more accurate. It there any way in the pixhawk to change the relative weight of the GPS versus inertial heading. Any ideas ? I have gone over the excellent tutorial by TCIII on tuning the steering and it has helped a lot but not enough. Maybe there are some parameters that I know about that could be useful.

You need to be a member of diydrones to add comments!

Join diydrones

Email me when people reply –


  • GPS is a serialized communication device clocked at 1Hz, so you get 60 GPS fix values in a minute  60 values/2-3 meters so in practice you could disable GPS to not interfere with inertial heading.

    In theory GPS plug-in (Javaschrift, shell script) should smooth GPS values, reading NMEA sentences, replacing random value with previous fix value to get smoothed track (or another control algorithm can be implemented)

    Car gps navigation comes with such smoothing algorithm by default making autonomous driving of Google's car possible (random GPS values due to signal being reflected get rejected and replaced by correct values calculated from innertial sensors - more than 1 GPS is installed)


    • Compass_use is set to 1. Darius's idea of just using inertial heading between waypoints is interesting. Clearly I do it have to worry about wind drift - the machine weighs 1500 lb empty + max payload of 1500 lbs. But you need the gps to work out the required heading to each waypoint. Then you have to turn it off until you get to the waypoint. Is there a way in the pixhawk of doing this ? The other idea would to intercept the gps messages and then smooth it and send that pseudo GPS signal to the pixhawk. I also have piksi that I trying to make work - maybe cm level gps RTK will be more stable.
    • Pls attach some images of your monster robot to let us better know your problem.

    • I will put up some video later today. I tried some ideas including increasing the exf gps noise parameter but was not much use. Then I disabled the AHRS (set to 0) and the rover was much much more stable. I adjusted nav1 damping and period so it would follow a rectangular course quite accurately with just minimal weaving on turns. That I improved by playing with the steering pid. I have reasonable performance, now I am trying to integrate the piksi but it seems very touchy and losesRTK lock often. Anybody have an experience with piksi in rover ? I also don't like the fact that they used a proprietary protocol which necessitates a GCS to send data to the pixhawk. They could have sent NMEA or UBX which is supported to cm level precision in the pixhawk (according to Tridge).
  • Developer

    Hi.  Do you have COMPASS_USE set to 1?  There is another parameter AHRS_YAW_P which looks like it will do what you want but in fact we don't use it in the code so don't bother with it.

    Thanks, Grant.

This reply was deleted.