You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am trying to set up a simulation environment in order to get a grasp of how these two filters work and how to get an orientation using the magnetometer. I have configured a Husky simulated vehicle robot with a GPS, an IMU and magnetometer from hector_gazebo_plugins. The configuration of each of these simulated sensors is
then I launch both imu_complementary_filter and imu_filter_madgwick as follows
<?xml version="1.0"?>
<!-- ComplementaryFilter launch file -->
<launch>
<!-- Filter raw gyro, accel and mag data into a usable orientation -->
<nodepkg="imu_complementary_filter"type="complementary_filter_node"name="complementary_filter_gain_node"output="screen">
<paramname="do_bias_estimation"value="true"/>
<paramname="do_adaptive_gain"value="true"/>
<paramname="use_mag"value="true"/>
<paramname="gain_acc"value="0.01"/>
<paramname="gain_mag"value="0.01"/>
<remapfrom="/imu/data"to="/complementary/imu/data" />
</node>
</launch>
and
<?xml version="1.0"?>
<!-- IMU filter Madgwick launch file -->
<launch>
<!-- Filter raw gyro, accel and mag data into a usable orientation -->
<nodename="imu_filter"pkg="imu_filter_madgwick"type="imu_filter_node" >
<!-- Hector Gazebo plugins use NWU, Gazebo uses ENU. Not really sure about this. Seems that we should set up this parameter as follows: 1) NWU if we use the magnetometer, because of hector_gazebo_plugins. 2) ENU if we don't use the magnetometer, because of Gazebo inertial frame. -->
<paramname="world_frame"value="nwu" />
<paramname="use_mag"value="true" />
<paramname="use_magnetic_field_msg"value="true" />
<paramname="declination"value="-9.3748" />
<paramname="yaw_offset"value="0" />
<paramname="publish_tf"value="false" />
<remapfrom="/imu/data"to="/madgwick/imu/data" />
</node>
</launch>
Now, according to hector_gazebo_plugins documentation, the world frame is using NWU convention and these can be tweaked by using the referenceHeading parameter. As you can see, I left them at 0 degrees in both the GPS and magnetometer configuration. The magnetic field values seem to be correct to what is expected (as the NOAA web page says). When the vehicle x-axis is facing North and its y-axis is facing West, the /imu/mag topic output is:
while the NOAA web page says this is the magnetic field that should be measured using that configuration:
Declination ( + E | - W ): -9.3748°
Inclination ( + D | - U ): -36.7067°
Horizontal Intensity: 17,985.5 nT
North Comp (+ N | - S): 17,745.3 nT
East Comp (+ E | - W): -2,929.7 nT
Vertical Comp (+ D | - U): -13,409.2 nT
Total Field: 22,434.0 nT
if I understand this correctly, the NOAA reference frames uses NED and because of that it would be right to expect the changed signs for the yz-axis of the /imu/mag topic (which I assume uses NWU too).
To sum up, using this setup both of the filters provide an initial orientation equal to the declination at startup (in this case, -9.3748) and then they keep this offset while the vehicle moves. If the vehicle starts with its x-axis facing North, shouldn't the initial orientation obtained by the filters be 0 degrees?
Thanks in advance!
The text was updated successfully, but these errors were encountered:
Hi,
I am trying to set up a simulation environment in order to get a grasp of how these two filters work and how to get an orientation using the magnetometer. I have configured a Husky simulated vehicle robot with a GPS, an IMU and magnetometer from
hector_gazebo_plugins
. The configuration of each of these simulated sensors isthen I launch both
imu_complementary_filter
andimu_filter_madgwick
as followsand
Now, according to
hector_gazebo_plugins
documentation, the world frame is using NWU convention and these can be tweaked by using thereferenceHeading
parameter. As you can see, I left them at 0 degrees in both the GPS and magnetometer configuration. The magnetic field values seem to be correct to what is expected (as the NOAA web page says). When the vehicle x-axis is facing North and its y-axis is facing West, the/imu/mag
topic output is:while the NOAA web page says this is the magnetic field that should be measured using that configuration:
if I understand this correctly, the NOAA reference frames uses NED and because of that it would be right to expect the changed signs for the yz-axis of the
/imu/mag
topic (which I assume uses NWU too).To sum up, using this setup both of the filters provide an initial orientation equal to the declination at startup (in this case, -9.3748) and then they keep this offset while the vehicle moves. If the vehicle starts with its x-axis facing North, shouldn't the initial orientation obtained by the filters be 0 degrees?
Thanks in advance!
The text was updated successfully, but these errors were encountered: