You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This unexpected tf2 lookup behavior has been stumping me for days on ros2 humble.
I have the following frames:
world
agent0
agent0/lidar0
agent1
agent1/lidar0
... # etc up to agent 2
In this particular example, agent0 is a mobile agent, so the frame agent0 to world is published dynamically at a high rate. All other frames (e.g., agent0/lidar0 to agent0, agent1 to world, agent1/lidar0 to agent1, ...) are static and published on tf_static from a rosbag once at the beginning.
I have several nodes that get the transformations in python via buffer.lookup_transform(). One of the nodes ("node1") looks up all of the agenti/lidar0 to world frames and never has any problems. An example logging output would show, e.g.,
Another one of the nodes ("node2") performs what I believe to be the exact same lookup process. Unfortunately, the output is incorrect. While sometimes the very first lookup call produces the expected output, every subsequent lookup (and sometimes even the first) completely neglects the translation component of the static transforms. Thus, an output from node2's lookups would be:
where everything is the same except that the translation has been neglected to be populated. The quaternion is correct. Agent0 (being dynamic and on /tf) is correct, HOWEVER, I will note that in node2 I sometimes get an extrapolation error for agent0 that does not appear in node1.
In both cases of node1 and node2, I am using MessageFilters to synchronize multiple topics for a callback. It just so happens that node1 is working while node2 is not. It should be known that the output of node1 is one of the synchronized inputs for node2 (i.e. node2 depends on node 1).
I'm at a loss for how to debug this. Has anyone come across this? @tfoote. My code base is large, but if needed I could spend some time trying to recreate in an MWE.
Addendum:
both ros2 run tf2_ros tf2_echo world agent1/lidar0 and ros2 topic echo /tf_static produce the anticipated output
The text was updated successfully, but these errors were encountered:
Unfortunately, the output is incorrect. While sometimes the very first lookup call produces the expected output, every subsequent lookup (and sometimes even the first) completely neglects the translation component of the static transforms.
Inconsistent behaviors like this suggest that there's a different data source, possibly conflicting or a race conditoin? Is there a conflicting static transform in the bag file for world to agent0 perhaps?
All other frames (e.g., agent0/lidar0 to agent0, agent1 to world, agent1/lidar0 to agent1, ...) are static and published on tf_static from a rosbag once at the beginning.
If you're cascadng responses it's doing the same lookup at a later time, which further reinforces the likelyhood that there's a race condition with potentially conflicting data sources being interleaved.
This unexpected tf2 lookup behavior has been stumping me for days on ros2 humble.
I have the following frames:
In this particular example,
agent0
is a mobile agent, so the frameagent0
toworld
is published dynamically at a high rate. All other frames (e.g.,agent0/lidar0
toagent0
,agent1
toworld
,agent1/lidar0
toagent1
, ...) are static and published ontf_static
from a rosbag once at the beginning.I have several nodes that get the transformations in python via
buffer.lookup_transform()
. One of the nodes ("node1") looks up all of theagenti/lidar0
toworld
frames and never has any problems. An example logging output would show, e.g.,Another one of the nodes ("node2") performs what I believe to be the exact same lookup process. Unfortunately, the output is incorrect. While sometimes the very first lookup call produces the expected output, every subsequent lookup (and sometimes even the first) completely neglects the translation component of the static transforms. Thus, an output from node2's lookups would be:
where everything is the same except that the translation has been neglected to be populated. The quaternion is correct. Agent0 (being dynamic and on
/tf
) is correct, HOWEVER, I will note that in node2 I sometimes get an extrapolation error for agent0 that does not appear in node1.In both cases of node1 and node2, I am using
MessageFilters
to synchronize multiple topics for a callback. It just so happens that node1 is working while node2 is not. It should be known that the output of node1 is one of the synchronized inputs for node2 (i.e. node2 depends on node 1).I'm at a loss for how to debug this. Has anyone come across this? @tfoote. My code base is large, but if needed I could spend some time trying to recreate in an MWE.
Addendum:
ros2 run tf2_ros tf2_echo world agent1/lidar0
andros2 topic echo /tf_static
produce the anticipated outputThe text was updated successfully, but these errors were encountered: