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

test_decorator_speed_controller complains about not finding template specialization (but succeeds) #4388

Closed
tonynajjar opened this issue May 31, 2024 · 8 comments · Fixed by #4607
Assignees

Comments

@tonynajjar
Copy link
Contributor

Just something I saw while testing something else, documenting it

test 25
      Start 25: test_decorator_speed_controller

25: Test command: /usr/bin/python3 "-u" "/opt/ros/rolling/share/ament_cmake_test/cmake/run_test.py" "/opt/overlay_ws/build/nav2_behavior_tree/test_results/nav2_behavior_tree/test_decorator_speed_controller.gtest.xml" "--package-name" "nav2_behavior_tree" "--output-file" "/opt/overlay_ws/build/nav2_behavior_tree/ament_cmake_gtest/test_decorator_speed_controller.txt" "--command" "/opt/overlay_ws/build/nav2_behavior_tree/test/plugins/decorator/test_decorator_speed_controller" "--gtest_output=xml:/opt/overlay_ws/build/nav2_behavior_tree/test_results/nav2_behavior_tree/test_decorator_speed_controller.gtest.xml"
25: Working Directory: /opt/overlay_ws/build/nav2_behavior_tree/test/plugins/decorator
25: Test timeout computed to be: 60
25: -- run_test.py: invoking following command in '/opt/overlay_ws/build/nav2_behavior_tree/test/plugins/decorator':
25:  - /opt/overlay_ws/build/nav2_behavior_tree/test/plugins/decorator/test_decorator_speed_controller --gtest_output=xml:/opt/overlay_ws/build/nav2_behavior_tree/test_results/nav2_behavior_tree/test_decorator_speed_controller.gtest.xml
25: [==========] Running 1 test from 1 test suite.
25: [----------] Global test environment set-up.
25: [----------] 1 test from SpeedControllerTestFixture
25: [WARN] [1717182653.469035623] []: Invalid frame ID "map" passed to canTransform argument target_frame - frame does not exist
25: [INFO] [1717182653.569213885] [test_behavior_tree_fixture]: Transforms are available now!
25: [ RUN      ] SpeedControllerTestFixture.test_behavior
25: You (maybe indirectly) called BT::convertFromString() for type [std::vector<geometry_msgs::msg::PoseStamped_<std::allocator<void> >, std::allocator<geometry_msgs::msg::PoseStamped_<std::allocator<void> > > >], but I can't find the template specialization.
25: 
25: You (maybe indirectly) called BT::convertFromString() for type [std::vector<geometry_msgs::msg::PoseStamped_<std::allocator<void> >, std::allocator<geometry_msgs::msg::PoseStamped_<std::allocator<void> > > >], but I can't find the template specialization.
25: 
25: You (maybe indirectly) called BT::convertFromString() for type [std::vector<geometry_msgs::msg::PoseStamped_<std::allocator<void> >, std::allocator<geometry_msgs::msg::PoseStamped_<std::allocator<void> > > >], but I can't find the template specialization.
25: 
25: You (maybe indirectly) called BT::convertFromString() for type [std::vector<geometry_msgs::msg::PoseStamped_<std::allocator<void> >, std::allocator<geometry_msgs::msg::PoseStamped_<std::allocator<void> > > >], but I can't find the template specialization.
25: 
25: You (maybe indirectly) called BT::convertFromString() for type [std::vector<geometry_msgs::msg::PoseStamped_<std::allocator<void> >, std::allocator<geometry_msgs::msg::PoseStamped_<std::allocator<void> > > >], but I can't find the template specialization.
25: 
25: You (maybe indirectly) called BT::convertFromString() for type [std::vector<geometry_msgs::msg::PoseStamped_<std::allocator<void> >, std::allocator<geometry_msgs::msg::PoseStamped_<std::allocator<void> > > >], but I can't find the template specialization.
25: 
25: You (maybe indirectly) called BT::convertFromString() for type [std::vector<geometry_msgs::msg::PoseStamped_<std::allocator<void> >, std::allocator<geometry_msgs::msg::PoseStamped_<std::allocator<void> > > >], but I can't find the template specialization.
25: 
25: You (maybe indirectly) called BT::convertFromString() for type [std::vector<geometry_msgs::msg::PoseStamped_<std::allocator<void> >, std::allocator<geometry_msgs::msg::PoseStamped_<std::allocator<void> > > >], but I can't find the template specialization.
25: 
25: You (maybe indirectly) called BT::convertFromString() for type [std::vector<geometry_msgs::msg::PoseStamped_<std::allocator<void> >, std::allocator<geometry_msgs::msg::PoseStamped_<std::allocator<void> > > >], but I can't find the template specialization.
25: 
25: You (maybe indirectly) called BT::convertFromString() for type [std::vector<geometry_msgs::msg::PoseStamped_<std::allocator<void> >, std::allocator<geometry_msgs::msg::PoseStamped_<std::allocator<void> > > >], but I can't find the template specialization.
25: 
25: You (maybe indirectly) called BT::convertFromString() for type [std::vector<geometry_msgs::msg::PoseStamped_<std::allocator<void> >, std::allocator<geometry_msgs::msg::PoseStamped_<std::allocator<void> > > >], but I can't find the template specialization.
25: 
25: You (maybe indirectly) called BT::convertFromString() for type [std::vector<geometry_msgs::msg::PoseStamped_<std::allocator<void> >, std::allocator<geometry_msgs::msg::PoseStamped_<std::allocator<void> > > >], but I can't find the template specialization.
25: 
25: You (maybe indirectly) called BT::convertFromString() for type [std::vector<geometry_msgs::msg::PoseStamped_<std::allocator<void> >, std::allocator<geometry_msgs::msg::PoseStamped_<std::allocator<void> > > >], but I can't find the template specialization.
25: 
25: You (maybe indirectly) called BT::convertFromString() for type [std::vector<geometry_msgs::msg::PoseStamped_<std::allocator<void> >, std::allocator<geometry_msgs::msg::PoseStamped_<std::allocator<void> > > >], but I can't find the template specialization.
25: 
25: You (maybe indirectly) called BT::convertFromString() for type [std::vector<geometry_msgs::msg::PoseStamped_<std::allocator<void> >, std::allocator<geometry_msgs::msg::PoseStamped_<std::allocator<void> > > >], but I can't find the template specialization.
25: 
25: You (maybe indirectly) called BT::convertFromString() for type [std::vector<geometry_msgs::msg::PoseStamped_<std::allocator<void> >, std::allocator<geometry_msgs::msg::PoseStamped_<std::allocator<void> > > >], but I can't find the template specialization.
25: 
25: [       OK ] SpeedControllerTestFixture.test_behavior (13006 ms)
25: [----------] 1 test from SpeedControllerTestFixture (13006 ms total)
25: 
25: [----------] Global test environment tear-down
25: [==========] 1 test from 1 test suite ran. (13121 ms total)
25: [  PASSED  ] 1 test.
25: -- run_test.py: return code 0                  
25: -- run_test.py: inject classname prefix into gtest result file '/opt/overlay_ws/build/nav2_behavior_tree/test_results/nav2_behavior_tree/test_decorator_speed_controller.gtest.xml'
25: -- run_test.py: verify result file '/opt/overlay_ws/build/nav2_behavior_tree/test_results/nav2_behavior_tree/test_decorator_speed_controller.gtest.xml'
25/61 Test #25: test_decorator_speed_controller ........................   Passed   13.29 sec
@SteveMacenski
Copy link
Member

