jteson nano 的ubuntu版本是18.04LTS,对应的ROS版本是melodic
1、将安装源(中科大的源)添加到source.list
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'
2、添加公钥
sudo apt-key adv --keyserver 'hkp://keyserver.ubuntu.com:80' --recv-key C1CF6E31E6BADE8868B172B4F42ED6FBAB17C654
3、更新下apt
sudo apt update
4、安装ROS
sudo apt install ros-melodic-desktop-full
如果出现“E: 无法定位软件包”的错误,无法安装.需要换源(或者检查是不是公钥没添加OK)。
sudo gedit /etc/apt/sources.list
在打开的文件里加入
deb http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
或
deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ bionic main multiverse restricted universe
deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ bionic-security main multiverse restricted universe
deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ bionic-updates main multiverse restricted universe
deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ bionic-backports main multiverse restricted universe
deb-src http://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ bionic main multiverse restricted universe
deb-src http://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ bionic-security main multiverse restricted universe
deb-src http://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ bionic-updates main multiverse restricted universe
deb-src http://mirrors.tuna.tsinghua.edu.cn/ubuntu-ports/ bionic-backports main multiverse restricted universe
保存关闭,再输入以下指令
sudo apt-get update
如果软件包不是最新则更新一下
sudo apt-get upgrade
5、安装完毕初始化ROS
先安装依赖
sudo apt install python-rosdep python-rosinstall python-rosinstall-generator python-wstool build-essential
再输入
sudo rosdep init
若出错
第一种可能:找不到安装命令
sudo apt install python-rosdep
第二种可能:cannot download
sudo gedit /etc/hosts
在其中输入 xxx.xxx.xxx.xxxraw.githubusercontent
xxx从www.ipaddress.com输入raw.githubusercontent.com查询
rosdep update
6、环境变量
echo "source /opt/ros/melodic/setup.bash" >> ~/.bashrc
source ~/.bashrc
7、测试
roscore
参考:步骤一:Jetson Nano安装ROS步骤,及相关错误分析_jetson ros_doki2022的博客-CSDN博客