Skip to content

refactor: apply snake_case to the function names#63

Merged
ktro2828 merged 1 commit intomainfrom
refactor/mmrviz/snake-case
Oct 2, 2025
Merged

refactor: apply snake_case to the function names#63
ktro2828 merged 1 commit intomainfrom
refactor/mmrviz/snake-case

Conversation

@ktro2828
Copy link
Copy Markdown
Owner

@ktro2828 ktro2828 commented Oct 2, 2025

Description

This pull request refactors the visualizer classes in the mmrviz package 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 the mmros package for topic resolution and QoS handling. Additionally, the dependency on mmros is now explicitly declared.

Refactoring and Code Consistency

  • Renamed all instances of onConnect to on_connect and updated corresponding method calls and declarations in all visualizer classes (BoxArray2dVisualizer, BoxArray3dVisualizer, InstanceSegmentation2dVisualizer, and Segmentation2dVisualizer) for consistency with naming conventions. [1] [2] [3] [4]
  • Updated the color map accessor from getLookUpTable() to lookup_table() in both the class definition and all usages. [1] [2] [3]

Modularization and Dependency Management

  • Replaced manual topic name resolution and QoS querying logic in each visualizer with calls to utility functions from the new mmros::node::utility.hpp, streamlining the code and reducing duplication. [1] [2] [3] [4]
  • Added mmros as a package dependency in package.xml to support the new utility functions.

Removal of Redundant Code

  • Removed custom getTopicQos methods from all visualizer classes, as their functionality is now provided by mmros::node::to_topic_qos. [1] [2] [3] [4]

Header File Improvements

  • Consolidated ROS header includes in visualizer headers to use rclcpp/rclcpp.hpp instead 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.

Signed-off-by: ktro2828 <kotaro.uetake@tier4.jp>
Copilot AI review requested due to automatic review settings October 2, 2025 22:57
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

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() to on_connect() and getLookUpTable() to lookup_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.

@ktro2828 ktro2828 merged commit 7cc2488 into main Oct 2, 2025
1 check failed
@ktro2828 ktro2828 deleted the refactor/mmrviz/snake-case branch October 2, 2025 22:59
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.

2 participants