-
Notifications
You must be signed in to change notification settings - Fork 4
/
setup_mic-launcher.sh
executable file
·34 lines (30 loc) · 1.9 KB
/
setup_mic-launcher.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
INSTALL_MICROPHONE_CONTAINER=true
while true; do
read -p "Proceed with setting up Microphone Launcher docker container? [Y/n]: " yn
case $yn in
[Nn]* ) INSTALL_MICROPHONE_CONTAINER=false; echo "Please run ./setup_mic_launcher.sh later"; break;;
[Yy]*|"" ) read -n 1 -r -s -p "Okay, setting up MICROPHONE LAUNCHER docker container. Connect USB microphone and hit enter..."; break;;
* ) echo "Please answer yes or no.";;
esac
done
if $INSTALL_MICROPHONE_CONTAINER; then
docker rm -f s02-ros_microphone-launcher
echo
echo -e "${G}Run MICROPHONE_LAUNCHER Docker Container${N}"
ROS_IMAGE_ID=`sudo docker images --filter=reference=docker-registry.jibo.media.mit.edu:5000/mitprg/ros-bundle --format "{{.ID}}"`
ROS_IMAGE_ID=`echo $ROS_IMAGE_ID | awk '{print $1}'`
while [ -z "$ROS_IMAGE_ID" ]; do
echo "Waiting for docker image to finish download..."
sleep 10s
ROS_IMAGE_ID=`sudo docker images --filter=reference=docker-registry.jibo.media.mit.edu:5000/mitprg/ros-bundle --format "{{.ID}}"`
ROS_IMAGE_ID=`echo $ROS_IMAGE_ID | awk '{print $1}'`
done
echo $ROS_IMAGE_ID
#sudo docker run -d -it --name=s02-ros_microphone-launcher --network=host --restart=always --workdir=/root/projects --device=/dev/snd:/dev/snd \
#--volume=/home/prg/rosbags:/root/projects/rosbags $ROS_IMAGE_ID python3.8 -m s02-launch-scripts.scripts.start_asr_launcher
sudo docker run -d --name=s02-ros_microphone-launcher --network=host --restart=always --workdir=/root/projects --device=/dev/snd:/dev/snd --volume=/etc/asound.conf:/etc/asound.conf \
--volume=/home/prg/rosbags:/root/rosbags $ROS_IMAGE_ID python3.8 -m s02-launch-scripts.scripts.start_asr_launcher
fi
# sudo docker run -d -it --restart=unless-stopped --device=/dev/snd:/dev/snd \
# --network=host --workdir=/root/catkin_ws/src/unity-game-controllers \
# $ROS_IMAGE_ID python3.6 -m scripts.utils_scripts.start_mic_launcher.py