Perparation & install
先在软件&更新,勾选源代码
,选择一个国内的源。
安装指北 http://wiki.ros.org/melodic/Installation/Ubuntu
1. 添加源
1
| sudo sh -c '. /etc/lsb-release && echo "deb http://mirrors.tuna.tsinghua.edu.cn/ros/ubuntu/ $DISTRIB_CODENAME main" > /etc/apt/sources.list.d/ros-latest.list'
|
2. 添加密钥
1
| sudo apt-key adv --keyserver 'hkp://keyserver.ubuntu.com:80' --recv-key C1CF6E31E6BADE8868B172B4F42ED6FBAB17C654
|
3. 更新一下源
4. 下载ros
1
| sudo apt install ros-melodic-desktop-full // 大概2g
|
5. 配置环境变量
1 2
| echo "source /opt/ros/melodic/setup.bash" >> ~/.bashrc source ~/.bashrc
|
6. 一些其他的依赖
1
| sudo apt install python-rosdep python-rosinstall python-rosinstall-generator python-wstool build-essential
|
7. 安装proto
1
| sudo apt install libprotobuf-dev protobuf-compiler
|
8. 安装nng
1 2 3 4 5 6
| git clone https://github.com/nanomsg/nng.git cd nng mkdir build cd build cmake .. cmake --build .
|
9. 更新cmake
1 2 3 4 5 6
| wget https://cmake.org/files/v3.13/cmake-3.13.5.tar.gz tar zxvf cmake-3.13.5.tar.gz cd cmake-3.13.5 ./configure make sudo make install
|
10. 安装json
1 2 3 4 5 6
| git clone https://github.com/nlohmann/json.git cd json mkdir build cd build cmake .. -DJSON_buildTest=ON cmake --build .
|
11. 安装pcap
1
| sudo apt install libpcap-dev
|
12. 安装gtsam
1 2 3 4 5 6 7
| git clone https://github.com/borglab/gtsam.git cd gtsam mkdir build cd build cmake .. make -j4 sudo make install
|
13. 创建ROS工作空间
1 2 3 4 5 6 7
| mkdir -p ~/catkin_ws/src cd ~/catkin_ws/src catkin_init_workspace cd ~/catkin_ws/ catkin_make -jl source devel/setup.bash echo $ROS_PACKAGE_PATH
|