runtime/rbs_bt_executor/launch/rbs_executor.launch.py

54 lines
1.7 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 Command, FindExecutable, LaunchConfiguration, PathJoinSubstitution
from launch_ros.substitutions import FindPackageShare
2023-12-29 22:55:27 +03:00
# from ament_index_python.packages import get_package_share_directory
# import os
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_env_manager.xml",
description="BehaviorTree file for run.",
)
)
bt_file = LaunchConfiguration("bt_file")
2023-11-16 13:15:27 +03:00
robot_description_semantic_content = Command(
[
PathJoinSubstitution([FindExecutable(name="xacro")]),
" ",
PathJoinSubstitution(
[FindPackageShare("ur_moveit_config"), "srdf", "ur.srdf.xacro"]
),
" ",
"name:=",
"ur",
" ",
"prefix:=",
"",
" ",
]
)
robot_description_semantic = {"robot_description_semantic": robot_description_semantic_content}
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}
nodes_to_start = [
2023-02-03 07:04:12 +00:00
Node(
package='behavior_tree',
executable='bt_engine',
2023-12-30 23:42:10 +03:00
# prefix=['gdbserver localhost:3000'],
parameters=["/home/bill-finger/rbs_ws/src/robossembler-ros2/rbs_bt_executor/config/params.yaml"]
)
2023-12-29 22:55:27 +03:00
]
return LaunchDescription(declared_arguments + nodes_to_start)