KaCanOpen
 All Classes Functions Variables Typedefs Enumerations Pages
Build Instructions

Requirements

If your OS is Ubuntu 14.04 / Linux Mint 17.3 or newer, you can install all requirements with the following commands:

sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -usc) main" > /etc/apt/sources.list.d/ros-latest.list'
sudo apt-key adv --keyserver hkp://pool.sks-keyservers.net:80 --recv-key 0xB01FA116
sudo apt-add-repository ppa:george-edison55/cmake-3.x
sudo apt-get update
sudo apt-get install ros-jade-ros-base cmake clang-3.6 libboost-all-dev doxygen graphviz
sudo apt-get install cmake clang-3.6 libboost-system-dev libboost-filesystem-dev ros-jade-catkin ros-jade-roscpp ros-jade-std-msgs ros-jade-sensor-msgs ros-jade-message-runtime doxygen graphviz

CMake/Catkin Arguments

The following CMake/Catkin arguments are available:

Initialize ROS and create Catkin workspace

If your ROS installation is fresh you shoud first initialize it like described here.

sudo rosdep init
rosdep update
echo "source /opt/ros/jade/setup.bash" >> ~/.bashrc
source ~/.bashrc

You will need a Catkin workspace:

mkdir ~/arbitrary_path/catkin_ws
cd ~/arbitrary_path/catkin_ws
mkdir src
cd src
catkin_init_workspace

Build process without ROS Bridge

KaCanOpen without the ROS part can be built easily using CMake:

git clone https://github.com/KITmedical/kacanopen.git
cd kacanopen
mkdir build
cd build
cmake -DDRIVER=<driver> -DNO_ROS=On ..
make

Replace <driver> by a CAN driver name (see section Drivers).

Build process including ROS Bridge

Your KaCanOpen repository must reside or be symlinked inside src:

cd ~/arbitrary_path/catkin_ws/src
git clone https://github.com/KITmedical/kacanopen.git

Now you can build it:

catkin_make -DDRIVER=<driver>

Replace <driver> by a CAN driver name (see section Drivers).

Examples

There are several examples on how to use KaCanOpen. Source files are in the examples/ dictionary.

When building with Catkin, you can excute example programs like that:

cd your_catkin_workspace
source devel/setup.bash
rosrun kacanopen kacanopen_example_motor_and_io_bridge # roscore needs to be running

Otherwise just run them from build/examples/:

./build/examples/kacanopen_example_listdevices

Drivers

KaCanOpen provides several CAN drivers (currently only for Linux).

You can also use any driver from the CanFestival, as they are binary-compatible. They also have Windows drivers.