-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathstart_client.sh
executable file
·36 lines (27 loc) · 1.35 KB
/
start_client.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
#!/bin/bash
SESSION="client" # So we can reference $SESSION later
SERVERNAME="/controlServer" # Name of the yarp server for controlling the robot
CURRENT_DIR=$(pwd)
# Options
CONFIG="$CURRENT_DIR/config/ergocub_gazebo_sim.ini"
# Window layout:
#######################################
# # #
# # #
# # #
# 0 # 1 #
# # #
# # #
# # #
#######################################
# Create first window & panel
tmux new-session -d -s $SESSION
tmux rename-window -t 0 'Client'
# Split Pane 1 to the right and launch the client
tmux split-window -h
tmux send-keys -t $SESSION "$CURRENT_DIR/build/command_prompt $SERVERNAME $CONFIG" Enter
# Switch back to Pane 0 and run yarp rpc
tmux select-pane -t 0
tmux send-keys -t $SESSION "sleep 1" Enter # Wait a few seconds before continuing
tmux send-keys -t $SESSION "yarp rpc /commandPrompt" Enter
tmux attach-session -t $SESSION:0 # REQUIRED or the above won't execute