Ubuntu16.04 ROS及RealSense环境配置

文章目录

  • Ubuntu16.04 ROS及RealSense环境配置
    • 1.ROS Kinetic安装
    • 2.RealSenseSDK2.0安装
    • 3.ROS Wrapper安装

Ubuntu16.04 ROS及RealSense环境配置

官方文档ROS,RealSense,ROS Wrapper

1.ROS Kinetic安装

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

测试,按顺序分别在三个终端执行
roscore
rosrun turtlesim turtlesim_node
rosrun turtlesim turtle_teleop_key  //通过方向键控制小海龟

2.RealSenseSDK2.0安装

相机不连电脑, CMake>=3.8

uname -r  // 查询内核版本
sudo apt-get update  // 4.15内核不需要执行 sudo apt-get upgrade && sudo apt-get dist-upgrade
sudo apt-get install git libssl-dev libusb-1.0-0-dev pkg-config libgtk-3-dev libglfw3-dev
git clone https://github.com/IntelRealSense/librealsense.git

cd librealsense
./scripts/setup_udev_rules.sh
./scripts/patch-realsense-ubuntu-lts.sh
mkdir build && cd build
cmake ../ -DBUILD_EXAMPLES=true
sudo make uninstall && make clean && make -j8 && sudo make install

测试
realsense-viewer

3.ROS Wrapper安装

mkdir -p ~/catkin_ws/src && cd ~/catkin_ws/src/
sudo apt-get install ros-kinetic-ddynamic-reconfigure
git clone https://github.com/IntelRealSense/realsense-ros.git  // 涉及回滚,不要用本地的包
cd realsense-ros/
git checkout `git tag | sort -V | grep -P "^\d+\.\d+\.\d+" | tail -1`
cd ..
catkin_init_workspace
cd ..
catkin_make clean
catkin_make -DCATKIN_ENABLE_TESTING=False -DCMAKE_BUILD_TYPE=Release
catkin_make install
echo "source ~/catkin_ws/devel/setup.bash" >> ~/.bashrc
source ~/.bashrc

测试
roslaunch realsense2_camera rs_camera.launch

你可能感兴趣的:(Ubuntu16.04 ROS及RealSense环境配置)