Files
behavior-tree/ros2/bt_executor/launch/executor.launch.py
T

24 lines
1.5 KiB
Python

"""Explicit deployment identity/site/journal; motion disabled unless opted in."""
from launch import LaunchDescription
from launch.actions import DeclareLaunchArgument
from launch.substitutions import LaunchConfiguration, EnvironmentVariable
from launch_ros.actions import Node
from launch_ros.parameter_descriptions import ParameterValue
def generate_launch_description():
names = [DeclareLaunchArgument('namespace'), DeclareLaunchArgument('robot_id'),
DeclareLaunchArgument('site_config_file'), DeclareLaunchArgument('journal_directory'),
DeclareLaunchArgument('execution_enabled', default_value='false')]
return LaunchDescription(names + [Node(
package='bt_executor', executable='bt_executor_node', output='screen',
namespace=LaunchConfiguration('namespace'), parameters=[{
'robot_id': LaunchConfiguration('robot_id'),
'allowed_robots': [[LaunchConfiguration('robot_id')]],
'site_config_file': LaunchConfiguration('site_config_file'),
'journal_directory': LaunchConfiguration('journal_directory'),
'execution_enabled': ParameterValue(LaunchConfiguration('execution_enabled'), value_type=bool),
'recovery_token': ParameterValue(EnvironmentVariable('ROBOT_BT_RECOVERY_TOKEN', default_value=''), value_type=str),
'recovery_operator_id': ParameterValue(EnvironmentVariable('ROBOT_BT_RECOVERY_OPERATOR', default_value=''), value_type=str),
}])])