Skip to content

[Feature Proposal] Add map to odom TF publishing capability#62

Merged
rsasaki0109 merged 4 commits intorsasaki0109:mainfrom
abudori3939:main
Jul 9, 2025
Merged

[Feature Proposal] Add map to odom TF publishing capability#62
rsasaki0109 merged 4 commits intorsasaki0109:mainfrom
abudori3939:main

Conversation

@abudori3939
Copy link
Contributor

Overview

This pull request adds the capability to publish the map->odom transform, complementing the existing map->base_link transform.

A new parameter, enable_map_odom_tf, has been added to param/localization.yaml. Setting this to true enables the new behavior. When false (the default), the node maintains its original behavior of publishing the map->base_link transform.

This feature allows for easier integration with standard ROS robot configurations that publish an odom->base_link transform (e.g., from wheel odometry), enabling a complete map->odom->base_link TF chain.

Implementation Details

The map->odom transform is calculated based on the following formula:
Transform(map→odom) = Transform(map→base_link) × Transform(odom→base_link)⁻¹

The process is as follows:

  1. The map->base_link pose is estimated via NDT/GICP.
  2. The odom->base_link transform is looked up from the TF tree.
  3. The final map->odom transform is calculated from these two transforms and published.

Verification

I verified this feature using a robot that publishes wheel odometry (odom->base_footprint).

1. Original Behavior (enable_map_odom_tf: false)

With an existing odom->base_footprint transform, the map->base_link transform published by this node is not used, resulting in a disconnected TF tree.

image (1)

2. New Behavior (enable_map_odom_tf: true)

With this feature enabled, the node publishes the map->odom transform, correctly forming a single, continuous TF chain: map->odom->base_footprint->base_link. This allows the localization result to coexist properly with the robot's odometry.

image (2)

Notes

If you believe this feature would be beneficial to the project, I would appreciate your review and merge.

@rsasaki0109 rsasaki0109 self-requested a review July 8, 2025 03:51
@rsasaki0109 rsasaki0109 self-assigned this Jul 8, 2025
@rsasaki0109
Copy link
Owner

Thanks for the PR. I’ll check it later, hopefully one evening this week.

@rsasaki0109
Copy link
Owner

rsasaki0109 commented Jul 9, 2025

ref

オドメトリフレーム(/odom)とは何か
https://qiita.com/NaokiAkai/items/08deb338956c8da83aa9

@rsasaki0109
Copy link
Owner

Thank you. Everything looks good, so I’ve merged it. Great PR — thanks a lot!

@rsasaki0109 rsasaki0109 merged commit 7d05d57 into rsasaki0109:main Jul 9, 2025
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants