Home        Store        Learn        Blog

Internal filter in ArduSub for compass?

Hi everyone,

I’m trying to control the BlueROV2 with ROS, using mavros.
I want the BlueROV2 to be autonomous, so I need every sensor data.
In QGC, the compass works fine, so I was wondering if there is any internal filter in ardusub for this, and if so, can we get this filtered value with mavros ?

Also, I read that the pixhawk magnetometer might be susceptible to electromagnetic noise, so do you advise having an external compass ?

Thanks for your help !


Yes the compass data is filtered, and the data is available via mavros. An external compass probably won’t be necessary unless you have problems. It depends on the wiring and the environment.

Nice, thx for the reply !

So if I understood well, the data is given in /mavros/imu/data -> orientation ?
Because there is also a ~global_position/compass_hdg, that gives only one direction, but i need a 3D orientation.
I would like to have a look on the code that filter the compass data, I couldn’t find it in ArduSub, do you know where I can find it please ?

Thx !

Yes, there are probably other topics that you could look at with the same information. There is probably one for raw readings, one for filtered readings, one for fused readings. You should consult with the mavros documentation and their team in gitter for more information.

The filter is here (it’s complex): https://github.com/ArduPilot/ardupilot/tree/master/libraries/AP_NavEKF2

Okay thanks a lot !

I’ll have a look to get at least a grasp of your kalman filter :wink:
I found the ArduSub software very powerfull so I try to understand a little how the tools I use works.
Thanks again for your help !


1 Like