资料:
https://wiki.ros.org/kinetic/Installation/Ubuntu
https://blog.csdn.net/qq_44339029/article/details/120579608
装VM。
装ubuntu20.04 desktop.iso系统。
装vm工具:
sudo apt update
sudo dpkg --configure -a
sudo apt-get autoremove open-vm-tools
sudo apt-get install open-vm-tools -y
sudo apt-get install open-vm-tools-desktop -y
重启虚拟机。
断网修复:
sudo rmmod e1000
sudo rmmod e1000e
sudo rmmod igb
sudo modprobe e1000
sudo modprobe e1000e
sudo modprobe igb
sudo dhclient ens33
sudo apt-get update && sudo apt-get upgrade
sudo apt-get purge network-manager
sudo apt-get install network-manager
进root:
sudo -i
apt install vim -y
增加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'
更换秘钥:
sudo apt-key adv --keyserver 'hkp://keyserver.ubuntu.com:80' --recv-key C1CF6E31E6BADE8868B172B4F42ED6FBAB17C654
更新软件源:
sudo apt update
安装ros:
sudo apt install ros-noetic-desktop-full -y
完成后是这样:
sudo apt install python3-rosdep2
vim /etc/hosts
通过IPAddress.com首页,输入raw.githubusercontent.com查询到最新的真实IP地址
185.199.108.133 raw.githubusercontent.com
rosdep init
echo "source /opt/ros/noetic/setup.bash" >> ~/.bashrc
source ~/.bashrc
安装rosinstall
sudo apt install python3-rosinstall python3-rosinstall-generator python3-wstool -y
可以看到:
验证ROS是否安装成功
sudo apt install python3-roslaunch
sudo apt install ros-noetic-desktop-full
roscore
正常会出现:
这样就是不正常:
做实验:
cd ~
sudo apt install python3-catkin-tools python3-osrf-pycommon
source /opt/ros/noetic/setup.bash
mkdir -p /root/catkin_ws/src
cd /root/catkin_ws/src # 很重要!
catkin_create_pkg ad_sensor_package roscpp std_msgs
cd /root/catkin_ws
catkin_make
一定要注意我的执行顺序,最后一句catkin_make构建工作空间后是这样:
获取源码:
cd ~/catkin_ws/src/
git clone https://github.com/6-robot/wpb_cv.git
git clone https://github.com/orbbec/ros_astra_camera.git
# git clone https://github.com/orbbec/ros_astra_launch.git # 要权限!!??
git clone https://github.com/tfoote/ros_astra_launch.git
git clone https://github.com/ros-drivers/rgbd_launch.git
修改settings.yam:
cd /root/catkin_ws/src/wpb_cv/wpb_cv_bringup/config
再次构建:
apt install python3-rosdep2 --fix-missing
sudo apt install ros-noetic-rostest
sudo apt-get install ros-noetic-tf
sudo apt-get install ros-noetic-joy -y
sudo apt-get install ros-noetic-hector-mapping -y
sudo apt-get install ros-noetic-gmapping -y
sudo apt-get install ros-noetic-navigation -y
sudo apt-get install ros-noetic-sound-play -y
sudo apt-get install ros-noetic-astra-camera -y
sudo apt-get install ros-noetic-astra-launch -y
sudo apt-get install ros-noetic-depthimage-to-laserscan -y
sudo apt-get install ros-noetic-libuvc -y
cd /root/catkin_ws
catkin_make
启动节点:
roslaunch wpb_cv_bringup minimal.launch