Hi there!
I just released my tool better_launch, which is a complete replacement for the ROS2 launch system. With this package, instead of dozens of imports and class instances for even the most basic tasks, your launch files could look as simple and beautiful as this:
#!/usr/bin/env python3
from better_launch import BetterLaunch, launch_this
@launch_this
def my_main(enable_x: bool = True):
"""
The docstring will also document function args and provide a --help flag!
"""
bl = BetterLaunch()
if enable_x:
bl.node(
"examples_rclpy_minimal_publisher",
"publisher_local_function",
"example_publisher",
)
# Include other launch files, even regular ROS2 launch files!
bl.include("better_launch", "ros2_turtlesim.launch.py")
What does it do?
The Readme has more details, but to give you an overview of what it does:
- Launch files are determinstic: any actions taken in the launch files are executed immediately, allowing direct and meaningful interactions with nodes, topics and services as the launch process develops.
- Launch arguments are passed as natural types to your launch function.
- Use regular python syntax like if/else. No async shenanigans!
- The entire launch logic is contained within a single, fully documented package, examples included.
- Write launch files fully compatible with ROS2’s launch system. This means they can be started through
ros2 launch
, include regular ROS2 launch files, and even get included from regular ROS2 launch files. - Includes convenience functions for various common tasks like starting a joint_state_publisher or bridging Gazebo topics.
- Comes with a **replacement for
ros2 launch
calledbl
, which is both faster than its counterpart and provides additional features like auto completion for launch arguments. - Designed with user friendliness in mind and thus generates reformatted and colored terminal output by default.
- Unless killed with SIGKILL, better_launch will leave no zombie processes behind.
Terminal UI included!
better_launch also comes with an optional terminal UI similar to rosmon, which can be used for stopping and restarting nodes, triggering life cycle transitions, list a node’s subscribed topics, dynamically adjust the logging level and more (screenshot below)!
Is it for me?
We already have it in use on several robots at my research institute, so I consider it mature enough for general use in research applications.
If you find any bugs, missing features, or just want to give feedback in general I would much appreciate it
Links
Thank you ~
Nikolas