Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect information in comment #842

Open
AlexanderDavid opened this issue Nov 12, 2023 · 1 comment
Open

Incorrect information in comment #842

AlexanderDavid opened this issue Nov 12, 2023 · 1 comment

Comments

@AlexanderDavid
Copy link

I think there's some confusion surrounding the different "modes" that the localization node can run in. This comment lists that if world_frame == odom_frame then the map_frame -> odom_frame will be published, otherwise the odom_frame -> base_link_frame will be published

https://github.com/cra-ros-pkg/robot_localization/blob/040dd17034d2fae55f99cc6d93598aeeb8b97b47/src/ros_filter.cpp#L825C1-L830C46

/*
  ...
  * The state estimation nodes in robot_localization therefore have two "modes."
  * If your world_frame parameter value matches the odom_frame parameter value,
  * then robot_localization will assume someone else is broadcasting a transform
  * from odom_frame->base_link_frame, and it will compute the
  * map_frame->odom_frame transform. Otherwise, it will simply compute the
  * odom_frame->base_link_frame transform.
  * /

However, this code seems to say the opposite since the filteredPosition's frame_id is set to the world_frame.

https://github.com/cra-ros-pkg/robot_localization/blob/noetic-devel/src/ros_filter.cpp#L1999C1-L2047C12

if (invertTransform_ || filteredPosition.header.frame_id == odomFrameId_)
{
  worldTransformBroadcaster_.sendTransform(
    invertTransform_ ? RosFilterUtilities::invertTF(worldBaseLinkTransMsg_) : worldBaseLinkTransMsg_);
}
else if (filteredPosition.header.frame_id == mapFrameId_)
{
  ...
    worldTransformBroadcaster_.sendTransform(mapOdomTransMsg);
}

I think the larger issue here is that the documentation lacks a nuanced explanation of what the various modes actually end up publishing and what the expected setup of the TF tree should be.

https://docs.ros.org/en/noetic/api/robot_localization/html/state_estimation_nodes.html#frame

@ayrton04
Copy link
Collaborator

You are correct. That comment is erroneous. Feel free to submit a PR.

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

No branches or pull requests

2 participants