Last active
August 29, 2015 13:56
-
-
Save mstaflex/9229282 to your computer and use it in GitHub Desktop.
Script that launches a complete twistbot tmux environment
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# let us run the script on startup of the station | |
# this files lays under /etc/rc.local and is executed on boot of the system | |
su tbot -c 'source /home/tbot/.bashrc && /home/tbot/ros/twistbot-tmux-init.bash' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# var for session name (to avoid repeated occurences) | |
sn=twistbot | |
cd | |
tmux new-session -s "$sn" -d -n "core" | |
tmux send-keys -t "$sn:core" C-z 'roslaunch twistbot_core twistbot_core.launch' Enter | |
sleep 5 # gives the core time to come along | |
tmux new-window -t "$sn:2" -n "twistbot-main" | |
tmux split-window -v -t "$sn:twistbot-main" # this window will listen for the start topic | |
tmux send-keys -t "$sn:twistbot-main.1" C-z 'while true; do rostopic echo -n 1 /move_base_simple/goal && tmux send-keys -t "twistbot:twistbot-main.0" "roslaunch twistbot_start twistbot.launch" Enter; done' Enter | |
tmux split-window -v -t "$sn:twistbot-main" # this window will listen to the kill topic | |
tmux send-keys -t "$sn:twistbot-main.2" C-z 'while true; do rostopic echo -n 1 /kill_twistbot_start && tmux send-keys -t "twistbot:twistbot-main.0" C-c; done' Enter | |
tmux new-window -t "$sn:3" -n "waypoints" | |
tmux send-keys -t "$sn:waypoints" C-z 'rosrun waypoints waypoint_controller.py' Enter | |
tmux new-window -t "$sn:4" -n "bssid-switcher" | |
tmux send-keys -t "$sn:bssid-switcher" C-z 'roscd router_tools/scripts/client && python remote_switcher.py' Enter |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Why would it? What exactly do you mean? Starting it in tmux, or the fact that the navigation occasionally crashes?