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

navsat_transform missing child_frame_id?

asked 2015-08-12 23:32:31 -0500

dan gravatar image

I am integrating GPS with odometry and IMU data. I am using two instances of robot_localization, one for the continuous data. That one feeds into a second one that gets gps data input. I use navsat_transform to transform the gps data to the proper frame. However, I found that the odometry output from navsat_transform.cpp is missing the child_frame_id. The string for that value is correctly passed to baseLinkFrameId_ but is not used in the prepareGpsOdometry method.

The result is that robot_localization does not update when passed the odometry output from navsat_transform. I was confused when I could not get output from robot_localization using the odometry from navsat_transform, yet could get output using other odometry sources as test inputs. When I saw that the child frame was missing from the navsat_transform odometry, I modified the source to supply that value and then robot_localization started responding. I don't know if that was the correct thing to do. In fact, I suppose it was not, since nobody else is having this problem, it must mean I am doing something incorrectly, but I cannot figure out what that could be.

Changing this section in navsat_transform.cpp:

  gpsOdom.header.frame_id = worldFrameId_;
  gpsOdom.header.stamp = gpsUpdateTime_;

to the following:

  gpsOdom.header.frame_id = worldFrameId_;
  gpsOdom.child_frame_id = baseLinkFrameId_;
  gpsOdom.header.stamp = gpsUpdateTime_;

fixes the problem. However, since the code is working for everyone else, I assume I am doing something wrong. Here is the navsat_transform.launch file:

<launch>

<node pkg="robot_localization" type="navsat_transform_node" name="navsat_transform_node" output= "screen" respawn="true">

  <param name="magnetic_declination_radians" value="0"/>

  <param name="yaw_offset" value="0"/>
  <param name="use_odometry_yaw" value="true" />   <!-- when true, we use yaw from the UKF, when false we use imu_data -->   
  <param name="wait_for_datum" value="false" />     <!-- when true, we use the datum parameter for initial location, when false we get it from the UKF -->

  <remap from="/imu/data" to="/imu_center" />
  <remap from="/gps/fix" to="/fix" />
  <remap from="/odometry/filtered" to="/odom_ukf" />
  <remap from="/odometry/gps" to="/odom_navsat" /> 

</node>

</launch>

edit retag flag offensive close merge delete

3 Answers

Sort by ยป oldest newest most voted
1

answered 2015-08-14 10:52:30 -0500

dan gravatar image

I was not properly including the first robot_localization output into the gps robot_localization odom input. Since it was not receiving that data, it was not updating.

edit flag offensive delete link more
0

answered 2016-03-25 18:52:28 -0500

My localization node that was accepting the gps data, kept warning it could not convert from ->base_link because the child frame was missing. It turned out I'd set the localization node, to listen to that odom message for velocity, so when I set that false then it worked.

edit flag offensive delete link more
1

answered 2015-08-13 01:23:17 -0500

Tom Moore gravatar image

updated 2015-08-13 07:34:32 -0500

A nav_msgs/Odometry message contains two primary parts, a geometry_msgs/PoseWithCovariance, and a geometry_msgs/TwistWithCovariance (velocity). Each is reported in a different frame. The pose data gets reported in a world-fixed frame (typically map or odom), and the velocity data is reported in the robot's body frame (typically base_link). See REP 105. The nav_msgs/Odometry message needs some way to report the frame_ids for the pose data and velocity data, so the header's frame_id is reserved for the pose data, and the child_frame_id field refers to the velocity.

navsat_transform_node converts navsat data into local world-frame position data. As such, the node does not report velocity. In the long term, the output should really be changed to a geometry_msgs/PoseWithCovarianceStamped message, but regardless, the velocity data in the Odometry message is not filled out, and so we don't bother setting the child_frame_id.

As to why this appears to make a difference for you, I couldn't say without more information, e.g., sample messages for your inputs and your entire ukf_localization_node launch files. Bag files are also extremely helpful.

edit flag offensive delete link more

Comments

Here is a link to a folder with bag files for both cases (with and without the child frame, so with and without a response from the gps robot_localization. tf trees, messages, launch files are here too. data_folder

dan gravatar image dan  ( 2015-08-13 23:54:27 -0500 )edit

And, by the way, thanks so much both for your help with this and for the robot_localization package. It is extremely useful, professionally written, and very well documented.

dan gravatar image dan  ( 2015-08-14 00:05:14 -0500 )edit

I think I figured it out-- I was not properly including the odom from the first robot_localization into the gps robot_localization.

dan gravatar image dan  ( 2015-08-14 10:48:44 -0500 )edit

Question Tools

2 followers

Stats

Asked: 2015-08-12 23:32:31 -0500

Seen: 1,518 times

Last updated: Aug 14 '15