From 457307a6567d9314a96ce5c76f7da019c05b62fe Mon Sep 17 00:00:00 2001 From: pimpest <82343504+pimpest@users.noreply.github.com> Date: Mon, 5 Jan 2026 00:33:51 +0100 Subject: [PATCH] Added convinence scripts for running base/behavior tree --- scripts/run_base.sh | 9 +++++++++ scripts/run_bt.sh | 19 +++++++++++++++++++ 2 files changed, 28 insertions(+) create mode 100755 scripts/run_base.sh create mode 100755 scripts/run_bt.sh diff --git a/scripts/run_base.sh b/scripts/run_base.sh new file mode 100755 index 0000000..68bcab7 --- /dev/null +++ b/scripts/run_base.sh @@ -0,0 +1,9 @@ +#!/bin/bash + +ros_distro="jazzy" +script_dir=$(dirname "$(readlink -f "${bash_source[0]}")") + +source "/opt/ros/${ROS_DISTRO}/setup.bash" +source ./install/setup.bash + +ros2 launch mg_bringup base.launch.py $@ \ No newline at end of file diff --git a/scripts/run_bt.sh b/scripts/run_bt.sh new file mode 100755 index 0000000..9481b4c --- /dev/null +++ b/scripts/run_bt.sh @@ -0,0 +1,19 @@ +#!/bin/bash + + +ros_distro="jazzy" +script_dir=$(dirname "$(readlink -f "${bash_source[0]}")") +pids=() + +source "/opt/ros/${ROS_DISTRO}/setup.bash" +source "./install/setup.bash" + +trap "trap - SIGTERM && kill -- -$$" SIGINT SIGTERM EXIT + +ros2 launch mg_bringup bt.launch.py & pids+=($!) + +sleep 1 + +ros2 action send_goal /mg_bt_action_server btcpp_ros2_interfaces/action/ExecuteTree "target_tree: $1" & pids+=($!) + +wait