Boost >= 1.46.1
If your system is missing a suitable boost installation, you can download and extract the latest Boost release from http://www.boost.org/ and specify its path using the following catkin/CMake argument:
-DBOOST_ROOT=/path/to/boost
ROS >= Jade Turtle
This is only needed for ROS Bridge. You can compile without ROS using the following CMake argument:
-DNO_ROS=On
Doxygen >= 1.8.7 and Graphviz >= 2.36.0
This is only needed for compiling the documentation.
If your OS is Ubuntu 14.04 / Linux Mint 17.3 or newer, you can install all requirements with the following commands:
The following CMake/Catkin arguments are available:
-DDRIVER=<name>
Specify the driver to compile and use. At the moment, the following drivers are available: lincan, peak_linux, serial, socket, virtual, dummy.
-DBUILD_DRIVERS=<;-separated-list of names>
Semicolon-separated list of additional CAN drivers to build. You can use the same values as for DRIVER.
-DBUILD_ALL_DRIVERS=On
Build all available drivers.
-DPCAN_PREFIX=<path>
Path to the PCAN drivers needed by the peak_linux driver. See Drivers section.
-DEXHAUSTIVE_DEBUGGING=On
Enable exhaustive debugging.
-DNO_ROS=On
Exclude anything depending on ROS.
-DINSTALL_EXAMPLES=On
Install example programs when running make install.
-DSDO_RESPONSE_TIMEOUT_MS=<timeout>
Timeout in milliseconds when waiting for an SDO response.
-DCONSECUTIVE_SEND_PAUSE_MS=<timeout>
Pause between two consecutively sent CAN frames in milliseconds.
If your ROS installation is fresh you shoud first initialize it like described here.
You will need a Catkin workspace:
KaCanOpen without the ROS part can be built easily using CMake:
Replace <driver>
by a CAN driver name (see section Drivers).
Your KaCanOpen repository must reside or be symlinked inside src:
Now you can build it:
Replace <driver>
by a CAN driver name (see section Drivers).
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:
Otherwise just run them from build/examples/
:
KaCanOpen provides several CAN drivers (currently only for Linux).
socket (default)
For use with SocketCAN, formerly known as LLCF. It's a CAN networking stack being part of the Linux kernel. It's probably the most popular CAN driver infrastructure and there are many devices supporting SocketCAN.
One of them is USBtin, which we use for development purposes. If you want to use USBtin with KaCanOpen just run dev/init_usbtin.sh.
Use "slcan0" and "500K" as arguments for Core.start(busname,baudrate) / Master.start(busname,baudrate).
serial
Driver for use with serial character devices.
virtual
This driver can be used without any CAN hardware. It spans a virtual CAN network using POSIX pipes.
peak_linux
For use with CAN hardware by PEAK-System. You will need PCAN drivers installed for successful compilation:
wget http://www.peak-system.com/fileadmin/media/linux/files/peak-linux-driver-7.15.2.tar.gz tar -xzf peak-linux-driver-7.15.2.tar.gz mv peak-linux-driver-7.15.2 ~/peak cd ~/peak make
Then build KaCanOpen with the CMake/Catkin flag -DPCAN_PREFIX="~/peak"
. You can replace ~/peak
as you wish.
lincan
For use with LinCan kernel drivers.
You can also use any driver from the CanFestival, as they are binary-compatible. They also have Windows drivers.