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

Revision history [back]

This is due to a change in REP-103. Previously, navsat_transform_node assumed that a 0 reading on a compass was at magnetic north. Now we assume it's east ("magnetic east" in the sense that you still have to apply a magnetic declination to get true east). I simply didn't get around to changing that test launch file by applying a yaw_offset of pi/2.

This is due to a change in REP-103. Previously, navsat_transform_node assumed that a 0 reading on a compass was at magnetic north. Now we assume it's east ("magnetic east" in the sense that you still have to apply a magnetic declination to get true east). I simply didn't get around to changing that test launch file by applying a yaw_offset of pi/2.

EDIT: I just noticed that you gave it a datum. Take that line out of your navsat_transform_node launch file. The datum manually sets the GPS origin and orientation for the transform. That parameter isn't quite ready for prime time (unless you grabbed the source from the repo).

This is due to a change in REP-103. Previously, navsat_transform_node assumed that a 0 reading on a compass was at magnetic north. Now we assume it's east ("magnetic east" in the sense that you still have to apply a magnetic declination to get true east). I simply didn't get around to changing that test launch file by applying a yaw_offset of pi/2.

EDIT: I just noticed that you gave it a datum. Take that line out of your navsat_transform_node launch file. The datum manually sets the GPS origin and orientation for the transform. That parameter isn't quite ready for prime time (unless you grabbed the source from the repo).

EDIT 2: Hmm, you already have wait_for_datum set to false. I'll look at the bag file later, as I don't have access to DropBox at the moment. My first guess is that there's something going on with your IMU message, but I'll have to see that.

This is due to a change in REP-103. Previously, navsat_transform_node assumed that a 0 reading on a compass was at magnetic north. Now we assume it's east ("magnetic east" in the sense that you still have to apply a magnetic declination to get true east). I simply didn't get around to changing that test launch file by applying a yaw_offset of pi/2.

EDIT: OK, I just noticed figured out your issue. Most of your problem is that you gave it a datum. Take that never remapped your /imu/data topic for navsat_transform_node. You needed to add this line out of to your navsat_transform_node launch file. The datum manually sets the GPS origin and orientation for the transform. That parameter isn't quite ready for prime time (unless you grabbed the source from the repo).launch:

EDIT 2: Hmm, you already have wait_for_datum set to false. I'll look at the bag file later, as I don't have access to DropBox at the moment. My first guess is that there's something going on with your IMU message, but I'll have to see that.<remap from="/imu/data" to="/compass/data"/>

The reason you still got a utm->odom transform is a bug that I fixed in the repo a while ago. Even with the Debian package version, though, this worked for me:

