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

[ControllerManager] Fix all warnings from the latets features. #1174

Merged
merged 3 commits into from
Nov 24, 2023

Conversation

destogl
Copy link
Member

@destogl destogl commented Nov 21, 2023

I have fixed following warnings:

src/ros2_control/controller_manager/src/controller_manager.cpp:2509:35: warning: conversion from ‘std::__iterator_traits<__gnu_cxx::__normal_iterator<const controller_manager::ControllerSpec*, std::vector<controller_manager::ControllerSpec> >, void>::difference_type’ {aka ‘long int’} to ‘int’ may change value [-Wconversion]
2509 |           int dist = std::distance(controllers.begin(), it);
src/ros2_control/controller_manager/test/test_controller_failed_init/test_controller_failed_init.cpp:36:16: warning: unused parameter ‘cm_update_rate’ [-Wunused-parameter]
36 |   unsigned int cm_update_rate, const std::string & /*namespace_*/,
src/ros2_control/controller_manager/test/test_controller_manager.cpp:486:33: warning: conversion from ‘long unsigned int’ to ‘double’ may change value [-Wconversion]
486 |         (controller_update_rate * no_of_secs_passed), 1);
src/ros2_control/controller_manager/test/test_controller_manager_srvs.cpp:816:25: warning: conversion from ‘std::__iterator_traits<__gnu_cxx::__normal_iterator<controller_manager_msgs::msg::ControllerState_<std::allocator<void> >*, std::vector<controller_manager_msgs::msg::ControllerState_<std::allocator<void> >, std::allocator<controller_manager_msgs::msg::ControllerState_<std::allocator<void> > > > >, void>::difference_type’ {aka ‘long int’} to ‘int’ may change value [-Wconversion]
816 |     return std::distance(result->controller.begin(), it);
src/ros2_control/controller_manager/test/test_controller_manager_srvs.cpp:1025:25: warning: conversion from ‘std::__iterator_traits<__gnu_cxx::__normal_iterator<controller_manager_msgs::msg::ControllerState_<std::allocator<void> >*, std::vector<controller_manager_msgs::msg::ControllerState_<std::allocator<void> >, std::allocator<controller_manager_msgs::msg::ControllerState_<std::allocator<void> > > > >, void>::difference_type’ {aka ‘long int’} to ‘int’ may change value [-Wconversion]
1025 |     return std::distance(result->controller.begin(), it);
src/ros2_control/controller_manager/src/controller_manager.cpp:2513:67: warning: conversion from ‘long int’ to ‘int’ may change value [-Wconversion]
2513 |       const int ctrl_a_chain_first_controller = find_first_element(following_ctrls);
src/ros2_control/controller_manager/src/controller_manager.cpp:2514:67: warning: conversion from ‘long int’ to ‘int’ may change value [-Wconversion]
2514 |       const int ctrl_b_chain_first_controller = find_first_element(following_ctrls_b);
src/ros2_control/controller_manager/src/controller_manager.cpp:2512:7: warning: control reaches end of non-void function [-Wreturn-type]
src/ros2_control/controller_manager/test/test_controller_manager.cpp:486:56: warning: conversion from ‘long unsigned int’ to ‘double’ may change value [-Wconversion]
486 |         (static_cast<double>(controller_update_rate) * no_of_secs_passed), 1.0);

@saikishor please check the changes one more time! I ahve added some default values to return lambda. The tests are passing, but maybe this cases are not covered.

Copy link

codecov bot commented Nov 21, 2023

Codecov Report

Merging #1174 (1e65f73) into master (99d2f61) will increase coverage by 0.01%.
The diff coverage is 42.85%.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1174      +/-   ##
==========================================
+ Coverage   47.61%   47.63%   +0.01%     
==========================================
  Files          40       40              
  Lines        3444     3445       +1     
  Branches     1866     1866              
==========================================
+ Hits         1640     1641       +1     
  Misses        480      480              
  Partials     1324     1324              
Flag Coverage Δ
unittests 47.63% <42.85%> (+0.01%) ⬆️

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

Files Coverage Δ
controller_manager/src/controller_manager.cpp 38.70% <42.85%> (+0.05%) ⬆️

@destogl destogl requested a review from saikishor November 21, 2023 18:22
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.

Apart from that, the changes look minimal and good to me.
Thank you @destogl for the great work

controller_manager/test/test_controller_manager.cpp Outdated Show resolved Hide resolved
@saikishor
Copy link
Member

@destogl We can merge it as it is, it shouldn't make a big difference in the tests point of view. SO, in my opinion we can go ahead

@bmagyar bmagyar merged commit 7d79464 into master Nov 24, 2023
13 checks passed
@destogl destogl deleted the fixup-cm-warnings branch November 30, 2023 14:13
@destogl
Copy link
Member Author

destogl commented Jan 17, 2024

@Mergifyio backport iron humble

Copy link
Contributor

mergify bot commented Jan 17, 2024

backport iron humble

✅ Backports have been created

mergify bot pushed a commit that referenced this pull request Jan 17, 2024
(cherry picked from commit 7d79464)

# Conflicts:
#	controller_manager/test/test_controller_failed_init/test_controller_failed_init.cpp
mergify bot pushed a commit that referenced this pull request Jan 17, 2024
(cherry picked from commit 7d79464)

# Conflicts:
#	controller_manager/test/test_controller_failed_init/test_controller_failed_init.cpp
#	controller_manager/test/test_controller_manager.cpp
destogl added a commit that referenced this pull request Jan 17, 2024
…ort #1174) (#1309)

* [ControllerManager] Fix all warnings from the latets features. (#1174)

(cherry picked from commit 7d79464)

---------

Co-authored-by: Dr. Denis <[email protected]>
destogl added a commit that referenced this pull request Jan 17, 2024
…ort #1174) (#1308)

* [ControllerManager] Fix all warnings from the latets features. (#1174)

(cherry picked from commit 7d79464)

---------

Co-authored-by: Dr. Denis <[email protected]>
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.

3 participants