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

imu_filter_madgwick not publishing on imu/data

asked 2016-06-14 12:56:44 -0600

hashten gravatar image

updated 2016-06-14 13:08:34 -0600

Running the sample bag-file "ardrone_imu.bag", I am remapping the topic "/ardrone/imu" to "/imu/data_raw" since according to http://wiki.ros.org/imu_filter_madgwick , that is the nodes subscribed topic. I run the filter with:

rosrun imu_filter_madgwick imu_filter_node _use_magnetic_field_msg:=false _publish_debug_topics:=true

Looking at rostopic list -v and rostopic info on the topics I see that the /Imufilter is subscribing on /imu/data_raw and the /imu/data_raw topic seems fine when echoing it. But when I echo /imu/data where the fused orientation is supposed to be, nothing appears. I can't see any debug topics publishing either. What am I doing wrong here?

$ rostopic list -v

Published topics:
 * /imu/rpy/raw [geometry_msgs/Vector3Stamped] 1 publisher
 * /ardrone/mag [geometry_msgs/Vector3Stamped] 1 publisher
 * /imu/data [sensor_msgs/Imu] 1 publisher
 * /rosout [rosgraph_msgs/Log] 2 publishers
 * /tf [tf2_msgs/TFMessage] 1 publisher
 * /ImuFilter/parameter_descriptions [dynamic_reconfigure/ConfigDescription] 1 publisher
 * /clock [rosgraph_msgs/Clock] 1 publisher
 * /rosout_agg [rosgraph_msgs/Log] 1 publisher
 * /ImuFilter/parameter_updates [dynamic_reconfigure/Config] 1 publisher
 * /imu/magnetic_field [sensor_msgs/MagneticField] 1 publisher
 * /imu/rpy/filtered [geometry_msgs/Vector3Stamped] 1 publisher
 * /imu/data_raw [sensor_msgs/Imu] 1 publisher

Subscribed topics:
 * /imu/magnetic_field [sensor_msgs/MagneticField] 1 subscriber
 * /imu/mag [geometry_msgs/Vector3Stamped] 1 subscriber
 * /rosout [rosgraph_msgs/Log] 1 subscriber
 * /imu/data_raw [sensor_msgs/Imu] 1 subscriber

and

$ rostopic echo /imu/data_raw
  header: 
      seq: 3691
      stamp: 
        secs: 1352907263
        nsecs: 373922350
      frame_id: ardrone_base_link
    orientation: 
      x: 0.149071718242
      y: 0.115987049271
      z: -0.981395641479
      w: 0.0344560895747
    orientation_covariance: [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]
    angular_velocity: 
      x: -0.265703596544
      y: 0.275929386036
      z: 0.0895630139048
    angular_velocity_covariance: [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]
    linear_acceleration: 
      x: 0.448720367998
      y: 0.806759922206
      z: 8.29265825748
    linear_acceleration_covariance: [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0]

and

$ rostopic info /imu/data_raw
Type: sensor_msgs/Imu

Publishers: 
 * /player (http://user:44850/)

Subscribers: 
 * /ImuFilter (http://user:38581/)
edit retag flag offensive close merge delete

1 Answer

Sort by » oldest newest most voted
2

answered 2016-07-28 08:35:24 -0600

Sorry for the late reply. You forgot to remap the magnetometer topic. When use_mag is set to true (default), the node waits for matching pairs of messages on topics /imu/data_raw and either /imu/mag or /imu/magnetic_field. If the user does not provide one of the magnetic field topics, no data will be published on /imu/data. There should be a warning in this case; I've opened a ticket for that.

You probably started everything like this:

roscore
rosparam set use_sim_time true
rosrun imu_filter_madgwick imu_filter_node _use_magnetic_field_msg:=false _publish_debug_topics:=true
rosbag play --clock $(rospack find imu_filter_madgwick)/sample/ardrone_imu.bag /ardrone/imu:=/imu/data_raw

Option 1:

rosbag play ... /ardrone/imu:=/imu/data_raw /ardrone/mag:=/imu/mag

Option 2: (if you don't have or don't want to use magnetometer data)

rosrun imu_filter_madgwick imu_filter_node ... _use_mag:=false

edit flag offensive delete link more

Comments

Hi Martin, I just set use_mag to false and it works like a charm. Many thanks.

aaron cheng gravatar image aaron cheng  ( 2016-07-28 09:18:06 -0600 )edit

What additional benefits does the magnetic field message provide?

2ROS0 gravatar image 2ROS0  ( 2016-07-28 11:50:38 -0600 )edit

Question Tools

1 follower

Stats

Asked: 2016-06-14 12:54:40 -0600

Seen: 4,621 times

Last updated: Jul 28 '16