0
$\begingroup$

I am using two instances of ROS robot_localization package to get the local and global odometry. In the local one, I am fusing IMU and twist messages. It is working fine. But when I use the second instance where map and odom frame both should be fixed points, one of them is moving. I set map as the fixed frame, then odom is moving. Why is that? Odom should remain fixed at the initial starting point. base_link with respect to odom is working fine but since odom is moving, base_link with respect to map is not working.

In the image, you can see the map frame is the big axes. odom frame was there too. But as I move the robot, the odom frame starts moving. The red lines are local odometry and green ones are global odometry.

enter image description here 1st instance:

ekf_se_odom: # Used only for broadcasting odom to base_link transforms
  frequency: 30
  sensor_timeout: 0.1
  two_d_mode: true
  transform_time_offset: 0.0
  transform_timeout: 0.0
  print_diagnostics: true
  debug: false

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

2nd instance:

ekf_se_map:
  frequency: 30
  sensor_timeout: 0.1
  two_d_mode: true
  transform_time_offset: 0.0
  transform_timeout: 0.0
  print_diagnostics: true
  debug: false

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

  publish_tf: true

navsat_node:

navsat_transform:
  frequency: 30
  delay: 3.0
  magnetic_declination_radians: 0.0842
  yaw_offset: -1.57080
  zero_altitude: true
  broadcast_utm_transform: true
  publish_filtered_gps: true
  use_odometry_yaw: false
  wait_for_datum: false
  broadcast_utm_transform_as_parent_frame: false

I am using gazebo husky simulation.

$\endgroup$
1
  • $\begingroup$ Are you sure, you do not have other nodes running in the background? Using Ctrl + C does stop the stop but sometimes, it runs in the background. $\endgroup$
    – Wilhelm
    Commented Dec 30, 2022 at 11:25

1 Answer 1

1
$\begingroup$

Odom should remain fixed at the initial starting point.

This assumption is not correct, as map->odom is allowed to change. You have configured your 2nd instance to publish this update.

An update to the map->odom TF is typically done to correct for drift in odom->base_link since it comes from an odometry source.

The purpose of this to make the overall transform map->base_link a globally accurate source for localisation and mapping purpose which may have discontinuous jumps (e.g. Due to loop closure from SLAM), while maintaining odom->base_link as an approximately accurate but more importantly continuously varying TF for control and state estimation purposes.

The purpose of this structure is formalised and documented in REP-105

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.