ros2_control
ros2_control copied to clipboard
Refactor error handling when hardware name is duplicated
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.
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_*