diff --git a/docker_run.sh b/docker_run.sh index 85db1c3d..8e39b81e 100755 --- a/docker_run.sh +++ b/docker_run.sh @@ -32,4 +32,4 @@ esac mkdir -p output # shellcheck disable=SC2086 -rocker ${opts} --x11 --devices /dev/dri --user --net host --privileged --name aichallenge-2024 --volume ${volume} -- "aichallenge-2024-${target}" +rocker ${opts} --x11 --devices /dev/dri --user --net host --privileged --name aichallenge-2024-$(date "+%Y-%m-%d-%H-%M-%S") --volume ${volume} -- "aichallenge-2024-${target}" diff --git a/run_script.tmux b/run_script.tmux new file mode 100644 index 00000000..907043f3 --- /dev/null +++ b/run_script.tmux @@ -0,0 +1,70 @@ +#!/bin/bash + +# docker setup +AIC_DIR="/home/$USER/aichallenge-2024" +VEHICLE_DIR="/home/$USER/aichallenge-2024/vehicle" + +AIC_CD="cd $AIC_DIR" +VEHICLE_CD="cd $VEHICLE_DIR" + +AIC_DOCKER_RUN_CMD="bash docker_run.sh dev cpu" +KART_DOCKER_RUN_CMD="bash run_driver.bash" +ZENOH_DOCKER_RUN_CMD="bash run_zenoh.bash" + +AIC_WORKSPACE_CD_CMD="cd /aichallenge" +SOURCE_CMD="source install/setup.bash" + +# mouse setup +set-option -g mouse on +bind-key -n WheelUpPane if-shell -F -t = "#{mouse_any_flag}" "send-keys -M" "if -Ft= '#{pane_in_mode}' 'send-keys -M' 'select-pane -t=; copy-mode -e; send-keys -M'" +bind-key -n WheelDownPane select-pane -t= \; send-keys -M + +set-window-option -g mode-keys vi +bind-key -T copy-mode-vi v send -X begin-selection +bind-key -T copy-mode-vi y send -X copy-pipe-and-cancel "xclip -sel clip -i" + + +# split-vertical +# 1. 初期のペインで左右に分割 +select-pane -t 0 # 最初のペイン (0) を選択 +split-window -h -p 50 # 左右に 50% 分割して、右にペイン 1 を作成 + +# 2. 右側のペインを選択して上下に 3 回分割 +select-pane -t 1 # 右側のペイン (1) を選択 +split-window -v -p 67 # ペイン 1 を 67% 下で分割し、ペイン 2 を作成 +split-window -v -p 50 # ペイン 2 を 50% 下で分割し、ペイン 3 を作成 +split-window -v -p 50 # ペイン 3 を 50% 下で分割し、ペイン 4 を作成 +# pane 0 is used for aic +select-pane -t 0 +send-keys "set -x" C-m +send-keys "$AIC_CD" C-m +send-keys "echo $AIC_WORKSPACE_CD_CMD" C-m +send-keys "echo $SOURCE_CMD" C-m +send-keys "echo run_autoware.bash vehicle" C-m +send-keys "$AIC_DOCKER_RUN_CMD" C-m + +# pane 1 is used for aic rosbag record +select-pane -t 1 +send-keys "set -x" C-m +send-keys "$AIC_CD" C-m +send-keys "sleep 2" C-m +send-keys "echo $AIC_WORKSPACE_CD_CMD" C-m +send-keys "echo $SOURCE_CMD" C-m +send-keys "$AIC_DOCKER_RUN_CMD" C-m + +# pane 2 is used for racing kart docker +select-pane -t 2 +send-keys "set -x" C-m +send-keys "$VEHICLE_CD" C-m +send-keys "$KART_DOCKER_RUN_CMD" C-m + +# pane 3 is used for zenoh docker +select-pane -t 3 +send-keys "set -x" C-m +send-keys "$VEHICLE_CD" C-m +send-keys "sleep 10" C-m +send-keys "$ZENOH_DOCKER_RUN_CMD " C-m + +# pane 4 is used for anything +select-pane -t 4 +send-keys "set -x" C-m diff --git a/run_veihcle_tmux.sh b/run_veihcle_tmux.sh new file mode 100644 index 00000000..ee5d98d3 --- /dev/null +++ b/run_veihcle_tmux.sh @@ -0,0 +1,4 @@ +#!/bin/bash + +bash stop_vehicle_tmux.sh +gnome-terminal --maximize --zoom 0.7 -- tmux new-session \; source-file run_script.tmux diff --git a/stop_vehicle_tmux.sh b/stop_vehicle_tmux.sh new file mode 100644 index 00000000..9066df0d --- /dev/null +++ b/stop_vehicle_tmux.sh @@ -0,0 +1,6 @@ +#!/bin/bash + +# kill tmux server +tmux kill-server +# kill all docker +docker rm -f "$(docker ps -a -q)" diff --git a/vehicle/run_zenoh.bash b/vehicle/run_zenoh.bash index 97e61944..a3eeb804 100755 --- a/vehicle/run_zenoh.bash +++ b/vehicle/run_zenoh.bash @@ -1,11 +1,11 @@ #!/bin/bash docker run --rm \ - --net=host \ - -e ROS_DISTRO=humble \ - -e RMW_IMPLEMENTATION=rmw_cyclonedds_cpp \ - -e CYCLONEDDS_URI=file:///cyclonedds.xml \ - --name zenoh \ - -v ~/aichallenge-2024/vehicle/zenoh.json5:/zenoh.json5 \ - -v ~/aichallenge-2024/cyclonedds.xml:/cyclonedds.xml \ - eclipse/zenoh-bridge-ros2dds:latest \ - -c /zenoh.json5 \ No newline at end of file + --net=host \ + -e ROS_DISTRO=humble \ + -e RMW_IMPLEMENTATION=rmw_cyclonedds_cpp \ + -e CYCLONEDDS_URI=file:///cyclonedds.xml \ + --name zenoh \ + -v ~/aichallenge-2024/vehicle/zenoh.json5:/zenoh.json5 \ + -v ~/aichallenge-2024/cyclonedds.xml:/cyclonedds.xml \ + eclipse/zenoh-bridge-ros2dds:latest \ + -c /zenoh.json5 diff --git a/vehicle/zenoh.json5 b/vehicle/zenoh.json5 index 4f16f4d8..65a5bb88 100644 --- a/vehicle/zenoh.json5 +++ b/vehicle/zenoh.json5 @@ -65,6 +65,7 @@ "/map/vector_map_marker", "/planning/scenario_planning/lane_driving/behavior_planning/path", "/localization/kinematic_state", + "/initialpose", ], subscribers: [ "/vehicle/status/control_mode", @@ -78,6 +79,7 @@ "/map/vector_map_marker", "/planning/scenario_planning/lane_driving/behavior_planning/path", "/localization/kinematic_state", + "/initialpose", ], service_servers: [], service_clients: [],