选择一个最快的服务器
ROS wiki
打开终端,输入以下
sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list'
sudo apt-key adv --keyserver 'hkp://keyserver.ubuntu.com:80' --recv-key C1CF6E31E6BADE8868B172B4F42ED6FBAB17C654
sudo apt-get update
sudo apt-get install ros-kinetic-desktop-full
sudo rosdep init
rosdep update
echo "source /opt/ros/kinetic/setup.bash" >> ~/.bashrc
source ~/.bashrc
sudo apt install python-rosinstall python-rosinstall-generator python-wstool build-essential
如果出现安装源问题:
下列软件包有未满足的依赖关系:
ros-kinetic-desktop-full : 依赖: ros-kinetic-desktop 但是它将不会被安装
依赖: ros-kinetic-perception 但是它将不会被安装
依赖: ros-kinetic-simulators 但是它将不会被安装
依赖: ros-kinetic-urdf-tutorial 但是它将不会被安装
E: 无法修正错误,因为您要求某些软件包保持现状,就是它们破坏了软件包间的依赖关系
选择中科大源
首先在设置–更新里选择中科大http://mirrors.ustc.edu.cn
的源
sudo sh -c '. /etc/lsb-release && echo "deb http://mirrors.ustc.edu.cn/ros/ubuntu/ $DISTRIB_CODENAME main" > /etc/apt/sources.list.d/ros-latest.list'
然后运行:
sudo gedit /etc/apt/sources.list
确保里面的内容是如下:
deb http://archive.ubuntu.com/ubuntu xenial main universe restricted multiverse
deb-src http://archive.ubuntu.com/ubuntu xenial main universe restricted multiverse #Added by software-properties
deb http://security.ubuntu.com/ubuntu/ xenial-security main restricted multiverse universe
deb http://archive.ubuntu.com/ubuntu xenial-updates main restricted multiverse universe
然后保存,关闭,继续正常安装
sudo apt-key adv --keyserver 'hkp://keyserver.ubuntu.com:80' --recv-key C1CF6E31E6BADE8868B172B4F42ED6FBAB17C654
sudo apt-get update
sudo apt-get install ros-kinetic-desktop-full
sudo rosdep init
rosdep update
echo "source /opt/ros/kinetic/setup.bash" >> ~/.bashrc
source ~/.bashrc
sudo apt install python-rosinstall python-rosinstall-generator python-wstool build-essential
roscore
测试是否成功,终端输入:
roscore
vectormath
参考安装python科学计算环境安装pip
sudo apt-get install python-pip
sudo apt-get install python-dev
参考pypi.org安装vectormath包
pip install vectormath
注意 :大部分的科学计算包。例如PyGeodesy
等,都是通过pip install
这个命令去安装的。
如果apt-get install
失败了,马上考虑使用pip install
命令尝试。
vectormath
使用简介
import numpy as np
import vectormath as vmath
# Single Vectors
v = vmath.Vector3(5, 0, 0)
v.normalize()
print(v) # >> [1, 0, 0]
print(v.x) # >> 1.0
# VectorArrays are much faster than a for loop over Vectors
v_array = vmath.Vector3Array([[4, 0, 0], [0, 2, 0], [0, 0, 3]])
print(v_array.x) # >> [4, 0, 0]
print(v_array.length) # >> [4, 2, 3]
print(v_array.normalize()) # >> [[1, 0, 0], [0, 1, 0], [0, 0, 1]]
# Vectors can be accessed individually or in slices
print(type(v_array[1:])) # >> vectormath.Vector3Array
print(type(v_array[2])) # >> vectormath.Vector3
# All these classes are just numpy arrays
print(isinstance(v, np.ndarray)) # >> True
print(type(v_array[1:, 1:])) # >> numpy.ndarray
gazebo9
确认版本
gazebo -v
安装最新版本的gezebo 9
curl -sSL http://get.gazebosim.org | sh
gazebo9
最后确认以一下版本号
lk@Mibook:~$ gazebo -v
Gazebo multi-robot simulator, version 9.9.0
Copyright (C) 2012 Open Source Robotics Foundation.
Released under the Apache 2 License.
http://gazebosim.org
map-server
apt-get install ros-kinetic-map-server
首先生成密钥,把id_rsa.pub
添加到公钥
ssh-keygen -t rsa -C "[email protected]"
gedit id_rsa.pub
然后git clone
git clone [email protected]:xiaokai1996/ROS-Academy-for-Beginners.git
参考资料
https://github.com/xiaokai1996/ROS-Academy-for-Beginners
https://sychaichangkun.gitbooks.io/ros-tutorial-icourse163/content/