-
Notifications
You must be signed in to change notification settings - Fork 202
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
Unexpected output of _chainAsVector() #749
Comments
Hi, can I work on issue? |
Would be great! Taking a little closer look, the algorithm here does not make a lot of sense to me. At least this line seems fishy: geometry2/tf2/src/buffer_core.cpp Line 1586 in c3cafef
And also this here doesn't seem right to me, how can you find a common parent like this if geometry2/tf2/src/buffer_core.cpp Lines 1607 to 1613 in c3cafef
I recommend rather implementing the way it was done in tf2 for ros1, see here: |
Signed-off-by: Sukhvansh2004 <[email protected]>
So I have made a PR regarding the issues I though on. You can check it out once and lemme know if you think there are some more issues which needs to be addressed. I am also trying to make a test file for this function so as to be sure of its functionality |
I think what you added seems reasonable to me but I don't think it is enough. As mentioned above, this line does not make sense to me currently: geometry2/tf2/src/buffer_core.cpp Line 1586 in c3cafef
Right now, we will only reach the lines of code you edited if the source_time != target_time . What is the reason for that? In my current test example, I am using the same source_time and target_time . That means the function will just output the result from source_frame_chain :geometry2/tf2/src/buffer_core.cpp Lines 1568 to 1571 in c3cafef
But the result from source_frame_chain which is the chain from fixed_frame to source_frame seems already wrong. If I query this on the first example for fixed_frame=A and source_frame=D , I do not get [D, A, B, C] but just [C] .
So maybe the chain returned from geometry2/tf2/src/buffer_core.cpp Lines 469 to 492 in c3cafef
So I guess we have to apply similar changes here first? |
Yeah I think you are right, I'll just check on this. Also can you share the code you're using to debug and check this out so as I can also run and check this at my end too |
Unfortunately, we don't really have a debug environment. The setup we are using is quite complex, in the end we use the python wrapper in tf2_py and query |
So I have fixed a few things now. First in the chainAsVector function the target_id and fixed_id were I think wrongly given for the target_chain so I just swapped and fixed that. Second while adding the target chain back into the source chain we would need to include the last common node too so as to form the connecting link of the chains, so I have added and fixed on that too (similiar fix is done in the walkToTopParent function too. |
Amazing! I think that should do the trick but I think we cannot really test it until it is properly released. Thanks for the work! |
Can you tag a maintainer of this repo who you know so that he can review the PR once and see if more changes are required or not and if not then merge it. |
Bug report / Missing functionality
Required Info:
Explanation
In tf2 for ros1 there existed a function to retrieve the chain of two frames as a list of strings. Now migrating to ros2, we need the functionality of this function. The corresponding function of tf2 for ros2 is here:
geometry2/tf2/src/buffer_core.cpp
Lines 1549 to 1631 in c3cafef
However, it is now not wrapped as a listener function but can only be accessed via the private member function
buffer._chain()
. The bigger problem is that the implementation seems erroneous. Consider this simple tf tree:Querying
_chainAsVector(target_frame=D, source_frame=C, fixed_frame=A)
(regardless of the time), yields the chain['C', 'B']
and not as expected['C', 'B', 'A', 'D']
.Does anyone have an idea why it is like this?
And also why the implementation changed from ros1 tf2 to ros2 tf2 (compare upper links) while the previous implementation worked just fine?
Is there a similar function that I don't know of that can achieve the same thing (python)?
The text was updated successfully, but these errors were encountered: