Roslaunch Tips for Large Projects
From Lofaro Lab Wiki
Here is a summary of the design tips offered by the ROS Wiki itself. To see more detail, visit this link.
- Top-level launch files should be short, and consist of include's to other files corresponding to subcomponents of the application, and commonly changed ROS parameters.
- Be aware of the tradeoffs when deciding how many top-level launch files your application requires.
- Use the env substitution argument to allow parts of a launch file to depend on environment variables.
- Use machine tags to balance load and control which nodes run on the same machine, and consider having the machine file name depend on an environment variable for reusability.
- Use topic remapping when a given type of information is published on different topics in different situations.
- Yaml files allow parameters with complex types, nested namespaces of parameters, and reusing the same parameter values in multiple places.
- To modify a "top-level" aspect of an application, copy the top level launch file and change the portions you need.
- To modify a deeply nested parameter in a tree of launch files which you cannot change, use roslaunch's parameter overriding semantics.
- If you can modify the original launch file, it's often preferable to use roslaunch arguments rather than parameter overriding or copying roslaunch files.