refactor: apply snake_case to the function names#63
Merged
Conversation
Signed-off-by: ktro2828 <kotaro.uetake@tier4.jp>
Contributor
There was a problem hiding this comment.
Pull Request Overview
This pull request refactors the visualizer classes to standardize naming conventions by converting camelCase function names to snake_case, following consistent C++ naming patterns. The changes also consolidate ROS topic management by utilizing shared utility functions from the mmros package.
- Renamed
onConnect()toon_connect()andgetLookUpTable()tolookup_table()across all visualizer classes - Replaced custom topic resolution and QoS handling logic with utility functions from
mmros::node - Removed redundant
getTopicQos()methods and consolidated ROS header includes
Reviewed Changes
Copilot reviewed 10 out of 10 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| mmrviz/src/visualizer/segmentation2d_visualizer.cpp | Updated function names and replaced manual topic/QoS handling with mmros utilities |
| mmrviz/src/visualizer/instance_segmentation2d_visualizer.cpp | Applied snake_case naming and integrated mmros utility functions |
| mmrviz/src/visualizer/box_array3d_visualizer.cpp | Refactored function names and streamlined topic management using mmros utilities |
| mmrviz/src/visualizer/box_array2d_visualizer.cpp | Updated naming conventions and replaced custom QoS logic with shared utilities |
| mmrviz/package.xml | Added mmros dependency to support new utility functions |
| mmrviz/include/mmrviz/visualizer/segmentation2d_visualizer.hpp | Updated method signatures and consolidated ROS includes |
| mmrviz/include/mmrviz/visualizer/instance_segmentation2d_visualizer.hpp | Applied snake_case naming and simplified header includes |
| mmrviz/include/mmrviz/visualizer/box_array3d_visualizer.hpp | Refactored method names and removed redundant method declarations |
| mmrviz/include/mmrviz/visualizer/box_array2d_visualizer.hpp | Updated function naming and streamlined header structure |
| mmrviz/include/mmrviz/color_map.hpp | Renamed getLookUpTable() method to lookup_table() for consistency |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This pull request refactors the visualizer classes in the
mmrvizpackage to improve code consistency, modularity, and maintainability. The most significant changes include standardizing method and variable naming conventions, removing redundant code, and integrating utility functions from themmrospackage for topic resolution and QoS handling. Additionally, the dependency onmmrosis now explicitly declared.Refactoring and Code Consistency
onConnecttoon_connectand updated corresponding method calls and declarations in all visualizer classes (BoxArray2dVisualizer,BoxArray3dVisualizer,InstanceSegmentation2dVisualizer, andSegmentation2dVisualizer) for consistency with naming conventions. [1] [2] [3] [4]getLookUpTable()tolookup_table()in both the class definition and all usages. [1] [2] [3]Modularization and Dependency Management
mmros::node::utility.hpp, streamlining the code and reducing duplication. [1] [2] [3] [4]mmrosas a package dependency inpackage.xmlto support the new utility functions.Removal of Redundant Code
getTopicQosmethods from all visualizer classes, as their functionality is now provided bymmros::node::to_topic_qos. [1] [2] [3] [4]Header File Improvements
rclcpp/rclcpp.hppinstead of multiple individual headers, simplifying dependencies and improving clarity. [1] [2] [3] [4]These changes collectively improve code readability, maintainability, and leverage shared utilities for ROS topic management.
How was this PR tested?
Notes for reviewers
None.
Effects on system behavior
None.