0
$\begingroup$

Rosanswers logo

I want to fuse IMU and GPS data with robot_localization package used in an autonomous car, but there will have some time that I can't obtain the GPS data and IMU is the only source I can get to calculate position. I have a high precise IMU,but the error is huge when I use robot_localization without gps, so my question is can I use robot_localization package with only imu data.If I could,how to config the package correctly? Here is my launch file:

<launch>
  <node pkg="tf2_ros" type="static_transform_publisher" name="bl_imu" args="0 0 0 0 0 0 1 base_link imu_link" />
  <node pkg="tf2_ros" type="static_transform_publisher" name="bl_gps" args="0 0 0 0 0 0 1 imu_link gps_link"/>
  <node pkg="robot_localization" type="ekf_localization_node" name="ekf_localization_global" clear_params="true">
    <param name="frequency" value="30"/>
    <param name="sensor_timeout" value="2"/>
    <!--param name="map_frame" value="map"/-->
    <param name="odom_frame" value="odom"/>
    <param name="base_link_frame" value=" base_link"/>
    <param name="world_frame" value="odom"/>
    <param name="imu0" value="/imuData"/>
    <rosparam param="imu0_config">[false, false, false,
                                   true,  true,  true,
                                   false, false, false,
                                   true, true, true,
                                   true,  true,  true]</rosparam>
    <param name="imu0_differential" value="true"/>
    <param name="imu0_remove_gravitational_acceleration" value="true"/>
    <param name="two_d_mode" value="true"/>
    <param name="odom0" value="/odometry/gps"/>
    <rosparam param="odom0_config">[true,  true,  true,
                                   false, false, false,
                                   false, false, false,
                                   false, false, false,
                                   false, false, false]</rosparam>
  </node>
  <node pkg="robot_localization" type="navsat_transform_node"
      name="navsat_transform_node"  respawn="true" output="screen">
    <param name="magnetic_declination_radians" value="0.157"/>
    <param name="yaw_offset" value="1.570796327"/>
    <remap from="/imu/data" to="/imuData"/>
    <remap from="/gps/fix" to="/gpsData"/>
  </node>
  <node pkg="rviz" type="rviz" name="rviz_imu_gps_fuse" output="screen" args="-d $(find robot_localization)/robot_localization.rviz"/>
</launch>

Originally posted by Nico.Zhou on ROS Answers with karma: 13 on 2016-04-25

Post score: 1


Original comments

Comment by Subodh Malgonde on 2018-07-25:
Thanks to your post I have a better clarity on creating the launch file. I could not find the robot_localization.rviz file in the robot_localization repository. Can you guide me as to how to create this file?

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

You can use it with just an IMU, yes, but until I add bias correction, I wouldn't expect great results. Even after bias correction has been added, I wouldn't want to have only an IMU for pose estimation. Double integration of linear acceleration is going to lead to drift.


Originally posted by Tom Moore with karma: 13689 on 2016-05-09

This answer was ACCEPTED on the original site

Post score: 2


Original comments

Comment by Nico.Zhou on 2016-05-16:
Thanks for your answer Tom, I'm think about fuse visual odometry, hope I can get good result.

Comment by SprGrf on 2016-09-01:
Hello. I just started using the robot localization package only with an IMU. I am using the the launch file Nico provided but I am getting zeros both in position and linear twist (on /odometry/filtered). Any ideas about what I am doing wrong? Is the navsat node necessary? Thank you for your time.

Comment by vik748 on 2018-01-29:
@SprGrf I am trying to do the same thing, IMU only navigation. Were you able to figure this out?

Comment by JamesS on 2021-04-09:
I would really like to implement robot_localization with only an IMU but I have yet to get it to produce any position estimates from my IMU input. Is the launch file above usable to achieve a position estimate from just IMU data or is there a source somewhere where a working launch file of only an IMU as the sensor source can be found?

Comment by riteshgoru on 2021-04-16:
Hello @JamesS were you able to achieve robot_localization with only the imu data? If yes can you post a link to your launch file?

Comment by JamesS on 2021-04-16:
@riteshgoru I did manage to get it to work but as many have mentioned the drift is terrible. The way I got it to work wasn’t by altering the launch file and in fact I used the default template one. The trick was writing a script that read in the IMU linear acceleration and integrated it to achieve a rough linear velocity. I then input those values into a Nav_Msgs/Odometry message under linear twist and published that to the required Odom sensor in robot_localization and the package immediately started estimating position. Hope that helps :)

Comment by Astronaut on 2021-09-26:
I have the same problem except I dont have GPS. I have IMU as only Sensor input . Can I use the raw IMU data (orientation, Angular Velocity and linear acceleration) as sensor input to achieve rough linear velocity or have to to the read the IMU raw that and do integration to achieve rough linear velocity or ?

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.