danny wang a136536ff5 watchrobot first commit | преди 2 години | |
---|---|---|
.. | ||
dsdl | преди 2 години | |
libuavcan | преди 2 години | |
libuavcan_drivers | преди 2 години | |
tools | преди 2 години | |
.gitignore | преди 2 години | |
.gitmodules | преди 2 години | |
.travis.yml | преди 2 години | |
CMakeLists.txt | преди 2 години | |
LICENSE | преди 2 години | |
README.md | преди 2 години |
Portable reference implementation of the UAVCAN protocol stack in C++ for embedded systems and Linux.
UAVCAN is a lightweight protocol designed for reliable communication in aerospace and robotic applications via CAN bus.
Note that this reporitory includes Pyuavcan as a submodule. Such inclusion enables the library to be built even if pyuavcan is not installed in the system.
git clone https://github.com/UAVCAN/libuavcan
cd libuavcan
git submodule update --init
If this repository is used as a git submodule in your project, make sure to use --recursive
when updating it.
This is only needed if the library is used in a Linux application.
mkdir build
cd build
cmake .. # Default build type is RelWithDebInfo, which can be overriden if needed.
make -j8
sudo make install
For cross-compiling with CMake the procedure is similar (assuming that you have the toolchain file,
Toolchain-stm32-cortex-m4.cmake
in this example).
If you're using Make, please refer to the documentation.
For embedded ARM targets, it is recommended to use GCC ARM Embedded;
however, any other standard-compliant C++ compiler should also work.
mkdir build
cd build
cmake .. -DCMAKE_TOOLCHAIN_FILE=../cmake/Toolchain-stm32-cortex-m4.cmake
make -j8
The following components will be installed into the system:
libuavcan_dsdlc
)libuavcan_dsdl_compiler
)Pyuavcan will not be installed into the system together with the library; you'll need to install it separately. The installed DSDL compiler will not function unless pyuavcan is installed.
Despite the fact that the library itself can be used on virtually any platform that has a standard-compliant C++03 or C++11 compiler, the library development process assumes that the host OS is Linux.
Prerequisites:
cppcheck
)Building the debug version and running the unit tests:
mkdir build
cd build
cmake .. -DCMAKE_BUILD_TYPE=Debug
make
Test outputs can be found in the build directory under libuavcan
.
Note that unit tests must be executed in real time, otherwise they may produce false warnings;
this implies that they will likely fail if ran on a virtual machine or on a highly loaded system.
Contributors, please follow the Zubax Style Guide.
An Eclipse project can be generated like that:
cmake ../../libuavcan -G"Eclipse CDT4 - Unix Makefiles" \
-DCMAKE_ECLIPSE_VERSION=4.3 \
-DCMAKE_BUILD_TYPE=Debug \
-DCMAKE_CXX_COMPILER_ARG1=-std=c++11
Path ../../libuavcan
in the command above points at the directory where the top-level CMakeLists.txt
is located;
you may need to adjust this per your environment.
Note that the directory where Eclipse project is generated must not be a descendant of the source directory.
First, get the Coverity build tool. Then build the library with it:
export PATH=$PATH:<coverity-build-tool-directory>/bin/
mkdir build && cd build
cmake <uavcan-source-directory> -DCMAKE_BUILD_TYPE=Debug
cov-build --dir cov-int make -j8
tar czvf uavcan.tgz cov-int
Then upload the resulting archive to Coverity.
Automatic check can be triggered by pushing to the branch coverity_scan
.