Robotics StackExchange | Archived questions

remap "odometry/filtered" to "odom" causes weird behaviour in final odom output

** bag files attached! please help,

Hello, so i have been trying to use ekf ros package on ROS MELODIC, i have successfully implemented MPU 6050 using this code MPU 6050 ROSSERIAL NODE. My tf tree looks like this image description

my ekf.yaml file looks like this

frequency: 100

two_d_mode: true

publish_tf: true


odom_frame: odom
base_link_frame: base_link
world_frame: odom
map_frame: map

odom0: /odom
odom0_config: [false,false,false,
              false,false,false,
              true,true,false,
              false,false,true,
              false,false,false,]

odom0_differential: false

imu0: /imu/data
imu0_config: [false,false,false,
              false,false,true,
              false,false,false,
              false,false,true,
              true,false,false,]

imu0_differential: false

imu0_remove_gravitational_acceleration: true

dynamic_process_noise_covariance: true

initial_state: [1.0,  2.0,  0.0,
               0.0,  0.0,  1.83,
               0.0,  0.0,  0.0,
               0.0,  0.0,  0.0,
               0.0,  0.0,  0.0]

My navigation launch file looks like this

<launch>
  <!-- Arguments -->
  <arg name="open_rviz" default="true"/>
  <arg name="move_forward_only" default="false"/>
  <arg name="map_file" default="$(find xbotrealversionone_navigation)/map_provider/maps/test2.yaml"/>

  <!-- xbotreal -->

  <!-- Map server -->
  <node pkg="map_server" name="map_server" type="map_server" args="$(arg map_file)"/>

  <!-- AMCL -->
  <include file="$(find xbotrealversionone_navigation)/launch/amcl.launch">
    <!--param name="odom_frame_id" value="odometry/filtered"/-->

  </include>

  <!-- move_base -->
  <include file="$(find xbotrealversionone_navigation)/launch/move_base.launch">
    <arg name="move_forward_only" value="$(arg move_forward_only)"/>
    <!--param name="odom_frame_id" value="odometry/filtered"/-->

  </include>

  <!-- rviz -->
  <group if="$(arg open_rviz)"> 
    <node pkg="rviz" type="rviz" name="rviz" required="true"
          args="-d $(find xbotrealversionone_description)/urdf.rviz"/>
  </group>

  <node pkg="robot_localization" type="ekf_localization_node" name="ekf_se" clear_params="true">
    <rosparam command="load" file="$(find xbotrealversionone_navigation)/configuration_files/ekf.yaml"/>
    <!--remap from="odometry/filtered" to="odom"/-->
  </node>
</launch>

The issue is when i comment out the i can visualize odometry filtered and odom both in rviz. their behaviour is pretty good. the localization is consitent with very very low drift which amcl takes care. however when i use the remap, cause i want to be able to do autonomous navigation. all of a sudden my robot starts to drift in x-direction with my /odom rapidly jumping to zero and then to some value, in a wave fashion.

Asked by Rahulwashere on 2023-03-11 07:50:30 UTC

Comments

A possible reason for this symptom is that you're somehow wrapping the EKF output back into one of its inputs.

Asked by Mike Scheutzow on 2023-03-12 08:12:26 UTC

i thought we were supposed to do it ?? however instead today i tried feeding odometry/filtered to amcl as well as move_base , i could perform the navigation robustly. but were we not supposed to remap this parameter.

Asked by Rahulwashere on 2023-03-12 08:48:56 UTC

Answers

If you want to rename the output topic of the EKF to /odom, then you also have to rename any input topic already using that topic name to something else.

Asked by Mike Scheutzow on 2023-03-13 07:43:24 UTC

Comments