Skip to content

Refactor: Update HAL to use std::unique_ptr and ROS2 naming conventions#3696

Open
zaynabahmad wants to merge 1 commit intoJdeRobot:humble-develfrom
zaynabahmad:style_memory_mng
Open

Refactor: Update HAL to use std::unique_ptr and ROS2 naming conventions#3696
zaynabahmad wants to merge 1 commit intoJdeRobot:humble-develfrom
zaynabahmad:style_memory_mng

Conversation

@zaynabahmad
Copy link
Copy Markdown

@zaynabahmad zaynabahmad commented Mar 30, 2026

Description

This PR refactors the HAL.hpp for the Vacuum Cleaner exercise to improve memory management and adhere to ROS 2 coding standards.

Changes:

  • Memory Safety: Replaced raw pointers with std::unique_ptr<LaserData> in get_laser_data() to prevent memory leaks.
  • Naming Conventions: Updated member variables and method parameters to follow snake_case_ (Google/ROS 2 Style Guide).
  • Performance: Optimized callbacks by passing messages by const SharedPtr&.
  • Code Hygiene: Removed using namespace std; to prevent namespace pollution.

Testing Performed

  • Verified the build process within the Docker container.
  • Tested functionality in the browser-based simulation.
  • Confirmed that the robot correctly processes laser data and executes motion commands.

Visual Proof

video.webm

Issue

Issue #3692

Copy link
Copy Markdown
Member

@javizqh javizqh left a comment

Choose a reason for hiding this comment

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

We just finished with our refactor of the vacuum cleaner exercise. Please if possible update this PR to match the new files in cpp_lib in RA and common_interfaces_cpp in RI

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