Ask Your Question

Navsat_transform_node does not subscribe to IMU topic

asked 2018-03-30 08:24:52 -0600

antonin_haulot gravatar image

updated 2018-04-04 09:58:34 -0600


I am currently trying to use the navsat_transform_node from the robot_localization package in a ROS-Gazebo simulation. I'm using Ubuntu 16.04 LTS, with ROS kinetic and Gazebo 7.

In order to work, this node needs to subscribe to 3 differents topics : an odometry topic with nav_msgs/Odometry message, an IMU topic with sensor_msgs/Imu and a GPS topic with sensor_msgs/NavSatFix.

My problem is that, when launching the navsat_transform_node does not subscribe to my IMU topic, even if the message type of the IMU topic published by gazebo is sensor_msgs/Imu. However, the node does subscribe to the odom and gps topics.

Here is my launch file (taken from the robot localization wiki) :

<?xml version="1.0" encoding="UTF-8"?>
  <node pkg="robot_localization" type="navsat_transform_node" name="navsat_transform_node" respawn="true">
    <param name="magnetic_declination_radians" value="0"/>
    <param name="yaw_offset" value="0"/>
    <remap from="/imu/data" to="/imu_data" />
    <remap from="/gps/fix" to="/gps/fix" />
    <remap from="/odometry/filtered" to="/odom" />

Here is the IMU code from the URDF file of my robot model :

  <joint name="imu_joint" type="fixed">
    <axis xyz="0 0 1"/> <!-- 0 1 0 -->
    <origin xyz="${length_chassis*(5/16)} 0 ${height_chassis-(wheel_radius/2)}"/>
    <parent link="base_link"/>
    <child link="imu_link"/>

<link name="imu_link">
    <mass value="0.001"/>
    <origin rpy="0 0 0" xyz="0 0 0"/>
    <inertia ixx="0.0001" ixy="0" ixz="0" iyy="0.000001" iyz="0" izz="0.0001"/>
    <origin rpy="0 0 0" xyz="0 0 0"/>
      <box size=" ${IMU_size} ${IMU_size} ${IMU_size}"/>
    <material name="green"/>
    <origin rpy="0 0 0" xyz="0 0 0"/>
      <box size="${IMU_size} ${IMU_size} ${IMU_size}"/>

And here is the IMU plugin :

<gazebo >
    <plugin name="imu_plugin" filename="">
      <xyzOffsets>0 0 0</xyzOffsets>
      <rpyOffsets>0 0 0</rpyOffsets>

When echo-ing the topic /imu_data, I get :

  seq: 327
    secs: 16
    nsecs: 400000000
  frame_id: "imu_link"
  x: 4.69962116857e-06
  y: -4.8838604247e-08
  z: 7.97720664175e-05
  w: 0.999999996807
orientation_covariance: [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]
  x: -4.49165569326e-13
  y: 6.43295283435e-15
  z: 2.52244385042e-12
angular_velocity_covariance: [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]
  x: 3.40118210419e-07
  y: 9.18946096526e-05
  z: 9.79999999084
linear_acceleration_covariance: [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]

Also, @Tom Moore told me to post a sample message for every sensor input, so here is the sample from the topic /odom :

  seq: 165673
    secs: 1661
    nsecs: 260000000
  frame_id: "odom"
child_frame_id: "base_link"
      x: 0.267229286097
      y: 0.00580914153162
      z: 0.299999489939
      x: 1.20893461539e-05
      y: -8.60155713043e-08
      z: 0.0124744407312
      w: 0.999922191064
  covariance: [1e-05, 0.0, 0.0, 0 ...
edit retag flag offensive close merge delete


I'm a little suspicious that it has something to do with your TFs. If you could post your TF tree (without trying to run navsat transform) that would be useful.

stevejp gravatar imagestevejp ( 2018-04-03 12:04:39 -0600 )edit

I can not post image since I do not have enough karma point to upload a file

antonin_haulot gravatar imageantonin_haulot ( 2018-04-04 04:50:30 -0600 )edit

Upload it somewhere else and post the link here.

l4ncelot gravatar imagel4ncelot ( 2018-04-04 09:31:43 -0600 )edit

2 Answers

Sort by ยป oldest newest most voted

answered 2018-04-09 04:03:03 -0600

Tom Moore gravatar image

A couple things:

  1. Your IMU data has a frame_id of imu_link, and your GPS has a frame_id of GPS_link. You need to define static transforms from imu_link -> base_link and from gps_link to base_link.
  2. Keep in mind that, once navsat_transform_node gets a single usable IMU message, it unsubscribes from the IMU data. It only needs a single earth-referenced heading measurement.
edit flag offensive delete link more


Thank you for your answer. It seems that with the correct static transforms, the node is working fine !

antonin_haulot gravatar imageantonin_haulot ( 2018-04-13 10:22:46 -0600 )edit

What is the best way to get earth referenced heading measurement from IMU?

Jimeat gravatar imageJimeat ( 2018-07-26 18:07:29 -0600 )edit

Please ask a separate question.

Tom Moore gravatar imageTom Moore ( 2018-08-03 03:53:00 -0600 )edit

could you please tell me how you solved this in details?, thanks in advance.

A.Mahrous gravatar imageA.Mahrous ( 2019-09-30 23:24:43 -0600 )edit

answered 2018-03-30 17:04:27 -0600

cagatayyuruk gravatar image

In your /imu/data frame_id: looks base_link, it can be problem.

Change frame_id to /imu/link.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2018-03-30 08:24:52 -0600

Seen: 563 times

Last updated: Apr 09 '18