Controller Manager recovery from invalid URDF errors#2775
Controller Manager recovery from invalid URDF errors#2775VitezGabriela wants to merge 30 commits intoros-controls:masterfrom
Conversation
|
@VitezGabriela, all pull requests must be targeted towards the |
|
This pull request is in conflict. Could you fix it @VitezGabriela? |
194ed06 to
f5d9c81
Compare
| #include <vector> | ||
|
|
||
| #include "controller_interface/controller_interface_base.hpp" | ||
| #include "controller_manager/controller_manager_parameters.hpp" |
There was a problem hiding this comment.
We should not move this, as it is not related.
There was a problem hiding this comment.
This is a change merged from master branch.
There was a problem hiding this comment.
still an unrelated change
3254bd3 to
0244064
Compare
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #2775 +/- ##
==========================================
- Coverage 89.04% 89.03% -0.02%
==========================================
Files 158 159 +1
Lines 19587 19647 +60
Branches 1589 1595 +6
==========================================
+ Hits 17442 17493 +51
- Misses 1486 1491 +5
- Partials 659 663 +4
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
8a33671 to
ebf2fba
Compare
|
This pull request is in conflict. Could you fix it @VitezGabriela? |
fmauch
left a comment
There was a problem hiding this comment.
I think, the clang and win builds raise a valid error. Also, fixing the Wreorder warnings might be good.
| // TEST_F(ResourceManagerTest, initialization_empty) | ||
| // { | ||
| // ASSERT_ANY_THROW(TestableResourceManager rm(node_, ""); | ||
| // } |
There was a problem hiding this comment.
What should happen with this test, then?
There was a problem hiding this comment.
It is uncommented now and the test passes.
There was a problem hiding this comment.
Please fix the clang errors. Earlier windows build failure is not directly related and will hopefully be fixed with #3204
New windows build failure IS related, please fix
[292](https://github.com/ros-controls/ros2_control/actions/runs/24187185504/job/70594996240?pr=2775#step:19:3293)
D:\a\ros2_control\ros2_control\src\ros-controls\ros2_control\controller_manager\test\test_controllers_chaining_with_controller_manager.cpp(125,40): error C2512: 'rclcpp::NodeOptions': no appropriate default constructor available [D:\a\ros2_control\ros2_control\build\controller_manager\test_controllers_chaining_with_controller_manager.vcxproj]
D:\a\ros2_control\ros2_control\src\ros-controls\ros2_control\controller_manager\test\test_controllers_chaining_with_controller_manager.cpp(125,40):
Constructor for class 'rclcpp::NodeOptions' is declared 'explicit'
christophfroehlich
left a comment
There was a problem hiding this comment.
Builds are fine now, thanks. Some high-level comments from my side below.
There was a problem hiding this comment.
can we add a docstring to the new methods please?
| #include <vector> | ||
|
|
||
| #include "controller_interface/controller_interface_base.hpp" | ||
| #include "controller_manager/controller_manager_parameters.hpp" |
There was a problem hiding this comment.
still an unrelated change
| else | ||
| use_sim_time_ = this->get_parameter("use_sim_time").as_bool(); | ||
|
|
||
| if (!this->has_parameter("overruns.print_warnings")) |
There was a problem hiding this comment.
Shouldn't parameter handling be done via generate_parameter_library? for example
ros2_control/controller_manager/src/controller_manager_parameters.yaml
Lines 261 to 265 in 60a7244
and see params_ below.
I see this existed in initialize_parameters, but why?
Goal:
Update the Controller Manager to handle errors when the ResourceManager fails to initialize due to an invalid URDF or faulty hardware plugin.
Behavior:
Observations:
The Controller Manager now no longer crashes on invalid URDFs. Instead, it safely recovers by initializing the resource_manager_ pointer to a minimal state, allowing the controller manager to continue operating and respond to future valid robot descriptions.
Testing:
Unit tests were created with multiple invalid URDF scenarios. All tests passed successfully. Testing can be done by executing:
./build/controller_manager/test_controller_manager_with_resource_manager