Installation
Using CMake
Install CMake and a C++ compiler that supports C++17.
Create a build directory and navigate into it:
mkdir build cd build
Run CMake to configure the project:
cmake ..Build the project:
cmake --build .
Optionally, install the library and tools:
sudo cmake --install .
Using Colcon
The repository is a valid Colcon package. To build it put the package in your Colcon workspace and build the workspace.
CAN interface setup
For CAN interfaces supported by the Linux kernel (e.g. Peak CAN interfaces), configure the interface using systemd. Create /etc/systemd/network/80-can.network, with the following configuration for can0:
[Match] Name=can0 [CAN] BitRate=1000K RestartSec=100ms
After setting up CAN interface, restart networking:
sudo systemctl restart systemd-networkd.service
Note
If you are running the API or derived driver in a Docker container, you have to perform the bove steps in the host system. You also need to run the container with –network host option to allow the container to access the host CAN interface.