Skip to content

Conversation

@caio-freitas
Copy link

@caio-freitas caio-freitas commented Nov 18, 2025

Fix #713

  • Uncommented test case with "bad_robot" as robot description from test suite in test_admittance_controller.cpp.
  • Updated the on_init on test_admittance_controller.hpp to only override the robot description with the one defined in the ros2_control_test_assets if not already defined.
  • On the initialization of the admittance controller, verified if the robot description is a valid xml, similar to what's done in ros2_control/hardware_interface/src/component_parser.cpp (here)

Copy link
Member

@christophfroehlich christophfroehlich left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for taking this. I have some doubts if this is tested properly, see the comments

@christophfroehlich
Copy link
Member

Thinking again, is there really a need to check this inside the controller? The controller manager will not start with a broken urdf, right @saikishor ?

Copy link
Member

@saikishor saikishor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree with @christophfroehlich that this is not needed as CM provides a valid one.

Can you explain to us, why did you have a need to do this?

@christophfroehlich
Copy link
Member

see the linked issue, but this was before we passed the robot description from the cm to the controllers. sorry for not checking that earlier. @caio-freitas would you mind in reverting this and cleanup the tests as by my comments instead?

Copy link
Member

@christophfroehlich christophfroehlich left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please fix the failing pre-commit tests: install it locally with pre-commit install, and run pre-commit run --all now to fix.

@codecov
Copy link

codecov bot commented Nov 28, 2025

Codecov Report

❌ Patch coverage is 57.14286% with 6 lines in your changes missing coverage. Please review.
✅ Project coverage is 85.41%. Comparing base (d71538a) to head (8c08f8c).
⚠️ Report is 11 commits behind head on master.

Files with missing lines Patch % Lines
...dmittance_controller/src/admittance_controller.cpp 44.44% 4 Missing and 1 partial ⚠️
...nce_controller/test/test_admittance_controller.hpp 80.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2009      +/-   ##
==========================================
+ Coverage   85.32%   85.41%   +0.09%     
==========================================
  Files         143      143              
  Lines       13936    13674     -262     
  Branches     1201     1191      -10     
==========================================
- Hits        11891    11680     -211     
+ Misses       1638     1591      -47     
+ Partials      407      403       -4     
Flag Coverage Δ
unittests 85.41% <57.14%> (+0.09%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
...nce_controller/test/test_admittance_controller.cpp 100.00% <ø> (ø)
...nce_controller/test/test_admittance_controller.hpp 94.65% <80.00%> (-0.46%) ⬇️
...dmittance_controller/src/admittance_controller.cpp 73.61% <44.44%> (-0.95%) ⬇️

... and 7 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Member

@christophfroehlich christophfroehlich left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the compatibility build fails, please review

tf2_geometry_msgs
tf2_kdl
tf2_ros
tinyxml2
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

   --- stderr: admittance_controller
  CMake Error at CMakeLists.txt:33 (find_package):
    By not providing "Findtinyxml2.cmake" in CMAKE_MODULE_PATH this project has
    asked CMake to find a package configuration file provided by "tinyxml2",
    but CMake did not find one.
  
    Could not find a package configuration file provided by "tinyxml2" with any
    of the following names:
  
      tinyxml2Config.cmake
      tinyxml2-config.cmake
  
    Add the installation prefix of "tinyxml2" to CMAKE_PREFIX_PATH or set
    "tinyxml2_DIR" to a directory containing one of the above files.  If
    "tinyxml2" provides a separate development package or SDK, be sure it has
    been installed.
  
  
  ---

But it works here
https://github.com/ros-controls/ros2_control/blob/master/hardware_interface/CMakeLists.txt#L16
with the capitalized version

Suggested change
tinyxml2
TinyXML2

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And please add to target_link_libraries below:

                  ${TinyXML2_LIBRARIES}

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

Successfully merging this pull request may close these issues.

admittance_controller should fail with invalid robot_description

4 participants