ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

get absolute orientation from angular velocity and linear acceleration data

asked 2023-02-09 14:13:43 -0500

zrahman gravatar image

My IMU does not publish absolute orientation data. So, I have 0 in that place like the following. However, it publishes correct angular velocity and linear acceleration data with covariances. I need to know the absolute orientation in the ENU frame. How can I get that? I could not find anything satisfactory online.

x: 0.0
y: 0.0
z: 0.0
w: 0.0
orientation_covariance: [-1.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]
edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
1

answered 2023-02-10 18:18:46 -0500

peci1 gravatar image

This is a pretty standard task for an IMU filter - like https://wiki.ros.org/imu_filter_madgw... . Check out the docs, but the setup should be pretty straight-forward.

Here's a sample how we launch it on one of our robots:

<node name="imu_filter" pkg="nodelet" type="nodelet" args="standalone imu_filter_madgwick/ImuFilterNodelet"
      respawn="true">
    <param name="use_mag" value="false" />
    <param name="publish_tf" value="false" />
    <param name="gain" value="0.01" />
    <param name="constant_dt" value="0.01" />
    <param name="orientation_stddev" value="0.1" />
    <param name="time_jump_threshold" value="10.0" />
    <remap from="imu/data_raw" to="imu_unbiased/data" />
    <remap from="imu/data" to="imu_filtered/data" />
</node>

As you can see, we're subscribing to imu_unbiased/data, which is a topic that contains the raw IMU data with angular velocity bias removed (the unbiasing might be a crucial step for you to get steady performance without too large yaw drift). There is, unfortunately, no general-use package that could do the unbiasing for you. You would have to write it yourself or wait until I open-source our own package (no ETA though). One other thing you can try is using imu_complementary_filter instead of madgwick, which has an option for a builtin unbiasing. But I found the complementary filter a little worse than madgwick with our Xsens IMUs.

The general idea of unbiasing is to start the driver, instruct the user to not move the IMU for 5 seconds, accumulate data during this period, and then looking at the accumulated angular velocities. The bias removal node then alters the angular velocity measurements so that the long-term accumulated velocities should be zero when the IMU is stationary.

edit flag offensive delete link more

Comments

@peci1 The OP asked for "absolute orientation". I don't see how what you have described causes yaw=0 when the robot is pointing toward the East. Are some assumptions being made?

Mike Scheutzow gravatar image Mike Scheutzow  ( 2023-02-11 14:28:43 -0500 )edit

Ah, right. With the approach I described, you get the NU of ENU absolute. Getting the E absolute is impossible with just a gyro and accelerometer. You would need to add a properly calibrated magnetometer or a dual-antenna GNSS sensor.

peci1 gravatar image peci1  ( 2023-03-05 03:57:18 -0500 )edit

Question Tools

2 followers

Stats

Asked: 2023-02-09 14:13:43 -0500

Seen: 94 times

Last updated: Feb 10 '23