<launch>

   <param name="/use_sim_time" value="true" />

   <node pkg="rosbag" type="play" name="rosbagplay" args="/home/tmoore/Desktop/porti.bag --clock -d 3" required="true"/>

   <node pkg="tf2_ros" type="static_transform_publisher" name="bl_imu" args="0.0 0.0 0.0 0.0 0.0 0.0 1.0 base_link compass" />

   <node pkg="robot_localization" type="ekf_localization_node" name="ekf_localization" clear_params="true">

       <param name="frequency" value="30"/>
       <param name="sensor_timeout" value="0.1"/>
       <param name="two_d_mode" value="true"/>

       <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="transform_time_offset" value="0.0"/>

       <param name="odom0" value="/odometry/gps"/>
       <param name="imu0" value="/compass/data"/>

         <rosparam param="odom0_config">[ true,  true, false,
                                         false, false, false,
                                         false, false, false,
                                         false, false, false,
                                         false, false, false]</rosparam>

         <rosparam param="imu0_config">[false, false, false,
                                         true,  true,  true,
                                        false, false, false,
                                         true,  true,  true,
                                         true,  true,  true]</rosparam>

       <param name="odom0_differential" value="false"/>
       <param name="imu0_differential" value="false"/>

       <param name="odom0_relative" value="false"/>
       <param name="imu0_relative" value="false"/>

       <param name="imu0_remove_gravitational_acceleration" value="true"/>

       <param name="print_diagnostics" value="true"/>

       <param name="odom0_queue_size" value="10"/>
       <param name="imu0_queue_size" value="10"/>

       <param name="debug"           value="false"/>
       <param name="debug_out_file"  value="debug_ekf_localization.txt"/>

         <rosparam param="process_noise_covariance">[0.05, 0,    0,    0,    0,    0,    0,     0,     0,    0,    0,    0,    0,    0,    0,
                                                     0,    0.05, 0,    0,    0,    0,    0,     0,     0,    0,    0,    0,    0,    0,    0,
                                                     0,    0,    0.06, 0,    0,    0,    0,     0,     0,    0,    0,    0,    0,    0,    0,
                                                     0,    0,    0,    0.03, 0,    0,    0,     0,     0,    0,    0,    0,    0,    0,    0,
                                                     0,    0,    0,    0,    0.03, 0,    0,     0,     0,    0,    0,    0,    0,    0,    0,
                                                     0,    0,    0,    0,    0,    0.06, 0,     0,     0,    0,    0,    0,    0,    0,    0,
                                                     0,    0,    0,    0,    0,    0,    0.025, 0,     0,    0,    0,    0,    0,    0,    0,
                                                     0,    0,    0,    0,    0,    0,    0,     0.025, 0,    0,    0,    0,    0,    0,    0,
                                                     0,    0,    0,    0,    0,    0,    0,     0,     0.04, 0,    0,    0,    0,    0,    0,
                                                     0,    0,    0,    0,    0,    0,    0,     0,     0,    0.01, 0,    0,    0,    0,    0,
                                                     0,    0,    0,    0,    0,    0,    0,     0,     0,    0,    0.01, 0,    0,    0,    0,
                                                     0,    0,    0,    0,    0,    0,    0,     0,     0,    0,    0,    0.02, 0,    0,    0,
                                                     0,    0,    0,    0,    0,    0,    0,     0,     0,    0,    0,    0,    0.01, 0,    0,
                                                     0,    0,    0,    0,    0,    0,    0,     0,     0,    0,    0,    0,    0,    0.01, 0,
                                                     0,    0,    0,    0,    0,    0,    0,     0,     0,    0,    0,    0,    0,    0,    0.015]</rosparam>

         <rosparam param="initial_estimate_covariance">[1e-9, 0,    0,    0,    0,    0,    0,    0,    0,    0,     0,     0,     0,    0,    0,
                                                        0,    1e-9, 0,    0,    0,    0,    0,    0,    0,    0,     0,     0,     0,    0,    0,
                                                        0,    0,    1e-9, 0,    0,    0,    0,    0,    0,    0,     0,     0,     0,    0,    0,
                                                        0,    0,    0,    1e-9, 0,    0,    0,    0,    0,    0,     0,     0,     0,    0,    0,
                                                        0,    0,    0,    0,    1e-9, 0,    0,    0,    0,    0,     0,     0,     0,    0,    0,
                                                        0,    0,    0,    0,    0,    1e-9, 0,    0,    0,    0,     0,     0,     0,    0,    0,
                                                        0,    0,    0,    0,    0,    0,    1e-9, 0,    0,    0,     0,     0,     0,    0,    0,
                                                        0,    0,    0,    0,    0,    0,    0,    1e-9, 0,    0,     0,     0,     0,    0,    0,
                                                        0,    0,    0,    0,    0,    0,    0,    0,    1e-9, 0,     0,     0,     0,    0,    0,
                                                        0,    0,    0,    0,    0,    0,    0,    0,    0,    1e-9,  0,     0,     0,    0,    0,
                                                        0,    0,    0,    0,    0,    0,    0,    0,    0,    0,     1e-9,  0,     0,    0,    0,
                                                        0,    0,    0,    0,    0,    0,    0,    0,    0,    0,     0,     1e-9,  0,    0,    0,
                                                        0,    0,    0,    0,    0,    0,    0,    0,    0,    0,     0,     0,     1e-9, 0,    0,
                                                        0,    0,    0,    0,    0,    0,    0,    0,    0,    0,     0,     0,     0,    1e-9, 0,
                                                        0,    0,    0,    0,    0,    0,    0,    0,    0,    0,     0,     0,     0,    0,    1e-9]</rosparam>

   </node>

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

       <!-- Frequency of the main run loop. -->
       <param name="frequency" value="30"/>

       <param name="delay" value="3"/>
       <param name="magnetic_declination_radians" value="0"/>
       <param name="yaw_offset" value="0"/>
       <param name="zero_altitude" value="true"/>
       <param name="broadcast_utm_transform" value="true"/>
       <param name="publish_filtered_gps" value="true"/>
       <param name="use_odometry_yaw" value="false"/>

       <remap from="/gps/fix" to="fix"/>
       <remap from="/imu/data" to="/compass/data"/>

   </node>

