runtime/rbs_bt_executor/launch/rbs_executor.launch.py

44 lines
1.3 KiB
Python
Raw Normal View History

2023-02-03 07:04:12 +00:00
from launch import LaunchDescription
2023-12-29 22:55:27 +03:00
from launch.actions import DeclareLaunchArgument
2023-02-03 07:04:12 +00:00
from launch_ros.actions import Node
from launch.substitutions import LaunchConfiguration, PathJoinSubstitution
from launch_ros.substitutions import FindPackageShare
2023-02-03 07:04:12 +00:00
2023-11-16 13:15:27 +03:00
def generate_launch_description():
2023-11-14 13:04:11 +03:00
2023-12-29 22:55:27 +03:00
declared_arguments = []
declared_arguments.append(
DeclareLaunchArgument(
"bt_file",
default_value="test_tree.xml",
2023-12-29 22:55:27 +03:00
description="BehaviorTree file for run.",
)
)
bt_file = LaunchConfiguration("bt_file")
2023-11-16 13:15:27 +03:00
2023-11-14 13:04:11 +03:00
2023-12-29 22:55:27 +03:00
btfile_description = PathJoinSubstitution(
[FindPackageShare("rbs_bt_executor"), "bt_trees", bt_file]
)
btfile_param = {"bt_file_path": btfile_description}
bt_skills_param = PathJoinSubstitution([FindPackageShare("rbs_bt_executor"), "config", "params.yaml"])
2023-12-29 22:55:27 +03:00
nodes_to_start = [
2023-02-03 07:04:12 +00:00
Node(
package='behavior_tree',
executable='bt_engine',
2024-04-22 15:06:46 +03:00
# prefix=['gdbserver localhost:1234'],
parameters=[
btfile_param,
2024-04-22 15:06:46 +03:00
bt_skills_param,
{'use_sim_time': True}
],
# arguments=[
# "--ros-args",
# "--log-level", "debug",
# ],
)
2023-12-29 22:55:27 +03:00
]
return LaunchDescription(declared_arguments + nodes_to_start)