-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrun_turtlebot.sh
43 lines (33 loc) · 1.51 KB
/
run_turtlebot.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
# Can set up a SSH key-based authentication if needed -- generate a key pair on a local machine using ssh-keygen and then copy public key to target machine using ssh-copy-id [email protected]
# Can also set up a passwordless SSH (need to install) -- sshpass -p 'your_password' ssh [email protected]
# sudo apt install tmux
# Execute the script once before use: chmod +x run_turtlebot.sh
# Use ./run_turtlebot.sh to run
#!/bin/bash
# Start a new tmux session
tmux new-session -d -s turtlebot
# Terminal 1: roscore
tmux send-keys -t turtlebot "roscore" C-m
# Wait for roscore to initialize
sleep 5
# Terminal 2: SSH and bring up turtlebot
tmux split-window -h
tmux send-keys -t turtlebot "ssh [email protected]" C-m
sleep 2 # Allow time for the SSH connection
# Assuming passwordless SSH is set up; if not, install and use sshpass
tmux send-keys -t turtlebot "turtlebot" C-m
sleep 2 # Allow time for the turtlebot command
tmux send-keys -t turtlebot "roslaunch turtlebot3_bringup turtlebot3_robot.launch" C-m
# Terminal 3: Teleop
tmux split-window -v
tmux send-keys -t turtlebot "export TURTLEBOT3_MODEL=\$burger" C-m
tmux send-keys -t turtlebot "roslaunch turtlebot3_teleop turtlebot3_teleop_key.launch" C-m
# Terminal 4: RQT
tmux split-window -h
tmux send-keys -t turtlebot "rqt" C-m
# Terminal 5: SLAM
tmux split-window -v
tmux send-keys -t turtlebot "export TURTLEBOT3_MODEL=burger" C-m
tmux send-keys -t turtlebot "roslaunch turtlebot3_slam turtlebot3_slam.launch" C-m
# Attach to the tmux session
tmux attach-session -t turtlebot