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

Allow empty urdf tag #1017

Merged
merged 5 commits into from
May 19, 2023
Merged

Conversation

fmauch
Copy link
Contributor

@fmauch fmauch commented May 11, 2023

This is #1008 with updated tests.

{
const std::string broken_urdf_string =
std::string(ros2_control_test_assets::urdf_head) +
ros2_control_test_assets::invalid_urdf_ros2_control_parameter_empty +
ros2_control_test_assets::urdf_tail;

ASSERT_THROW(parse_control_resources_from_urdf(broken_urdf_string), std::runtime_error);
ASSERT_NO_THROW(parse_control_resources_from_urdf(broken_urdf_string));
Copy link
Member

Choose a reason for hiding this comment

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

While this may be technically correct. I don't think we should do it. We need a new test explicitly to make sure that empty tags as here are permitted but not a fully broken urdf as per the tests suggests

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for the feedback, absolutely valid point. I replaced the test with a more consistent one in 4c02c65.

fmauch and others added 3 commits May 15, 2023 11:10
This replaces the test that checks that empty parameter tags work and actually
checks the parsed urdf.
Copy link
Member

@destogl destogl left a comment

Choose a reason for hiding this comment

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

Thanks!!

@destogl destogl enabled auto-merge (squash) May 17, 2023 00:46
@codecov-commenter
Copy link

Codecov Report

Merging #1017 (9a3b0cf) into master (925f5f3) will decrease coverage by 1.97%.
The diff coverage is 35.59%.

❗ Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more.

@@            Coverage Diff             @@
##           master    #1017      +/-   ##
==========================================
- Coverage   34.61%   32.65%   -1.97%     
==========================================
  Files          52       91      +39     
  Lines        2981     9566    +6585     
  Branches     1855     6445    +4590     
==========================================
+ Hits         1032     3124    +2092     
- Misses        310      704     +394     
- Partials     1639     5738    +4099     
Flag Coverage Δ
unittests 32.65% <35.59%> (-1.97%) ⬇️

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

Impacted Files Coverage Δ
controller_manager/src/controller_manager.cpp 38.27% <ø> (-1.44%) ⬇️
controller_manager/src/ros2_control_node.cpp 0.00% <0.00%> (ø)
..._interface/include/hardware_interface/actuator.hpp 100.00% <ø> (ø)
...re_interface/include/hardware_interface/sensor.hpp 100.00% <ø> (ø)
...re_interface/include/hardware_interface/system.hpp 100.00% <ø> (ø)
hardware_interface/src/resource_manager.cpp 49.91% <ø> (-3.72%) ⬇️
hardware_interface/src/sensor.cpp 50.52% <ø> (ø)
hardware_interface/src/system.cpp 55.45% <ø> (ø)
...rface/test/mock_components/test_generic_system.cpp 9.14% <ø> (ø)
...dware_interface/test/test_component_interfaces.cpp 32.44% <ø> (+4.25%) ⬆️
... and 68 more

... and 19 files with indirect coverage changes

@destogl destogl merged commit 7c07430 into ros-controls:master May 19, 2023
1 check passed
@bmagyar
Copy link
Member

bmagyar commented May 19, 2023

@Mergifyio backport humble

@mergify
Copy link
Contributor

mergify bot commented May 19, 2023

backport humble

✅ Backports have been created

mergify bot pushed a commit that referenced this pull request May 19, 2023
* Do not explode with empty tag
* Update tests to allow empty URDF parameter to hardware interface
* Test checks that empty parameter tags work and actually checks the parsed urdf.

---------

Co-authored-by: Bence Magyar <[email protected]>
Co-authored-by: Dr. Denis <[email protected]>
(cherry picked from commit 7c07430)

# Conflicts:
#	hardware_interface/src/component_parser.cpp
@fmauch fmauch deleted the allow_empty_urdf_tag branch May 22, 2023 09:07
fmauch added a commit to fmauch/ros2_control that referenced this pull request May 28, 2023
* Do not explode with empty tag
* Update tests to allow empty URDF parameter to hardware interface
* Test checks that empty parameter tags work and actually checks the parsed urdf.

---------

Co-authored-by: Bence Magyar <[email protected]>
Co-authored-by: Dr. Denis <[email protected]>
(cherry picked from commit 7c07430)

# Conflicts:
#	hardware_interface/src/component_parser.cpp
fmauch added a commit to fmauch/ros2_control that referenced this pull request May 28, 2023
* Do not explode with empty tag
* Update tests to allow empty URDF parameter to hardware interface
* Test checks that empty parameter tags work and actually checks the parsed urdf.

---------

Co-authored-by: Bence Magyar <[email protected]>
Co-authored-by: Dr. Denis <[email protected]>
(cherry picked from commit 7c07430)

# Conflicts:
#	hardware_interface/src/component_parser.cpp
destogl pushed a commit that referenced this pull request May 30, 2023
* [URDF Parser] Allow empty urdf tag, e.g., parameter (#1017)

* Do not explode with empty tag
* Update tests to allow empty URDF parameter to hardware interface
* Test checks that empty parameter tags work and actually checks the parsed urdf.
* Patch test updates for humble API

---------

Co-authored-by: Bence Magyar <[email protected]>
Co-authored-by: Dr. Denis <[email protected]>
(cherry picked from commit 7c07430)
flochre pushed a commit to flochre/ros2_control that referenced this pull request Jul 5, 2023
)

* [URDF Parser] Allow empty urdf tag, e.g., parameter (ros-controls#1017)

* Do not explode with empty tag
* Update tests to allow empty URDF parameter to hardware interface
* Test checks that empty parameter tags work and actually checks the parsed urdf.
* Patch test updates for humble API

---------

Co-authored-by: Bence Magyar <[email protected]>
Co-authored-by: Dr. Denis <[email protected]>
(cherry picked from commit 7c07430)
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.

4 participants