I haven't seen this!

@tonynajjar
Copy link
Contributor Author

tonynajjar commented May 31, 2024

I guess it's missing inline std::vector<geometry_msgs::msg::PoseStamped> convertFromString(const StringView key) in bt_utils.hpp. Not sure how we want to handle parsing a vector from a string, add another delimiter like - to differentiate between the PoseStamped? Or no new delimiter and just assume that every 9 elements are for a PoseStamped?

@tonynajjar
Copy link
Contributor Author

tonynajjar commented May 31, 2024

I guess it's missing inline std::vector<geometry_msgs::msg::PoseStamped> convertFromString(const StringView key) in bt_utils.hpp. Not sure how we want to handle parsing a vector from a string, add another delimiter like - to differentiate between the PoseStamped? Or no new delimiter and just assume that every 9 elements are for a PoseStamped?

While adding a inline std::vector<geometry_msgs::msg::PoseStamped> convertFromString(const StringView key) function does solve the issue, I think that's a fake solution. getInput should be able to handle custom classes afaik. It looks like only an issue with BT::getInputOrBlackboard. In fact I see the issue both with test_decorator_speed_controller, test_goal_updated_controller and test_condition_globally_updated_goal which all use this function/macro.

@facontidavide can we borrow your support here?

@SteveMacenski
Copy link
Member

@facontidavide do you have any thoughts on this?

@facontidavide
Copy link
Contributor

getInput should be able to handle custom classes afaik

No, it is not supposed to work magically, I am sorry

@SteveMacenski
Copy link
Member

I'm not entirely following the conversation here, @tonynajjar what's the ask for Davide on this or what we need to do in Nav2 so we can close this out?

@facontidavide
Copy link
Contributor

While adding a inline std::vector<geometry_msgs::msg::PoseStamped> convertFromString(const StringView key) function does solve the issue, I think that's a fake solution.

No, this IS THE SOLUTION

getInput should be able to handle custom classes afaik.

No, it should not, unless you did implement the template specialization of convertFromString

@SteveMacenski
Copy link
Member

@tonynajjar can you submit your template specialization for the PoseStamped vector?

@SteveMacenski SteveMacenski linked a pull request Aug 8, 2024 that will close this issue
7 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants