【SLAM】之ROS安装,配置与初试

我的系统是Ubuntu 15.04 Vivid, 安装ROS Jade。

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://ha.pool.sks-keyservers.net:80 --recv-key 0xB01FA116
sudo apt-get update
sudo apt-get install ros-jade-desktop-full
之后还需要安装模块用apt-get search ros-jade 可以看到全部列表。然后初始化rosdep:

sudo rosdep init
rosdep update
然后配置环境:

echo "source /opt/ros/jade/setup.bash" >> ~/.bashrc
source ~/.bashrc
安装rosinstall:

sudo apt-get install python-rosinstall
接下来检查一下配置环境:

>>> printenv | grep ROS
ROS_ROOT=/opt/ros/jade/share/ros
ROS_PACKAGE_PATH=/opt/ros/jade/share:/opt/ros/jade/stacks
ROS_MASTER_URI=http://localhost:11311
ROSLISP_PACKAGE_DIRECTORIES=
ROS_DISTRO=jade
ROS_ETC_DIR=/opt/ros/jade/etc/ros

现在环境配置完了,下面建立一个workspace:

mkdir -p ~/catkin_ws/src
cd ~/catkin_ws/src
catkin_init_workspace
然后跑一个LOAM SLAM的算法,先build:

cd ~/catkin_ws/src
git clone https://github.com/laboshinl/loam_velodyne.git
cd ~/catkin_ws
catkin_make -DCMAKE_BUILD_TYPE=Release
source ~/catkin/devel/setup.bash
然后运行:

roslaunch loam_velodyne loam_velodyne.launch
然后另起一个终端运行:

rosbag play ~/velodyne.bag
#or
roslaunch velodyne_pointcloud VLP16_points.launch pcap:="/home/phd/velodyne.pcap"

转载请注明:转自 http://blog.csdn.net/littlethunder/article/details/51920212








你可能感兴趣的:(SLAM)