1埠偿、更新ubuntu
終端輸入:sudo apt-get update
終端輸入:sudo apt-get upgrade
2、設(shè)置源-系統(tǒng)設(shè)置-軟件和更新-源代碼打勾
找到http://mirrors.tuna.tsinghua.edu.cn/ubuntu清華的源
中科大的源也行
3、安裝ROS
3.1 Configure your Ubuntu repositories
3.2 Setup your sources.list
sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list'
3.3 Set up your keys
sudo apt-key adv --keyserver 'hkp://keyserver.ubuntu.com:80' --recv-key C1CF6E31E6BADE8868B172B4F42ED6FBAB17C654
3.4 Installation
sudo apt-get update
sudo apt-get install ros-kinetic-desktop-full
3.5 Environment setup
echo "source /opt/ros/kinetic/setup.bash" >> ~/.bashrc
source ~/.bashrc
3.6 Dependencies for building packages
sudo apt install python-rosdep python-rosinstall python-rosinstall-generator python-wstool build-essential
sudo apt install python-rosdep
sudo rosdep init
rosdep update
在運行sudo rosdep init會出現(xiàn)錯誤
鏈接https://blog.csdn.net/weixin_44692299/article/details/105869229
ros 中ERROR: cannot download default sources list
from: https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/sources.list.d/20-default.list
Website may be down.
1 在桌面打開終端輸入下面指令
sudo chmod 777 /etc
此指令為獲取etc中的權(quán)限,操作成功后如下:每個圖標(biāo)右下角有一把鎖
2 在etc中手動創(chuàng)建(一定要手動創(chuàng)建栋齿,別自作聰明指令創(chuàng)建膳叨,以防小白入坑)
目錄入————》》》/etc/ros/rosdep/sources.list.d
多說一句柠辞,etc目錄的進入方法
3 打開網(wǎng)址:https://site.ip138.com
輸入raw.githubusercontent.com
隨便挑選一個ip地址渴邦,我選的是美國的。
新建一個空白文檔如下編輯:
4 在桌面打開終端輸入如下指令:
sudo vi /etc/hosts
將剛剛創(chuàng)建的文檔里的信息粘貼如下:
vi編輯器澎剥,將鼠標(biāo)光標(biāo)移動到需要編輯的地方锡溯,按字母i進入編輯模式,粘貼好后ctrl+c退出編輯狀態(tài),在輸入冒號加wq在按回車(:wq)
4 創(chuàng)建項目
mkdir -p ~/catkin_ws/src
cd~/catkin_ws/src
catkin_init_workspace
cd..
catkin_make
source~/catkin_ws/devel/setup.bash
添加三句gedit ~/.bashrc
source /usr/share/gazebo-7/setup.sh
source /opt/ros/kinetic/setup.bash
source $HOME/catkin_ws/devel/setup.bash
下載UUV模型
sudo apt install ros-kinetic-uuv-simulator
下一步cd~/catkin_ws/src
克隆git clone https://github.com/uuvsimulator/lauv_gazebo.git
下載的uuv_simulator放到 src里
運行環(huán)境 roslaunch uuv_gazebo_worlds ocean_waves.launch
roslaunch lauv_description upload.launch mode:=default x:=0 y:=0 z:=0 namespace:=auv