12345678910111213141516171819202122232425262728293031323334353637383940 |
- #!/bin/bash
- # Copyright: 2016-2019 ROS小课堂 www.corvin.cn
- # Author: corvin
- # Description:该脚本是为了编译工作去软件包,并配置环境变量到.bahsrc.
- # History:
- # 20181226:Initial this bash file.
- # 20190122:新增在运行前需要安装的一些必要软件包.
- red="\e[31m"
- normal="\e[0m"
- CURRENT_PATH=$(dirname $(readlink -f "$0"))
- WS_PATH=${CURRENT_PATH%scripts}
- # first install necessary packages
- sudo apt update
- while [ $? -ne 0 ]
- do
- echo -e "{red}Can't update source list, will retry...{noraml}\n"
- sleep 3
- sudo apt update
- done
- sudo apt -y upgrade
- sudo apt install -y ros-kinetic-moveit-msgs ros-kinetic-moveit-core \
- ros-kinetic-moveit-ros-perception ros-kinetic-moveit-ros-planning-interface \
- ros-kinetic-moveit
- sudo apt-get -y autoremove
- # second catkin_make worksapce
- cd $WS_PATH/ros_code/
- catkin_make
- # third set workspace env to .bashrc
- source devel/setup.bash
- echo "#config arduino_robot_arm env" >>~/.bashrc
- echo "source ${WS_PATH}ros_code/devel/setup.bash" >> ~/.bashrc
- exit 0
|