Following Instruction from
http://wiki.ros.org/kinetic/Installation/Ubuntu
At 1.2
sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list'
change in
/etc/apt/sources.list.d/ros-latest.list
to
deb http://packages.ros.org/ros/ubuntu xenial main
keep going with 1.3
After building ROS successfully use catkin to build a workspace for the support of the velodyne driver as it’s not yet implemented in ROS library:
Install catkin first. If you are using ROS binary distribution Groovy or higher you may invoke:
sudo apt-get install ros-<your-rosdistro>-catkin
Otherwise install from source according to: http://wiki.ros.org/catkin?distro=indigo#Installing_catkin
To create catkin workspace, do:
source /opt/ros/kinetic/setup.bash mkdir -p ~/catkin_ws/src cd ~/catkin_ws/src
Next, download velodyne driver and create a catkin package with whatever packages your project is going to depend on. For additional information on creating catkin packages, see http://wiki.ros.org/catkin/Tutorials/CreatingPackage. According to this we create package „tutorial“, including ROS libraries std_msgs, rospy, roscpp:
git clone https://github.com/ros-drivers/velodyne.git catkin_create_pkg tutorial std_msgs rospy roscpp cd ..
In catkin_ws/ make sure all dependencies are installed.
rosdep install --from-paths src --ignore-src --rosdistro <your-rosditro> -y --os=<your-OS>
for example with Ubuntu Xenial and ROS-kinetic, do:
rosdep install --from-paths src --ignore-src --rosdistro kinetic -y --os=ubuntu:xenial
Then build in catkin_ws main directory and source the setup.bash
catkin_make source devel/setup.bash
If catkin_make fails with an error like this: Project ‚pcl_ros‘ specifies ‚/usr/include/hdf5/openmpi‘ as an include dir […] you can try to install libhdf5-openmpi-dev.
sudo apt-get install libhdf5-openmpi-dev
Should invoking catkin_make still fail, make sure you have openmpi installed properly.
After making your workspace, check if everything went well by calling the ROS_PACKAGE_PATH, which should look something like this:
echo $ROS_PACKAGE_PATH /home/youruser/catkin_ws/src:/opt/ros/kinetic/share
Include sourcing the setup.bash files in ~/.bashrc, so you don’t have to source them again and again in each terminal you are using (at some point you will most likely have to use some terminals simultaniously).
sudo nano ~/.bashrc
after password-prompt add the following at the end of the file:
# sources for ROS and catkin workspace source /opt/ros/<your-ROS-distro>/setup.bash source /<path-to-your-catkin_ws>/devel/setup.bash