Ask Your Question
0

robot_localization from map to odom does not move on Ubuntu-18.04 Melodic

asked 2019-07-02 09:03:31 -0500

RayROS gravatar image

updated 2019-07-03 11:47:41 -0500

I am using robot_localizationin my project. I'm fusing data from camera odometry, imu, depth sensor and usbl (XY position sensor) as odom0, , odom1, odom2 and imu0 respectively. I followed the instructions in configuring the parameters on official documentation and set the frames as a "fixed frame" and a "moving frame". In my case the moving frame is the odom frame and the fixed frame is the base_link.

rviz

The documentation tells me this should make the ekf_localization node publish the transform from map to odom if the publish_tf param is set to true. The launch file both for the "fixed frame" and the "moving frame" is below together with the tf tree:

<?xml version="1.0"?>
<launch>
<param name="use_sim_time" value="true" />

 <node pkg="robot_localization" type="ekf_localization_node"
     name="ekf_odom" clear_params="false">
    <param name="use_sim_time" value="true" />
    <param name="sensor_timeout" value="2.0"/>
    <param name="two_d_mode" value="false"/>
    <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="publish_tf" value="true"/>
    <param name="frequency" value="10"/>

    <param name="imu0" value="/imu/data_w_orientation"/>
    <rosparam param="imu0_config">[false, false, false,
                                   true,  true,  true,
                                   false, false, false,
                                   false, false, false,
                                   false, false, false]</rosparam>
    <param name="imu0_differential" value="false"/>

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


    <param name="odom0" value="/cam/odometry"/>
    <rosparam param="odom0_config">[false, false, false,
                                    true,  true,  false,
                                    false, false, false,
                                    false, false, false,
                                    false, false, false]</rosparam>
    <param name="odom0_differential" value="false"/>
  </node>

<node pkg="robot_localization" type="ekf_localization_node"
    name="ekf_map" clear_params="false">
   <param name="use_sim_time" value="true" />
   <param name="transform_time_offset" value="0.2"/>
   <param name="sensor_timeout" value="2.0"/>
   <param name="two_d_mode" value="false"/>
   <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="map"/>
   <param name="publish_tf" value="true"/>
   <param name="frequency" value="10"/>
   <param name="smooth_lagged_data" value="true"/>

<!-- upload config files here -->
   <rosparam file="$(find ros_float)/config/au_au.yaml" command="load" />
   <rosparam file="$(find ros_float)/config/cov_config.yaml" command="load" />

   <param name="odom0" value="/usbl/pose_projected"/>
   <rosparam param="odom0_config">[true, true,  false,
                                  false, false, false,
                                  false, false, false,
                                  false, false, false,
                                  false, false, false]</rosparam>
   <param name="odom0_differential" value="false"/>
   <param name="odom0_nodelay" value="true"/>
   <param name="odom0_relative" value="false"/>

   <param name="imu0" value="/imu/data_w_orientation"/>
   <rosparam param="imu0_config">[false, false, false,
                                  true,  true,  true,
                                  false, false, false,
                                  false, false, false,
                                  false, false, false]</rosparam>
   <param name="imu0_differential" value="false"/>

   <param name="odom1" value="/filter/fluid_pressure/depth"/>
   <rosparam param="odom1_config">[false, false, true,
                                   false, false, false,
                                   false, false, false,
                                   false, false, false,
                                   false, false, false]</rosparam>
   <param name="odom1_differential" value="false"/>

   <param name="odom2" value="/cam/odometry"/>
   <rosparam param="odom2_config">[false, false, false ...
(more)
edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
2

answered 2019-07-03 04:50:23 -0500

Tom Moore gravatar image

You have a bad frame configuration in your map-frame EKF.

Here's your odom-frame EKF:

<node pkg="robot_localization" type="ekf_localization_node"
     name="ekf_odom" clear_params="false">
  <param name="use_sim_time" value="true" />
  <param name="sensor_timeout" value="2.0"/>
  <param name="two_d_mode" value="false"/>
  <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"/>

Here's your map-frame EKF:

<node pkg="robot_localization" type="ekf_localization_node"
    name="ekf_map" clear_params="false">
  <param name="use_sim_time" value="true" />
  <param name="transform_time_offset" value="0.2"/>
  <param name="sensor_timeout" value="2.0"/>
  <param name="two_d_mode" value="false"/>
  <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"/>          <!-- OFFENDING LINE -->

The world_frame in your map-frame EKF should be map, not odom. There's a template config in the package.

There may be other issues, but that's a big one.

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

Stats

Asked: 2019-07-02 09:03:31 -0500

Seen: 29 times

Last updated: Jul 03