Problem with coordinate axis of rviz_imu_plugin
I have been trying to use the imu_filter_tools with my Arduino Pilot system. I linked the raw feed of the ardupilot to input of the imu_filter_madgwick package. I dont use the magnetometer data from the Ardupilot.
Here is the Launch file of the Imu filter settings
<node pkg="imu_filter_madgwick" type="imu_filter_node" name="imu_filter_node">
<!-- Input data settings-->
<remap from="imu/data_raw" to="/Imu" />
<param name="use_mag" value="false"/>
<param name="fixed_frame" value="/base_link"/>
<param name="gain" value="0.1"/>
</node>
After this i try to visualize the orientation of the IMU system in Rviz. I set the fixed frame to be "/base_footprint" in Rviz.
After the IMU's Axis have converged on the stable value i move the IMU around and see the corresponding changes in the rviz.
Although the direction of changing in the display of rviz correspond to the actual changes in the IMU orientation, the axis do not.
Which means that if I rotate the Imu towards left the Rviz shows the same according to every Axis, be it X,Y or Z.
The specific problem is
1.The Z-axis points downwards. Which should face upwards. The acceleration vector which corresponds to the 'g' points upwards which again should be opposite.
2.According to the standards the Roll, Pitch and Yaw increase in the clockwise direction but in Rviz the filter outputs Yaw and Roll which increase in Anti-clockwise direction. The Yaw can be explained since the Z-axis points in the opposite direction but what about the Roll.?
How can i correct this problem of Inverted axis and inverted euler Angles.? Any help would be appreciated..
--EDIT--
@tfoote I tried the thing that you suggested. What i did was to create another coordinate frame (/base_footprint).So the complete tree becomes /base_fooprint -> /base_link -> /IMU
I published the /tf between /base_footprint->/base_link to be (/base_footprint->/IMU)*(/base_link->/IMU).inverse().
The transform /base_footprint->/IMU was calculated by adding pi(3.14) to the Roll information of the /base_link->/IMU transform to invert Z-axis.
If there is a better solution please let me know.