![Rosanswers logo](https://i.sstatic.net/yuGTR.png)
Can you post a sample IMU message? At first glance, I'd say you should get rid of your xxx_rejection_threshold settings. As for your question about tf
, ekf_localization_node
publishes a tf
transform from the world_frame to the base_link_frame, and navsat_transform_node
(optionally) publishes a transform from the UTM grid to your world frame. Even though you have that parameter set to false, the TransformBroadcaster object gets declared anyway, and I'm guessing that's enough to cause the graph to draw the arrow.
EDIT in response to updates/comments: the rejection thresholds are intended to help reject outlier measurements. Given your measurement sources, I don't think you need them. Just delete them from your launch file.
I think you should back up and try one thing at a time. Just run ekf_localization_node
, and start with just your IMU. Make sure that it's producing output, and then move on to integrating the navsat_transform_node
. And to answer what I think you were asking, yes, if you have some other source of odometry for your robot, then you should definitely fuse that as well.
EDIT 2: The nav_msgs/Odometry message uses quaternions to represent orientations. This is common in ROS. If you want to transform it, you'll need to write a node that takes in the quaternion and converts it. Alternatively, you can use tf_echo
to listen to the world_frame->base_link_frame transform being broadcast by ekf_localization_node
. tf_echo
does the conversion for you.
For the GPS, no, you don't currently need a base_link->gps transform.
EDIT 3 (in response to comments): I'm afraid I don't understand. What do you mean by you "adapted an EKF"? ekf_localization_node
and navsat_transform_node
are all you should need. Do rostopic echo /odometry/gps
. If it's not publishing, then navsat_transform_node
isn't getting all the data it needs, or there's an issue with the data it's getting. As to whether I'll revise the code, if you meant that I should fix navsat_transform_node
, I think it's more likely that there's an issue with the data. If you meant can I revise your code, I'm afraid I don't have the spare time.
EDIT 4: After looking at your debug file, I have a few notes:
- Your position is definitely not 0. I don't know what topic you're listening to or for how long, but if you search through the debug file for "Corrected full state is," you'll see that it's definitely integrating your GPS and IMU data, and that your positions are not 0. Are you certain you're echoing the right topic?
- That said, the GPS odometry messages that are coming in are all over the place. Not sure why. Have you plotted raw data from all your sensors to make sure the incoming data is correct?
- Your IMU data has incorrect accelerations. If you have it mounted flat, then your linear acceleration should be +9.81 for Z. Are you using a Microstrain GX2? Try this fork. Your accelerations and velocities are exploding.
- I think you might benefit from reading through all the robot_localization tutorials again, and pay particular attention to the sections on preparing your sensor data.
EDIT 5: No, when the sensor faces magnetic north, the quaternion values should be close to (0, 0, 0, 1), which is equivalent to 0 roll, 0 pitch, and 0 yaw. Why don't we take this offline and update the question and answer when we've figured it out? Please use my e-mail address on the wiki page.
Originally posted by Tom Moore with karma: 13689 on 2015-03-02
This answer was ACCEPTED on the original site
Post score: 2
Original comments
Comment by Porti77 on 2015-03-03:
When I connect the imu with single ekf not get to have / odometry / filtered. I have to throw something other than the node imu and the ekf? Or make a call to a service or change any settings?
Thanks for your time
Comment by Tom Moore on 2015-03-03:
No. One sensor is enough. If you're not getting output, then something is wrong. Are you broadcasting a transform from base_link->imu?
Comment by Porti77 on 2015-03-03:
I'm broadcasting a transform from base_link->imu, now i need euler angles because is more easy to interpret. When i want integrate a GPS i need broadcasting a transform from base_link->gps too?
Comment by Porti77 on 2015-03-05:
Thanks for all the help that you proporcionadao me. I'm using the same IMU that you and I want to place in the center of the vehicle, the transformed I do is correct? Because the message odometry filtered and leaves the imu are not consistent. The launch tf is above
Comment by Tom Moore on 2015-03-05:
Your parameters to static_transform_publisher
are wrong. It accepts two different parameter sets. One lets you specify Euler angles, and one lets you specify a quaternion. You are using the quaternion, but have the 1 in qX location, when it should be the qW location.
Comment by Porti77 on 2015-03-06:
I´ve corrected it and when i see the frames with rviz is right!! Thanks. Now i want integrate gps with navsat, i adapted a ekf for this but when i see odometry filtered the position x and y is 0. However gps/odometry is true. Can you revise the code?
Comment by Porti77 on 2015-03-06:
Ok thanks, asked if he thought my launch parameters are fine.
When I echo on odometry / gps values are correct, but when I echo on odometry / filtered position is always 0 in X and Y. I've already edited the launch with nodes that I throw. Thank You
Comment by Tom Moore on 2015-03-06:
Set debug mode to true, run your launch file, wait until a few /odometry/gps messages have been published, stop everything, and then post the debug output file using DropBox or something similar.
Comment by Porti77 on 2015-03-07:
Ok! Thanks! https://www.dropbox.com/sh/ab23ou7fo7nw2cd/AAD722h-vmk0dCveJaWuOfZBa?dl=0
Comment by Porti77 on 2015-03-25:
I sent you email! One more thing What axis of IMU points to magnetic north? X or Y. Thanks
Comment by Tom Moore on 2015-03-25:
I'm aware. I've been busy with work and will respond when I get a chance.