</launch>

This is due to a change in REP-103. Previously, navsat_transform_node assumed that a 0 reading on a compass was at magnetic north. Now we assume it's east ("magnetic east" in the sense that you still have to apply a magnetic declination to get true east). I simply didn't get around to changing that test launch file by applying a yaw_offset of pi/2.

EDIT: OK, I figured out your issue. Most of your problem is that you never remapped your /imu/data topic for navsat_transform_node. You needed to add this line to your navsat_transform_node launch:

 <remap from="/imu/data" to="/compass/data"/>

to="/compass/data"/>

The reason you still got a utm->odom transform is a bug that I fixed in the repo a while ago. Even with the Debian package version, though, this worked for me:

<launch>

   <param name="/use_sim_time" value="true" />

   <node pkg="rosbag" type="play" name="rosbagplay" args="/home/tmoore/Desktop/porti.bag --clock -d 3" required="true"/>

   <node pkg="tf2_ros" type="static_transform_publisher" name="bl_imu" args="0.0 0.0 0.0 0.0 0.0 0.0 1.0 base_link compass" />

   <node pkg="robot_localization" type="ekf_localization_node" name="ekf_localization" clear_params="true">

       <param name="frequency" value="30"/>
       <param name="sensor_timeout" value="0.1"/>
       <param name="two_d_mode" value="true"/>

       <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="transform_time_offset" value="0.0"/>

       <param name="odom0" value="/odometry/gps"/>
       <param name="imu0" value="/compass/data"/>

         <rosparam param="odom0_config">[ true,  true, false,
                                         false, false, false,
                                         false, false, false,
                                         false, false, false,
                                         false, false, false]</rosparam>

         <rosparam param="imu0_config">[false, false, false,
                                         true,  true,  true,
                                        false, false, false,
                                         true,  true,  true,
                                         true,  true,  true]</rosparam>

       <param name="odom0_differential" value="false"/>
       <param name="imu0_differential" value="false"/>

       <param name="odom0_relative" value="false"/>
       <param name="imu0_relative" value="false"/>

       <param name="imu0_remove_gravitational_acceleration" value="true"/>

       <param name="print_diagnostics" value="true"/>

       <param name="odom0_queue_size" value="10"/>
       <param name="imu0_queue_size" value="10"/>

       <param name="debug"           value="false"/>
       <param name="debug_out_file"  value="debug_ekf_localization.txt"/>

         <rosparam param="process_noise_covariance">[0.05, 0,    0,    0,    0,    0,    0,     0,     0,    0,    0,    0,    0,    0,    0,
                                                     0,    0.05, 0,    0,    0,    0,    0,     0,     0,    0,    0,    0,    0,    0,    0,
                                                     0,    0,    0.06, 0,    0,    0,    0,     0,     0,    0,    0,    0,    0,    0,    0,
                                                     0,    0,    0,    0.03, 0,    0,    0,     0,     0,    0,    0,    0,    0,    0,    0,
                                                     0,    0,    0,    0,    0.03, 0,    0,     0,     0,    0,    0,    0,    0,    0,    0,
                                                     0,    0,    0,    0,    0,    0.06, 0,     0,     0,    0,    0,    0,    0,    0,    0,
                                                     0,    0,    0,    0,    0,    0,    0.025, 0,     0,    0,    0,    0,    0,    0,    0,
                                                     0,    0,    0,    0,    0,    0,    0,     0.025, 0,    0,    0,    0,    0,    0,    0,
                                                     0,    0,    0,    0,    0,    0,    0,     0,     0.04, 0,    0,    0,    0,    0,    0,
                                                     0,    0,    0,    0,    0,    0,    0,     0,     0,    0.01, 0,    0,    0,    0,    0,
                                                     0,    0,    0,    0,    0,    0,    0,     0,     0,    0,    0.01, 0,    0,    0,    0,
                                                     0,    0,    0,    0,    0,    0,    0,     0,     0,    0,    0,    0.02, 0,    0,    0,
                                                     0,    0,    0,    0,    0,    0,    0,     0,     0,    0,    0,    0,    0.01, 0,    0,
                                                     0,    0,    0,    0,    0,    0,    0,     0,     0,    0,    0,    0,    0,    0.01, 0,
                                                     0,    0,    0,    0,    0,    0,    0,     0,     0,    0,    0,    0,    0,    0,    0.015]</rosparam>

         <rosparam param="initial_estimate_covariance">[1e-9, 0,    0,    0,    0,    0,    0,    0,    0,    0,     0,     0,     0,    0,    0,
                                                        0,    1e-9, 0,    0,    0,    0,    0,    0,    0,    0,     0,     0,     0,    0,    0,
                                                        0,    0,    1e-9, 0,    0,    0,    0,    0,    0,    0,     0,     0,     0,    0,    0,
                                                        0,    0,    0,    1e-9, 0,    0,    0,    0,    0,    0,     0,     0,     0,    0,    0,
                                                        0,    0,    0,    0,    1e-9, 0,    0,    0,    0,    0,     0,     0,     0,    0,    0,
                                                        0,    0,    0,    0,    0,    1e-9, 0,    0,    0,    0,     0,     0,     0,    0,    0,
                                                        0,    0,    0,    0,    0,    0,    1e-9, 0,    0,    0,     0,     0,     0,    0,    0,
                                                        0,    0,    0,    0,    0,    0,    0,    1e-9, 0,    0,     0,     0,     0,    0,    0,
                                                        0,    0,    0,    0,    0,    0,    0,    0,    1e-9, 0,     0,     0,     0,    0,    0,
                                                        0,    0,    0,    0,    0,    0,    0,    0,    0,    1e-9,  0,     0,     0,    0,    0,
                                                        0,    0,    0,    0,    0,    0,    0,    0,    0,    0,     1e-9,  0,     0,    0,    0,
                                                        0,    0,    0,    0,    0,    0,    0,    0,    0,    0,     0,     1e-9,  0,    0,    0,
                                                        0,    0,    0,    0,    0,    0,    0,    0,    0,    0,     0,     0,     1e-9, 0,    0,
                                                        0,    0,    0,    0,    0,    0,    0,    0,    0,    0,     0,     0,     0,    1e-9, 0,
                                                        0,    0,    0,    0,    0,    0,    0,    0,    0,    0,     0,     0,     0,    0,    1e-9]</rosparam>

   </node>

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

       <!-- Frequency of the main run loop. -->
       <param name="frequency" value="30"/>

       <param name="delay" value="3"/>
       <param name="magnetic_declination_radians" value="0"/>
       <param name="yaw_offset" value="0"/>
       <param name="zero_altitude" value="true"/>
       <param name="broadcast_utm_transform" value="true"/>
       <param name="publish_filtered_gps" value="true"/>
       <param name="use_odometry_yaw" value="false"/>

       <remap from="/gps/fix" to="fix"/>
       <remap from="/imu/data" to="/compass/data"/>

   </node>

