-
Notifications
You must be signed in to change notification settings - Fork 407
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
KDL::ChainFkSolverPos_recursive incorrectly returning error #320
Comments
Could you provide an example? |
Sure, I have an example I have run that produces the same error. |
@khoshrav This uses a |
I have checked |
@MatthijsBurgh Sorry about that. Yeah, I am also very surprised at the error being thrown, especially since the values of the variables are exactly identical. |
Thanks for the package. When I run your rest unmodified, I also get a size mismatch, but I get zero joints in the chain.
I checked with GDB and indeed the chain is empty. I changed every chain variable to a So I think your issue is caused by bad management of variables etc. |
Oh wow, thanks! In either case, I am willing to close this issue (although I am still unsure about why it is occuring) |
I does work with references too, but in your example, you created a new copy in classA. Both the argument of the constructor was just a plain class as the member variable. Right now I do get the same error as you, both of size 3, but with the size mismatch error. In GDB in QtCreator, the expression evaluation of When only changing the argument of the constructor of classA to a reference, it already works correctly. |
No activity |
I have a similar issue using the python bindings after upgrading ros:foxy to ros:humble.
The output:
The relevant KDL C++ code:
@MatthijsBurgh any ideas what might it be? |
@bbk-riact I suggest you start with a very simple cpp example. Run it in debug mode and step through it. So you can check the variables etc. It is also giving me a hint of memory issues. Which results in reading the wrong values. |
I think what has happened in both the examples here is the because the class Perhaps this issue can be closed with a PR to the docs on the constructors of these classes reminding the user that its their responsibility to ensure the lifetime of |
When @aaron-riact would be correct, the problem would be solved if you save the chain before forwarding it to the solver. So @bbk-riact please test with assigning the chain to a separate variable first, which you pass on as argument to the solver. |
Hi,
I updated from ROS Indigo running ros-indigo-orocos-kdl 1.3.1 to ROS Melodic running ros-melodic-orocos-kdl 1.4.0.
Something that works fine (KDL::ChainFkSolverPos_recursive.JntToCart ) in Indigo now returns an error
The size of the input does not match the internal state
Based on the documentation this occurs when
q_in.rows()!=chain.getNrOfJoints()
However, when I print the rows of the input and the number of joints of the chain they are the same. Even an
==
operator on them yields true.This issue was repeated on multiple machines with the same ROS/KDL setup and does not occur in Indigo.
The text was updated successfully, but these errors were encountered: