Customizing / extending move_base
Let's say I want to customize or modify the implementation of move_base
. For example, I might want to add functionality, such that the one described here and here, or simply tweak the logic of its internal state machine a bit. Let's assume these changes will not end up in a pull request and merged upstream, which gives us more wiggle room. Let's also assume that I want to have access to the original version of move_base
.
What would be an elegant way of adding such functionality? Here are some thoughts:
- "Fork"
move_base
(i.e., copy its source code), rename everything tocustom_move_base
or something, and implement the desired functionality / extensions in this new package. This would make it hard to maintain though. An example of this is hector_move_base_navigation - Implement a new class that inherits from
move_base
. This would avoid duplicating simple functions, such asisQuaternionValid
, but would allow for overriding the key functionality, such asexecuteCycle
. I have a hunch that this will be more complicated than it sounds. - If the extensions / modifications were focused on a specific aspect of
move_base
, e.g. the state machine logic, then maybe it would make sense to introduce, e.g., "state machine plugins" which would make the internal behavior ofmove_base
configurable. Then the current logic would just be one of many possible options.
Looking forward to your thoughts :-)
PS. Now that we have Discourse, would this question be a better fit for that as opposed to ROS Answers?