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

fix multiple system unconfigured rise cleanup #1175

Conversation

anscipione
Copy link
Contributor

@anscipione anscipione force-pushed the fix_multiple_cleanup_on_unconfigured_components branch from 636616e to 59b72d1 Compare December 1, 2023 08:57
@destogl
Copy link
Member

destogl commented Dec 4, 2023

Hi @anscipione, thanks for your PR and reporting the issue. Have you checked the test locally? This change breaks the tests.

I have a proposal to make the change more readable. Please add these lines at the very beginning of the methods.

if (impl_->get_state().id() == lifecycle_msgs::msg::State::PRIMARY_STATE_UNCONFIGURED)
{
  return return_type::OK;
}

And we should update the tests too.

@anscipione anscipione force-pushed the fix_multiple_cleanup_on_unconfigured_components branch from 59b72d1 to deb4753 Compare December 12, 2023 22:05
  - fix system components
  - fix other components
@anscipione anscipione force-pushed the fix_multiple_cleanup_on_unconfigured_components branch from b47e71a to 63b725d Compare December 12, 2023 22:17
@anscipione
Copy link
Contributor Author

Hi @anscipione, thanks for your PR and reporting the issue. Have you checked the test locally? This change breaks the tests.

I have a proposal to make the change more readable. Please add these lines at the very beginning of the methods.

if (impl_->get_state().id() == lifecycle_msgs::msg::State::PRIMARY_STATE_UNCONFIGURED)
{
  return return_type::OK;
}

And we should update the tests too.

I applied the suggested change.
I also fixed the tests, but I would prefer you to check them.

destogl
destogl previously approved these changes Dec 14, 2023
@destogl destogl linked an issue Dec 14, 2023 that may be closed by this pull request
Copy link

codecov bot commented Dec 14, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (64c9e2a) 47.89% compared to head (7f39020) 47.93%.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1175      +/-   ##
==========================================
+ Coverage   47.89%   47.93%   +0.03%     
==========================================
  Files          41       41              
  Lines        3451     3461      +10     
  Branches     1876     1881       +5     
==========================================
+ Hits         1653     1659       +6     
- Misses        444      446       +2     
- Partials     1354     1356       +2     
Flag Coverage Δ
unittests 47.93% <100.00%> (+0.03%) ⬆️

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

Files Coverage Δ
hardware_interface/src/actuator.cpp 58.77% <100.00%> (+1.49%) ⬆️
hardware_interface/src/sensor.cpp 49.48% <100.00%> (-1.05%) ⬇️
hardware_interface/src/system.cpp 58.77% <100.00%> (+1.49%) ⬆️

... and 1 file with indirect coverage changes

@anscipione anscipione force-pushed the fix_multiple_cleanup_on_unconfigured_components branch from 7f8af64 to 5184402 Compare December 14, 2023 20:40
hardware_interface/src/actuator.cpp Outdated Show resolved Hide resolved
hardware_interface/src/actuator.cpp Outdated Show resolved Hide resolved
hardware_interface/src/actuator.cpp Outdated Show resolved Hide resolved
hardware_interface/src/actuator.cpp Outdated Show resolved Hide resolved
@@ -197,6 +197,11 @@ return_type Sensor::read(const rclcpp::Time & time, const rclcpp::Duration & per
{
// TODO(destogl): discuss what should be default return value, e.g., "NOT_EXECUTED"
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
// TODO(destogl): discuss what should be default return value, e.g., "NOT_EXECUTED"
if (impl_->get_state().id() == lifecycle_msgs::msg::State::PRIMARY_STATE_UNCONFIGURED)
{
return return_type::OK;
}

Comment on lines +200 to +204
if (impl_->get_state().id() == lifecycle_msgs::msg::State::PRIMARY_STATE_UNCONFIGURED)
{
return return_type::OK;
}

Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
if (impl_->get_state().id() == lifecycle_msgs::msg::State::PRIMARY_STATE_UNCONFIGURED)
{
return return_type::OK;
}

@@ -216,6 +216,11 @@ return_type System::read(const rclcpp::Time & time, const rclcpp::Duration & per
{
// TODO(destogl): discuss what should be default return value, e.g., "NOT_EXECUTED"
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
// TODO(destogl): discuss what should be default return value, e.g., "NOT_EXECUTED"
if (impl_->get_state().id() == lifecycle_msgs::msg::State::PRIMARY_STATE_UNCONFIGURED)
{
return return_type::OK;
}

Comment on lines +219 to +223
if (impl_->get_state().id() == lifecycle_msgs::msg::State::PRIMARY_STATE_UNCONFIGURED)
{
return return_type::OK;
}

Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
if (impl_->get_state().id() == lifecycle_msgs::msg::State::PRIMARY_STATE_UNCONFIGURED)
{
return return_type::OK;
}

@@ -233,6 +238,11 @@ return_type System::write(const rclcpp::Time & time, const rclcpp::Duration & pe
{
// TODO(destogl): discuss what should be default return value, e.g., "NOT_EXECUTED"
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
// TODO(destogl): discuss what should be default return value, e.g., "NOT_EXECUTED"
if (impl_->get_state().id() == lifecycle_msgs::msg::State::PRIMARY_STATE_UNCONFIGURED)
{
return return_type::OK;
}

Comment on lines +241 to +245
if (impl_->get_state().id() == lifecycle_msgs::msg::State::PRIMARY_STATE_UNCONFIGURED)
{
return return_type::OK;
}

Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
if (impl_->get_state().id() == lifecycle_msgs::msg::State::PRIMARY_STATE_UNCONFIGURED)
{
return return_type::OK;
}

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.

We have to move these methods as in the proposals. I cannot merge those directly, unfortunately.

destogl added a commit to SchillingRobotics/ros2_control that referenced this pull request Dec 18, 2023
@saikishor
Copy link
Member

Hello @anscipione!

Do you have time to address the comments of @destogl? or shall i take over and fix it in a different PR?. Right now, I ended up doing the same without knowing about this PR

Thank you,

@anscipione
Copy link
Contributor Author

I'll fix asap.

@destogl
Copy link
Member

destogl commented Jan 8, 2024

I couldn't introduce changes to this, so opened a follow-up #1279

@destogl destogl closed this Jan 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants