ROS安装

1、软件源

sudo sh -c '. /etc/lsb-release && echo "deb http://mirrors.tuna.tsinghua.edu.cn/ros/ubuntu/ `lsb_release -cs` main" > /etc/apt/sources.list.d/ros-latest.list'

或者中科大软件源

sudo sh -c '. /etc/lsb-release && echo "deb http://mirrors.ustc.edu.cn/ros/ubuntu/ `lsb_release -cs` main" > /etc/apt/sources.list.d/ros-latest.list'

2、密钥

sudo apt-key adv --keyserver 'hkp://keyserver.ubuntu.com:80' --recv-key C1CF6E31E6BADE8868B172B4F42ED6FBAB17C654

3、

sudo apt update
sudo apt install ros-noetic-desktop-full

4

echo "source /opt/ros/noetic/setup.bash" >> ~/.bashrc
source ~/.bashrc

5

sudo apt install python3-rosdep python3-rosinstall python3-rosinstall-generator python3-wstool build-essential

6

sudo apt install python3-rosdep

7

cd /usr/lib/python3/dist-packages/

8

find . -type f | xargs grep "raw.githubusercontent"

9:修改4个文件

./rosdep2/sources_list.py:DEFAULT_SOURCES_LIST_URL = 'https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/sources.list.d/20-default.list'

./rosdep2/gbpdistro_support.py:FUERTE_GBPDISTRO_URL = 'https://raw.githubusercontent.com/ros/rosdistro/' \

./rosdep2/rep3.py:REP3_TARGETS_URL = 'https://raw.githubusercontent.com/ros/rosdistro/master/releases/targets.yaml'

./rosdistro/__init__.py:DEFAULT_INDEX_URL = 'https://raw.githubusercontent.com/ros/rosdistro/master/index-v4.yaml'

10 替换下载路径

sudo gedit ./rosdistro/__init__.py
替换为:
'https://gitee.com/zhao-xuzuo/rosdistro/raw/master/index-v4.yaml'


sudo gedit ./rosdep2/gbpdistro_support.py
替换为:
'https://gitee.com/zhao-xuzuo/rosdistro/raw/master/releases/fuerte.yaml'


sudo gedit ./rosdep2/rep3.py
替换为:
'https://gitee.com/zhao-xuzuo/rosdistro/raw/master/releases/targets.yaml'


sudo gedit ./rosdep2/sources_list.py
替换为:
'https://gitee.com/zhao-xuzuo/rosdistro/raw/master/rosdep/sources.list.d/20-default.list'

11 ros初始化

sudo rosdep init
rosdep update

12 测试ros是否安装成功

roscore

rosrun turtlesim turtlesim_node

rosrun turtlesim turtle_teleop_key

你可能感兴趣的:(linux,linux,windows,ubuntu)