本篇博客会随时更新。
一、常用命令
1、添加环境变量
gedit ~/.bashrc
2、ubuntu系统监视器
gnome-system-monitor
二、问题
1、sudo apt-get update时报错:
W: GPG 错误:http://packages.ros.org/ros/ubuntu xenial InRelease: 由于没有公钥,无法验证下列签名: NO_PUBKEY F42ED6FBAB17C654
W: 仓库 “http://packages.ros.org/ros/ubuntu xenial InRelease” 没有数字签名。
N: 无法认证来自该源的数据,所以使用它会带来潜在风险。
解决:
sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys F42ED6FBAB17C654(密钥替换成自己的)
2、安装时ros报错
下列软件包有未满足的依赖关系:
ros-kinetic-desktop-full : 依赖: ros-kinetic-desktop 但是它将不会被安装
依赖: ros-kinetic-perception 但是它将不会被安装
依赖: ros-kinetic-simulators 但是它将不会被安装
依赖: ros-kinetic-urdf-tutorial 但是它将不会被安装
E: 无法修正错误,因为您要求某些软件包保持现状,就是它们破坏了软件包间的依赖关系
解决:
在“软件和更新“里面,选中“更新”,将“从下列地点安装更新:”下面的选项都勾选中。
3、下载速度非常慢怎么办?
更改国内源 。
sudo cp /etc/apt/sources.list /etc/apt/sources.list.backup
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-proposed main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-proposed main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ bionic-backports main restricted universe multiverse
然后:
sudo apt-get update
sudo apt-get upgrade
如果update不完全,可以后缀--fix-missing
4、安装ROS时sudo rosdep init指令报错:
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.
The solution online is shit!!!
解决(以下方法依次执行,知道搞定:
(1)之前曾经安装过 ROS 系统的某个版本,按照提示删除已经存在的初始化文件即可:
sudo rm /etc/ros/rosdep/sources.list.d/20-default.list
(2)ca-certificates问题,证书不对,重新安装证书
sudo apt-get install ca-certificates
(3)系统时间同步问题,需要同步系统时间
sudo apt-get install ntpdate
sudo ntpdate cn.pool.ntp.org
sudo hwclock --systohc
(4)ssl certs问题
sudo c_rehash /etc/ssl/certs
sudo -E rosdep init
(5)python-rosdep问题
sudo apt-get install python-rosdep
(6)如果仍然无效,则直接在/etc目录下添加内容/ros/rosdep/sources.list.d/20-default.list
cd /ros/rosdep/sources.list.d(具体目录要看你的用户名)
sudo gedit 20-default.list
复制 https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/sources.list.d/20-default.list 里面的内容进去,保存,退出,重新执行sudo rosdep init。
如果上面的连接打不开,或者报错time out,说明你的网络有问题,翻个墙后重复上面的所有步骤。
三、注意
1、rosbag 回放包的时候往往加--clock,目的是使用虚拟时间。
否则有可能costmap无法显示,因为时间戳对不上