安装相关依赖
sudo apt install ninja-build exiftool ninja-build protobuf-compiler libeigen3-dev genromfs xmlstarlet libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev python-pip python3-pip
---------------------------------------------------------------------------------------------------------------
pip2 install pandas jinja2 pyserial cerberus pyulog==0.7.0 numpy toml pyquaternion empy pyyaml
---------------------------------------------------------------------------------------
pip3 install packaging numpy empy toml pyyaml jinja2 pyargparse
ROS下载
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'
设置KEY
sudo apt-key adv --keyserver 'hkp://keyserver.ubuntu.com:80' --recv-key C1CF6E31E6BADE8868B172B4F42ED6FBAB17C654
下载ROS
sudo apt update
sudo apt install ros-melodic-desktop
环境设置
(1)echo “source /opt/ros/melodic/setup.bash” >> ~/.bashrc
即将 source /opt/ros/melodic/setup.bash 添加到当前用户(也就是你的用户)的 .bashrc 文件末尾。
(2)让你的修改生效
source ~/.bashrc
构建软件包之间的关系
sudo apt install python-rosdep python-rosinstall python-rosinstall-generator python-wstool build-essential
ROS更新
(1)sudo apt install python-rosdep
(2)sudo rosdep init
(3)rosdep update
启动ROS
终端输出roscore命令
我们利用小乌龟来实验
(1)新开一个终端输入:
(1) rosrun turtlesim turtlesim_node
**继续新开一个终端输出如下指令:(2) rosrun turtlesim turtle_teleop_key
到这里就成功了
----------------------------------------------------------------------------------------------
当中,你会遇到的问题
错误1:bash: /opt/ros/melodic/setup.bash: No such file or directory
解决办法一:卸载ROS出重新安装
解决办法二:
参考解决办法1
参考解决办法2
错误2:error processing /var/cache/apt/archives/python-apport_2.0.1-0ubuntu9_all.deb
解决办法1
解决办法2我个人是此种办法解决的。
写到最后,配置环境中每个人会遇到不同的问题,遇到问题在于耐心解决,见招拆招,冷静应对,最后希望大家一切顺利。