ros2_control icon indicating copy to clipboard operation
ros2_control copied to clipboard

Refactor error handling when hardware name is duplicated

Open bmagyar opened this issue 2 years ago • 1 comments

Is your feature request related to a problem? Please describe.

There is a solution to duplicated hardware names #672 and eve though it is a working one, it is not the ideal solution.

Describe the solution you'd like

Refactor the code to take this comment into account.

Add some tests.

bmagyar avatar Apr 20 '22 09:04 bmagyar

The point is that we should do this check much earlier and not when we already initialize hardware with the duplicated name.

  • [ ] Move lines 103 - 108 in ResourceManager.cpp to a new method called check_for_duplicates.
  • [ ] Use this method at the beginning of methods:
    • void initialize_actuator(const HardwareInfo & hardware_info)
    • void initialize_sensor(const HardwareInfo & hardware_info)
    • void initialize_system(const HardwareInfo & hardware_info)
  • [ ] rename those three methods to load_and_initialize_*

destogl avatar Apr 22 '22 09:04 destogl