diff --git a/adore_cli.mk b/adore_cli.mk index 74372b8..e6d99e6 100644 --- a/adore_cli.mk +++ b/adore_cli.mk @@ -135,7 +135,7 @@ adore_cli_run: make adore_cli_start; \ fi @echo "Executing command in container ${ADORE_CLI_CONTAINER_NAME}: $(cmd)" - docker exec --workdir /tmp/adore -it ${ADORE_CLI_CONTAINER_NAME} bash -c "source setup.sh && $(cmd)" + docker exec --workdir /tmp/adore -it ${ADORE_CLI_CONTAINER_NAME} zsh -c "source ~/.zshrc && $(cmd)" .PHONY: adore_cli_start_headless diff --git a/docker/files/.zshrc b/docker/files/.zshrc index 67d34e8..2d56d13 100644 --- a/docker/files/.zshrc +++ b/docker/files/.zshrc @@ -30,5 +30,6 @@ PROMPT='%B%F{grey}%F{cyan}ADORe CLI:%F %{$fg_bold[green]%}%c %{$reset_color%}$(g alias help='bash /tmp/adore_cli/tools/adore_cli_help.sh' source /opt/ros/${ROS_DISTRO}/setup.zsh if [ -f /tmp/adore/setup.sh ]; then + export SHELL=zsh source /tmp/adore/setup.sh fi diff --git a/setup.sh b/setup.sh new file mode 100644 index 0000000..9bb56f8 --- /dev/null +++ b/setup.sh @@ -0,0 +1,3 @@ +SCRIPT_DIRECTORY="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )" +ROS2_WORKSPACE_DIRECTORY="$(realpath "${SCRIPT_DIRECTORY}/ros2_workspace")" +source /opt/ros/${ROS_DISTRO}/setup.zsh diff --git a/tools/adore_cli.sh b/tools/adore_cli.sh index bc0fc53..6d037d3 100644 --- a/tools/adore_cli.sh +++ b/tools/adore_cli.sh @@ -39,5 +39,5 @@ bash "/tmp/adore_cli/tools/git_repo_status.sh" bash "/tmp/adore_cli/tools/requirements_file_change_status.sh" printf "\n" -zsh +zsh diff --git a/tools/run_test_scenarios.sh b/tools/run_test_scenarios.sh deleted file mode 100644 index 6dd06fb..0000000 --- a/tools/run_test_scenarios.sh +++ /dev/null @@ -1,76 +0,0 @@ -#!/usr/bin/env bash - -function echoerr { echo "$@" >&2; exit 1;} - - -SCRIPT_DIR="$( cd -- "$( dirname -- "${BASH_SOURCE[0]:-$0}"; )" &> /dev/null && pwd 2> /dev/null; )"; - -ADORE_CLI_DIRECTORY=${ADORE_CLI_DIRECTORY:-/tmp/adore_cli} - -if [[ -z ${SOURCE_DIRECTORY+x} ]]; then - echoerr "ERROR: The environmental variable SOURCE_DIRECTORY is empty, SOURCE_DIRECTORY must be supplied." - echoerr " The SOURCE_DIRECTORY is an absolute path containing catkin packages that will be soft linked into the catkin workspace." - echo "" - exit 1 -fi - -if [[ -z ${ADORE_CLI_WORKING_DIRECTORY+x} ]]; then - echoerr "ERROR: The environmental variable ADORE_CLI_WORKING_DIRECTORY is empty, ADORE_CLI_WORKING_DIRECTORY must be supplied." - echoerr " The ADORE_CLI_WORKING_DIRECTORY is an absolute path where the ADORe cli will start as an initial working directory" - echo "" - exit 1 -fi - -if [[ -z ${CATKIN_WORKSPACE_DIRECTORY+x} ]]; then - echoerr "ERROR: The environmental variable CATKIN_WORKSPACE_DIRECTORY is empty, CATKIN_WORKSPACE_DIRECTORY must be supplied." - echoerr " The CATKIN_WORKSPACE_DIRECTORY is an absolute path to a catkin workspace." - echo "" - exit 1 -fi - -PLOTLABSERVER_DIRECTORY=${PLOTLABSERVER_DIRECTORY:-${SOURCE_DIRECTORY}/plotlabserver} -LOG_DIR="${SOURCE_DIRECTORY}/.log" -ROS_LOG_DIR="${LOG_DIR}/.ros/log" -PLOTLABSERVER_LOG_DIR="${LOG_DIR}/plotlabserver" - - - -clear -cd ${SCRIPT_DIR}/.. - - -bash "${SCRIPT_DIR}/wait_for_plotlab_server.sh" - -echo "" -printf " Waiting for catkin workspace ..." -until [ -e "${CATKIN_WORKSPACE_DIRECTORY}/install/setup.sh" ]; do - printf "." - sleep 1 -done -printf " done \n" -source "${CATKIN_WORKSPACE_DIRECTORY}/install/setup.sh" - - -cd "${ADORE_CLI_WORKING_DIRECTORY}" - -for test_scenario in $TEST_SCENARIOS; do - if [[ ! -f "${test_scenario}" ]]; then - echoerr "ERROR: Specified test scenario: ${test_scenario} is not found." - fi - - scenario_name=$(basename "${test_scenario}" .launch) - scenario_log_dir="${LOG_DIR}/scenario_logs/${scenario_name}" - mkdir -p "${scenario_log_dir}/.ros" - mkdir -p "${scenario_log_dir}/plotlabserver" - echo "Running scenario: ${test_scenario}" - BAG_OUTPUT_DIRECTORY="${scenario_log_dir}" roslaunch "${test_scenario}" - cd "${ROS_LOG_DIR}" - latest_ros_log_path="$(ls -t | head -1)" - rm latest -f - ln -s -f "${latest_ros_log_path}" latest 2> /dev/null || true - ln -s -f "${latest_ros_log_path}" "${scenario_name}" 2> /dev/null || true - mkdir -p "${LOG_DIR}/${scenario_name}/.ros" - cp -r "${ROS_LOG_DIR}/${scenario_name}"/* "${scenario_log_dir}/.ros/" - (cd "${PLOTLABSERVER_LOG_DIR}" && cp -r * "${scenario_log_dir}/plotlabserver") - cd "${scenario_log_dir}" && ln -sf .ros ros_logs -done