</launch>

This is due to a change in REP-103. Previously, navsat_transform_node assumed that a 0 reading on a compass was at magnetic north. Now we assume it's east ("magnetic east" in the sense that you still have to apply a magnetic declination to get true east). I simply didn't get around to changing that test launch file by applying a yaw_offset of pi/2.

EDIT: EDIT: OK, I figured out your issue. Most of your problem is that you never remapped your /imu/data topic for navsat_transform_node. You needed to add this line to your navsat_transform_node launch:

 <remap from="/imu/data" to="/compass/data"/>

The reason you still got a utm->odom transform is a bug that I fixed in the repo a while ago. Even with the Debian package version, though, this worked for me:

<launch>

   <param name="/use_sim_time" value="true" />

   <node pkg="rosbag" type="play" name="rosbagplay" args="/home/tmoore/Desktop/porti.bag --clock -d 3" required="true"/>

   <node pkg="tf2_ros" type="static_transform_publisher" name="bl_imu" args="0.0 0.0 0.0 0.0 0.0 0.0 1.0 base_link compass" />

   <node pkg="robot_localization" type="ekf_localization_node" name="ekf_localization" clear_params="true">

       <param name="frequency" value="30"/>
       <param name="sensor_timeout" value="0.1"/>
       <param name="two_d_mode" value="true"/>

       <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="transform_time_offset" value="0.0"/>

       <param name="odom0" value="/odometry/gps"/>
       <param name="imu0" value="/compass/data"/>

         <rosparam param="odom0_config">[ true,  true, false,
                                         false, false, false,
                                         false, false, false,
                                         false, false, false,
                                         false, false, false]</rosparam>

         <rosparam param="imu0_config">[false, false, false,
                                         true,  true,  true,
                                        false, false, false,
                                         true,  true,  true,
                                         true,  true,  true]</rosparam>

       <param name="odom0_differential" value="false"/>
       <param name="imu0_differential" value="false"/>

       <param name="odom0_relative" value="false"/>
       <param name="imu0_relative" value="false"/>

       <param name="imu0_remove_gravitational_acceleration" value="true"/>

       <param name="print_diagnostics" value="true"/>

       <param name="odom0_queue_size" value="10"/>
       <param name="imu0_queue_size" value="10"/>

       <param name="debug"           value="false"/>
       <param name="debug_out_file"  value="debug_ekf_localization.txt"/>

         <rosparam param="process_noise_covariance">[0.05, 0,    0,    0,    0,    0,    0,     0,     0,    0,    0,    0,    0,    0,    0,
                                                     0,    0.05, 0,    0,    0,    0,    0,     0,     0,    0,    0,    0,    0,    0,    0,
                                                     0,    0,    0.06, 0,    0,    0,    0,     0,     0,    0,    0,    0,    0,    0,    0,
                                                     0,    0,    0,    0.03, 0,    0,    0,     0,     0,    0,    0,    0,    0,    0,    0,
                                                     0,    0,    0,    0,    0.03, 0,    0,     0,     0,    0,    0,    0,    0,    0,    0,
                                                     0,    0,    0,    0,    0,    0.06, 0,     0,     0,    0,    0,    0,    0,    0,    0,
                                                     0,    0,    0,    0,    0,    0,    0.025, 0,     0,    0,    0,    0,    0,    0,    0,
                                                     0,    0,    0,    0,    0,    0,    0,     0.025, 0,    0,    0,    0,    0,    0,    0,
                                                     0,    0,    0,    0,    0,    0,    0,     0,     0.04, 0,    0,    0,    0,    0,    0,
                                                     0,    0,    0,    0,    0,    0,    0,     0,     0,    0.01, 0,    0,    0,    0,    0,
                                                     0,    0,    0,    0,    0,    0,    0,     0,     0,    0,    0.01, 0,    0,    0,    0,
                                                     0,    0,    0,    0,    0,    0,    0,     0,     0,    0,    0,    0.02, 0,    0,    0,
                                                     0,    0,    0,    0,    0,    0,    0,     0,     0,    0,    0,    0,    0.01, 0,    0,
                                                     0,    0,    0,    0,    0,    0,    0,     0,     0,    0,    0,    0,    0,    0.01, 0,
                                                     0,    0,    0,    0,    0,    0,    0,     0,     0,    0,    0,    0,    0,    0,    0.015]</rosparam>

         <rosparam param="initial_estimate_covariance">[1e-9, 0,    0,    0,    0,    0,    0,    0,    0,    0,     0,     0,     0,    0,    0,
                                                        0,    1e-9, 0,    0,    0,    0,    0,    0,    0,    0,     0,     0,     0,    0,    0,
                                                        0,    0,    1e-9, 0,    0,    0,    0,    0,    0,    0,     0,     0,     0,    0,    0,
                                                        0,    0,    0,    1e-9, 0,    0,    0,    0,    0,    0,     0,     0,     0,    0,    0,
                                                        0,    0,    0,    0,    1e-9, 0,    0,    0,    0,    0,     0,     0,     0,    0,    0,
                                                        0,    0,    0,    0,    0,    1e-9, 0,    0,    0,    0,     0,     0,     0,    0,    0,
                                                        0,    0,    0,    0,    0,    0,    1e-9, 0,    0,    0,     0,     0,     0,    0,    0,
                                                        0,    0,    0,    0,    0,    0,    0,    1e-9, 0,    0,     0,     0,     0,    0,    0,
                                                        0,    0,    0,    0,    0,    0,    0,    0,    1e-9, 0,     0,     0,     0,    0,    0,
                                                        0,    0,    0,    0,    0,    0,    0,    0,    0,    1e-9,  0,     0,     0,    0,    0,
                                                        0,    0,    0,    0,    0,    0,    0,    0,    0,    0,     1e-9,  0,     0,    0,    0,
                                                        0,    0,    0,    0,    0,    0,    0,    0,    0,    0,     0,     1e-9,  0,    0,    0,
                                                        0,    0,    0,    0,    0,    0,    0,    0,    0,    0,     0,     0,     1e-9, 0,    0,
                                                        0,    0,    0,    0,    0,    0,    0,    0,    0,    0,     0,     0,     0,    1e-9, 0,
                                                        0,    0,    0,    0,    0,    0,    0,    0,    0,    0,     0,     0,     0,    0,    1e-9]</rosparam>

   </node>

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

       <!-- Frequency of the main run loop. -->
       <param name="frequency" value="30"/>

       <param name="delay" value="3"/>
       <param name="magnetic_declination_radians" value="0"/>
       <param name="yaw_offset" value="0"/>
       <param name="zero_altitude" value="true"/>
       <param name="broadcast_utm_transform" value="true"/>
       <param name="publish_filtered_gps" value="true"/>
       <param name="use_odometry_yaw" value="false"/>

       <remap from="/gps/fix" to="fix"/>
       <remap from="/imu/data" to="/compass/data"/>

   </node>

</launch>

EDIT in response to further questions/comments:

The reason the orientation in the transform from utm->odom is always near 0 is because your IMU and EKF orientations are almost identical (they have the same source, but the EKF output has, of course, been filtered). So no matter which direction you're facing, the orientation of those coordinate frames will match, and the rotational component of their transform will be near 0. So:

  • If you want the orientation in the utm->odom transform to be exactly 0, then set use_odometry_yaw to true for navsat_transform_node and make sure imu0_relative is false for ekf_localization_node.
  • If you don't want the orientation in the utm->odom transform to be 0 (so that you can confirm it's working), set imu0_relative to true for ekf_localization_node and make sure that use_odometry_yaw is set to false for navsat_transform_node.

If your IMU reads 0 when facing east and pi/2 when facing north, then you should set the yaw_offset to 0 for navsat_transform_node. If your IMU reads 0 when facing north and -pi/2 when facing east, then set yaw_offset to positive pi/2.