Skip to content

Commit

Permalink
bash alias 'ntmux' (#1307)
Browse files Browse the repository at this point in the history
* bash alias 'ntmux' to autostart a tmux session, or join one, called 'auto' that is setup for Navigator runs

* NaviGator/scripts: Add script for launching tmux windows/pane (closes #1302)

---------

Co-authored-by: Cameron Brown <[email protected]>
  • Loading branch information
alexoj46 and cbrxyz authored Nov 5, 2024
1 parent 8c42a9a commit f01a59f
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
25 changes: 25 additions & 0 deletions NaviGator/scripts/tmux_start.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/bin/bash
if tmux has-session -t auto; then
tmux a -t auto
else
# First window (panes)
tmux new-session -d -s auto
tmux send-keys -t auto:0.0 'roslaunch navigator_launch master.launch --screen' Enter
tmux split-window -h -t auto
tmux split-window -v -t auto

# Second window (alarms, other panes)
sleep 1.5
tmux new-window -t auto
tmux split-window -h -t auto:1
tmux split-window -v -t auto:1
tmux split-window -v -t auto:1.0
tmux send-keys 'amonitor kill' Enter
tmux split-window -h
tmux send-keys 'amonitor hw-kill' Enter
tmux select-pane -t auto:1.0

# Return to the first window
tmux select-window -t auto:0
tmux a -t auto
fi
1 change: 1 addition & 0 deletions scripts/setup.bash
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,7 @@ alias gazebogui="rosrun gazebo_ros gzclient __name:=gzclient"

# Preflight aliases
alias preflight='python3 $MIL_REPO/mil_common/utils/mil_tools/scripts/mil-preflight/main.py'
alias ntmux='$MIL_REPO/NaviGator/scripts/tmux_start.sh'

# Process killing aliases
alias killgazebo="killall -9 gzserver && killall -9 gzclient"
Expand Down

0 comments on commit f01a59f

Please sign in to comment.