Best practices for hardware package organization?
Hello,
I have recently started to invest significant time into developing ROS packages for my work and have a question regarding best practices and/or suggestions when it comes to code organization. Specifically my question is as follows:
When developing packages for hardware, should I aim to develop ROS-specific code or start with a general purpose library and then extend it to work with ROS via a wrapper or base class?
I would like to have my code be reusable outside of ROS if necessary and thus avoid any ROS-specific types/functions in the library but I got a bit confused when I try to utilize any ROS functionality (e.g., rosconsole messages, service callbacks, etc.). My current thoughts are to develop the hardware interface as a standalone class/library and then inherit it as a base class to another ROS-specific class that adds callback member functions for services and the like... I figure this might just be a preference thing but thought I would try to get some feedback on the topic while I am still in the early stages of integration.
Thanks, Brett