Wednesday, 4 January 2017

Katana ROS drivers on Kinetic Kame.


NB. Editted 25/01/17 for a minor typo (Word capitalising a word it shouldn't have) and one step that needed to be moved (installing the rosdep dependencies needs to be done AFTER removing the unneeded/unsupported packages.)

Just before Christmas I decided to try out the current ROS version (Kinetic Kame), here at UCLan we've been running with Indigo for quite a while to avoid compatibility issues but I thought I'd give it a go.

Now installing the Katana drivers has never been straight forward, I've never got the instructions on the University of Osnabrück page to work and always ended up trawling through missing dependencies but they've been updated for Jade so how painful could it really be ?

Well...  teeth have been pulled, chickens sacrificed and elder gods appeased, and I present to anyone interested my install guide.

Bits in bold need typing in.

Usual disclaimers, it works for me, may not for you, may have some redundant steps and packages that aren't fully needed, don't copy and paste it as it was written up in Word as an internal doc, may cause depression and occasional bleeding.  Worked at the end of 2016.
If anyone has a simpler way please (for the love of sanity) say so in the comments.

ROS / Katana Stack Install Guide.
This presumes a standard Ubuntu install to begin with.
This document will document install of Kinetic Kame and the Katana drivers from University of Osnabrück.

Standard warning : Do not copy and paste command line instructions from this document.  This document was written in MS Word and uses a different character set than the standard ANSI.
Following instructions from standard ROS install from wiki.ros.org/kinetic/Installation/Ubuntu:
First set ROS repositories. 

sudo sh -c ‘echo “deb http://packages .ros.org/ros/ubuntu $(lsb_release -sc) main” > /etc/apt/sources.list.d/ros-lastest.list’
Get the appropriate keys.
sudo apt-key adv --keyserver hkp://ha.pool.sks-keyservers.net:80 -- recv-key 0xB01FA116
Update the Ubuntu package list.
sudo apt-get update
Finally install the full standard ROS setup.
sudo apt-get install ros-kinetic-desktop-full
Next we need to initialise rosdep.
sudo rosdep init
rosdep update
Setting up bash for ROS use.
echo “source /opt/ros/kinetic/setup.bash” >> ~/.bashrc
source ~/.bashrc
Check that the lines above entered the line below into your ~/.bashrc file (it occasionally doesn’t seem to work) if it hasn’t (should be the last line) edit it manually.
source /opt/ros/kinetic/setup.bash
Installing rosinstall.
sudo apt-get install python-rosinstall
ROS should now be installed and setup.
Next installing Katana drivers.
Make a directory for the drivers
mkdir -p ~/ros-kinetic/src/
Move to that directory.
cd ~/ros-kinetic/src
Here is where we deviate from the on-line install instructions, there are a few things to install separately.
sudo apt-get install build-essential
sudo apt-get install ros-kinetic-ivcon
sudo apt-get install ros-kinetic-convex-decomposition
sudo apt-get install ros-kinetic-navigation
sudo apt-get install python-catkin-tools
sudo apt-get install ros-kinetic-gazebo-ros-control
sudo apt-get install ros-kinetic-ros-control
sudo apt-get install ros-kinetic-ros-controllers
sudo apt-get install ros-kinetic-sound-play
sudo apt-get install ros-kinetic-joystick-drivers
sudo add-apt-repository ppa:kbs/kbs
sudo apt-get update
sudo apt-get install libepos2-dev
sudo apt-get install ros-kinetic-slam-gmapping
sudo apt-get install ros-kinetic-frontier-exploration
sudo apt-get install libarmadillo-dev
sudo apt-get install ros-kinetic-moveit
sudo apt-get install ros-kinetic-moveit-python

Next download the Katana University of Osnabruck stack.
wstool init
wstool merge https://raw.githubusercontent.com/uos/uos_rosinstalls/master/uos-public-indigo-wet.rosinstall
wstool update
Next install dependencies.
rosdep update


The UoS stack contains driver we don’t need that have dependencies that haven’t been updated for ROS Kinetic yet so at this point we need to delete some directories :
cd  ~/ros-kinetic/src
sudo rm -rf calvin_robot
sudo rm -rf calvin_navigation
sudo rm -rf kurt_driver
sudo rm -rf robot_self_filter
sudo rm -rf uos_rotunit
There is now a change needed to one of the packages :
cd ~/ros-kinetic/src/uos_tools/rotunit_snapshotter
Inside this directory there is a CMakeList.txt file, open it in a text editor using sudo and add the following line to the very end of it :
include_directories(${catkin_INCLUDE_DIRS})

Kinetic has moved to a minimum C++11 standard which seems to cause some issues, we need to make a change to one of the ROS header files :
cd /opt/ros/kinetic/include /moveit/macros/
sudo edit the file declare_ptr.h
In the file where the anywhere the code says :
typedef std::shared_ptr…
Replace std:: with boost::

Install the rosdep dependencies.

rosdep install --from-paths ./ -i -y --rosdistro kinetic


Next build the Katana packages
cd ~/ros-kinetic/src
catkin_init_workspace
cd ..
catkin_make
. ~/ros-kinetic/devel/setup.bash

Setting up the user to use USB port.
Add user to dialout group (where <username> is your username:
sudo gpasswd -a <username> dialout
The following needs to be done everytime the machine is booted so it is worth putting in a bash script :
cd /dev
sudo rm ttyS0
sudo ln /dev/ttyUSB0 /dev/ttyS0
sudo chmod 666 /dev/ttyS0
sudo chown root:dialout /dev/ttyS0

Add the katana type into the .bashrc shell script with the following line :
export KATANA_TYPE=”katana_300_6m180”



No comments:

Post a Comment