Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

Portable reference implementation of the UAVCAN protocol stack in C++ for embedded systems and Linux.

License

NotificationsYou must be signed in to change notification settings

Formlabs/libuavcan

 
 

Repository files navigation

Coverity ScanTravis CIGitter

Portable reference implementation of theUAVCAN protocol stack in C++ for embedded systemsand Linux.

UAVCAN is a lightweight protocol designed for reliable communication in aerospace and robotic applications via CAN bus.

Documentation

Library usage

Dependencies

  • Python 2.7 or 3.3 or newer

Note that this reporitory includesPyuavcan as a submodule.Such inclusion enables the library to be built even if pyuavcan is not installed in the system.

Cloning the repository

git clone https://github.com/UAVCAN/libuavcancd libuavcangit submodule update --init

If this repository is used as a git submodule in your project, make sure to use--recursive when updating it.

Using in a Linux application

Libuavcan can be built as a static library and installed on the system globally as shown below.

mkdir buildcd buildcmake ..# Default build type is RelWithDebInfo, which can be overriden if needed.make -j8sudo make install

The following components will be installed:

  • Libuavcan headers and the static library
  • Generated DSDL headers
  • Libuavcan DSDL compiler (a Python script namedlibuavcan_dsdlc)
  • Libuavcan DSDL compiler's support library (a Python package namedlibuavcan_dsdl_compiler)

Note that Pyuavcan (an implementation of UAVCAN in Python) will not be installed.You will need to install it separately if you intend to use the Libuavcan's DSDL compiler in your applications.

It is also possible to use the library as a submodule rather than installing it system-wide.Please refer to the example applications supplied with the Linux platform driver for more information.

Using with an embedded system

For ARM targets, it is recommended to useGCC ARM Embedded;however, any other standard-compliant C++ compiler should also work.

With Make

Please refer to thedocumentation at the UAVCAN website.

With CMake

In order to cross-compile the library with CMake, please follow the below instructions.You will need to provide a CMake toolchain file,Toolchain-stm32-cortex-m4.cmake in this example.If you're not sure what a toolchain file is or how to prepare one, these instructions are probably not for youruse case; please refer to the section about Make instead.

mkdir buildcd buildcmake .. -DCMAKE_TOOLCHAIN_FILE=../cmake/Toolchain-stm32-cortex-m4.cmakemake -j8

Library development

Despite the fact that the library itself can be used on virtually any platform that has a standard-compliantC++11 compiler, the library development process assumes that the host OS is Linux.

Prerequisites:

  • Google test library for C++ - gtest (dowloaded as part of the build fromgithub)
  • C++11 capable compiler with GCC-like interface (e.g. GCC, Clang)
  • CMake 2.8+
  • Optional: static analysis tool for C++ - cppcheck (on Debian/Ubuntu use packagecppcheck)

Building the debug version and running the unit tests:

mkdir buildcd buildcmake .. -DCMAKE_BUILD_TYPE=Debugmake -j8make ARGS=-VVtest

Test outputs can be found in the build directory underlibuavcan.

Note that unit tests suffixed with "_RealTime" 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 theZubax C++ Coding Conventions.

Vagrant

Vagrant can be used to setup a compatible Ubuntu virtual image. Follow the instructions onVagrantup to install virtualbox and vagrant then do:

vagrant upvagrant sshmkdir buildcd buildmkdir build&&cd build&& cmake .. -DCMAKE_BUILD_TYPE=Debug -DCONTINUOUS_INTEGRATION_BUILD=1

Note that -DCONTINUOUS_INTEGRATION_BUILD=1 is required for this build as the realtime unit tests will not work on a virt.

You can build using commands like:

vagrant ssh -c"cd /vagrant/build && make -j4 && make test"

or to run a single test:

vagrant ssh -c"cd /vagrant/build && make libuavcan_test && ./libuavcan/libuavcan_test --gtest_filter=Node.Basic"

Developing with Eclipse

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-levelCMakeLists.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.

Submitting a Coverity Scan build

First,get the Coverity build tool. Then build the library with it:

export PATH=$PATH:<coverity-build-tool-directory>/bin/mkdir build&&cd buildcmake<uavcan-source-directory> -DCMAKE_BUILD_TYPE=Debugcov-build --dir cov-int make -j8tar czvf uavcan.tgz cov-int

Then upload the resulting archive to Coverity.

Automatic check can be triggered by pushing to the branchcoverity_scan.

About

Portable reference implementation of the UAVCAN protocol stack in C++ for embedded systems and Linux.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C++93.7%
  • Python4.6%
  • CMake1.1%
  • Other0.6%

[8]ページ先頭

©2009-2025 Movatter.jp