Skip to content

Avoid std::stringstream#391

Merged
Karsten1987 merged 1 commit intoros-controls:masterfrom
matthew-reynolds:avoid_stringstream
Apr 24, 2021
Merged

Avoid std::stringstream#391
Karsten1987 merged 1 commit intoros-controls:masterfrom
matthew-reynolds:avoid_stringstream

Conversation

@matthew-reynolds
Copy link
Copy Markdown
Member

@matthew-reynolds matthew-reynolds commented Apr 23, 2021

Prompted by seeing #389. We use the stringstream variants of the RCLCPP logging macros so infrequently, we might as well just move away from them entirely and avoid the performance & memory hit associated with std::stringstream.

There are now no longer any _STREAMs in this repo.

Even though joint_limits_interface isn't currently enabled, making the change there means one less thing to worry about if/when that package is eventually enabled or the code is merged into other packages as was suggested.

(For context on #389 and this PR: See ros2/rclcpp#1442 or https://docs.ros.org/en/foxy/Releases/Release-Galactic-Geochelone.html#change-in-rclcpp-s-logging-macros for why these RCLCPP macros changed since Foxy)

@matthew-reynolds
Copy link
Copy Markdown
Member Author

Ping @tylerjw as the author of #389, and since the CI obviously doesn't cover Rolling at the moment.

@tylerjw
Copy link
Copy Markdown
Contributor

tylerjw commented Apr 23, 2021

Ping @tylerjw as the author of #389, and since the CI obviously doesn't cover Rolling at the moment.

Thank you, I'll test this change locally to see if it'll cause any issues with compiling with rolling.

@tylerjw
Copy link
Copy Markdown
Contributor

tylerjw commented Apr 23, 2021

This builds without errors on rolling. There are some deprecation warnings but for now I'm just trying to get everything building as a start. Thank you for pinging me.

@tylerjw
Copy link
Copy Markdown
Contributor

tylerjw commented Apr 23, 2021

If you'd like I can make a PR to add rolling to your CI. Since you are using industrial_ci it is trivial to test building and testing on rolling also.

Copy link
Copy Markdown
Contributor

@Karsten1987 Karsten1987 left a comment

Choose a reason for hiding this comment

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

I personally don't think stringstream introduces a big performance hit, but I am ok with the change - not at least for consistency.

@matthew-reynolds do you have merge rights?

@matthew-reynolds
Copy link
Copy Markdown
Member Author

matthew-reynolds commented Apr 24, 2021

Fair enough 👍 Agreed that performance aside, consistency is still a good enough reason for this :)

No, I don't have merge rights.

@Karsten1987 Karsten1987 merged commit e16bfd2 into ros-controls:master Apr 24, 2021
@matthew-reynolds matthew-reynolds deleted the avoid_stringstream branch April 24, 2021 01:31
destogl added a commit to b-robotized-forks/ros2_control that referenced this pull request Aug 11, 2022
* Fix correct_initialization_using_parameters
* Fix configure_state_ignores_command
* Re-enable incorrect_initialization_using_interface_parameters
* Re-enable cleanup and activate tests
* Port gtest to gmock

Co-authored-by: Denis Štogl <denis@stogl.de>
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