#!/bin/bash
# init
function pause(){
   read -p “$*”
}
sudo groupadd lego 
sudo usermod -a -G lego $LOGNAME
echo "Erstelle udev Regel"
echo ""
sudo echo "BUS==\"usb\", ATTRS{idVendor}==\"0694\", GROUP=\"lego\", MODE=\"0660\"" > /tmp/70-lego.rules && sudo mv /tmp/70-lego.rules /etc/udev/rules.d/70-lego.rules
sudo restart udev
echo ""
echo "Installiere ROS (all). Dies kann bis zu einer Stunde dauern."
echo ""
sudo sh -c 'echo "deb http://code.ros.org/packages/ros/ubuntu natty main" > /etc/apt/sources.list.d/ros-latest.list'
wget http://code.ros.org/packages/ros.key -O - | sudo apt-key add -
sudo apt-get update
echo "hddtemp hddtemp/daemon boolean false" | sudo debconf-set-selections
sudo apt-get install ros-cturtle-pr2all -y
echo ""
echo "Beendet"
echo "Installiere NXT-ROS"
echo ""
sudo apt-get install python-setuptools -y
sudo easy_install -U rosinstall
sudo apt-get install mercurial -y
rosinstall ~/nxtros /opt/ros/cturtle "http://www.ros.org/wiki/nxt/Installation?action=AttachFile&do=get&target=nxt-0.1.0.rosinstall"
. ~/nxtros/setup.sh
rosmake nxt nxt_apps nxt_robots --rosdep-install
echo "Erstelle Alias..."
echo "alias ros='. ~/nxtros/setup.sh'" sudo >>  /etc/bash.bashrc
echo "Finish. For more infos visit http://www.ros.org/wiki/nxt/Installation ."

