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

tf lookup timing issues in AmclNode::handleInitialPoseMessage // ("Failed to transform initial pose in time") #424

Closed
stwirth opened this issue Feb 22, 2016 · 2 comments

Comments

@stwirth
Copy link
Contributor

stwirth commented Feb 22, 2016

In AmclNode::handleInitialPoseMessage (see here), the tf lookup uses ros::Time::now() to get the robot motion since the initial pose's time stamp.
Within this function, tf2::BufferCore::lookupTransform(base_frame_id_, global_frame_id_, ros::Time::now()) is called. That last call fails often if the odometry update rate is low as it needs to have updated the tf from global_frame_id_ to base_frame_id_ since the call to ros::Time::now() to succeed.

As a solution I would propose to add a waitForTransform() before the lookup call.

@stwirth
Copy link
Contributor Author

stwirth commented Feb 22, 2016

Additionally, I think the lookup should use odom_frame_id_ as "fixed frame" argument to get the relative motion.

@stwirth
Copy link
Contributor Author

stwirth commented Feb 22, 2016

After working on this a little I think this multiplication is the wrong way around. tx_odom is the delta the robot moved between the stamp of the incoming intial pose message and ros::Time::now(). It should be multiplied with pose_old from the right.

stwirth added a commit to stwirth/navigation that referenced this issue Feb 24, 2016
message.

Modifies the set_pose.py script to be able to send an initial pose with
a user defined time stamp at a user defined time. Adds a rostest to
exercise this new option.
This reveals the issues mentioned in ros-planning#424 (the new test fails).
stwirth added a commit to stwirth/navigation that referenced this issue Feb 24, 2016
…ng#424).

The tf lookup as it was before this change was very likely to fail as
ros::Time::now() was used to look up a tf without waiting on the tf's
availability. Additionally, the computation of the "new pose" by
multiplying the delta that the robot moved from the initialpose's
timestamp to ros::Time::now() was wrong. That delta has to by multiplied
from the right to the "old pose".
This commit also changes the reference frame to look up this delta to be
the odom frame as this one is supposed to be smooth and therefore the
best reference to get relative robot motion in the robot (base link) frame.
stwirth added a commit to stwirth/navigation that referenced this issue Feb 24, 2016
…age.

Modifies the set_pose.py script to be able to send an initial pose with
a user defined time stamp at a user defined time. Adds a rostest to
exercise this new option.
This reveals the issues mentioned in ros-planning#424 (the new test fails).
stwirth added a commit to stwirth/navigation that referenced this issue Feb 24, 2016
…ng#424).

The tf lookup as it was before this change was very likely to fail as
ros::Time::now() was used to look up a tf without waiting on the tf's
availability. Additionally, the computation of the "new pose" by
multiplying the delta that the robot moved from the initialpose's
timestamp to ros::Time::now() was wrong. That delta has to by multiplied
from the right to the "old pose".
This commit also changes the reference frame to look up this delta to be
the odom frame as this one is supposed to be smooth and therefore the
best reference to get relative robot motion in the robot (base link) frame.
stwirth added a commit to stwirth/navigation that referenced this issue Feb 24, 2016
…age.

Modifies the set_pose.py script to be able to send an initial pose with
a user defined time stamp at a user defined time. Adds a rostest to
exercise this new option.
This reveals the issues mentioned in ros-planning#424 (the new test fails).
stwirth added a commit to stwirth/navigation that referenced this issue Feb 24, 2016
…ng#424).

The tf lookup as it was before this change was very likely to fail as
ros::Time::now() was used to look up a tf without waiting on the tf's
availability. Additionally, the computation of the "new pose" by
multiplying the delta that the robot moved from the initialpose's
timestamp to ros::Time::now() was wrong. That delta has to by multiplied
from the right to the "old pose".
This commit also changes the reference frame to look up this delta to be
the odom frame as this one is supposed to be smooth and therefore the
best reference to get relative robot motion in the robot (base link) frame.
mikeferguson added a commit that referenced this issue Feb 26, 2016
Fixes #424 for indigo: New test and fix for proper interpretation of a delayed initial pose.
c-andy-martin pushed a commit to BadgerTechnologies/navigation that referenced this issue May 15, 2019
…age.

Modifies the set_pose.py script to be able to send an initial pose with
a user defined time stamp at a user defined time. Adds a rostest to
exercise this new option.
This reveals the issues mentioned in ros-planning#424 (the new test fails).
c-andy-martin pushed a commit to BadgerTechnologies/navigation that referenced this issue May 15, 2019
…ng#424).

The tf lookup as it was before this change was very likely to fail as
ros::Time::now() was used to look up a tf without waiting on the tf's
availability. Additionally, the computation of the "new pose" by
multiplying the delta that the robot moved from the initialpose's
timestamp to ros::Time::now() was wrong. That delta has to by multiplied
from the right to the "old pose".
This commit also changes the reference frame to look up this delta to be
the odom frame as this one is supposed to be smooth and therefore the
best reference to get relative robot motion in the robot (base link) frame.
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

1 participant