libcanaero, a C++ library to access CAN Aerospace over UDP
INTRODUCTION
This library allows an easy, reliable and fast access to CAN aerospace over network. It uses UDP multicast to feed multiple clients with flight data from a variety of flight simulators. Currently Laminar Research X-Plane (R) and Microsoft Flight Simulator (R) are supported.
FEATURES
- Runs on Linux, Mac OS X and Windows
- No end-user configuration required
- Simulator data is normalized to the SI system
- Applications using libcanaero are agnostic of which simulator is providing data
- Strongly typed data access
PREREQUISITES
Linux
Make sure you have gcc 4.5 installed. It is most likely already part of your distribution, or available as a distribution package.
- The boost threading library version 1.45 is required.
To get it, go to https://sourceforge.net/projects/boost/files/boost/1.45.0/
- Unpack boost to your home folder.
- Open a terminal, navigate to the boost folder and run
- Run
sudo ./bjam install -q --layout=system --with-system --with-thread toolset=gcc variant=release link=static threading=multi
This places the boost libraries in /usr/local/lib and the boost headers in /usr/local/include.
- You may now delete the folder where you unpacked boost.
Mac OS X
- Install the developer tools from your OS X DVD.
- Users of 10.6 Snow Leopard skip to step 4.
- The 10.5 Leopard developer tools ship with gcc versions 4.01 and 4.2.1. Unfortunately 4.0.1 is set as default, which isn't very mature. So we set 4.2.1 as the default compiler. Open a terminal and run
cd /usr/bin
sudo rm cc gcc c++ g++
ln -s gcc-4.2 cc
ln -s gcc-4.2 gcc
ln -s c++-4.2 c++
ln -s g++-4.2 g++
cd
As usual sudo requires the password of your administrator account.
- The boost threading library version 1.45 is required.
To get it, go to https://sourceforge.net/projects/boost/files/boost/1.45.0/
- Unpack boost to your home folder.
- Open a terminal, navigate to the boost folder and run Ignore the Unicode/ICU support for boost.Regex?... not found message.
- Run
sudo ./bjam install -q --layout=system --with-system --with-thread toolset=darwin variant=release link=static threading=multi architecture=combined
This places the boost libraries in /usr/local/lib and the boost headers in /usr/local/include.
- You may now delete the folder where you unpacked boost.
Windows
- Get the gcc 4.4 compiler bundled with the Qt SDK 2010.05. Download it from ftp://ftp.qt.nokia.com/qtsdk/qt-sdk-win-opensource-2010.05.exe
- Install it with all options set to default, by just clicking "Continue".
- The boost threading library version 1.45 is required.
To get it, go to https://sourceforge.net/projects/boost/files/boost/1.45.0/
- Unpack boost to your home folder.
- Open Start->Programs->Qt SDK by Nokia v2010.05 (open source)->Qt Command Prompt
- Note:
- It won't work with the default commandline window, since the environment variables must be set to match the compiler. The Shortcut placed in the Qt SDK folder of the start menu does this conveniently.
- In this command window, navigate to the boost folder and run
- Run
bjam.exe install -q --layout=system --with-system --with-thread toolset=gcc variant=release link=static threading=multi
This places the boost libraries in C:\boost\lib and the boost headers in C:\boost\include.
- You may now delete the folder where you unpacked boost.
OTHER
Most platforms offer additional compiler environments than those listed above. In order to guarantee success with SCS on all platforms, using the above compiler environments is mandatory.
USAGE SUMMARY
- Include receiver.h and import the namespace SCS.
- Include ids.h to have a convenient access to all available IDs (data offered by SCS).
- Create a SCS::Receiver instance.
- Inform the receiver instance which data you want to receive from or send to the network.
- Call SCS::Receiver::run from your application's main loop.
- For more advanced usage, like publishing your own data or exposing modules to configuration services, you can create a class inheriting from Receiver.
- To do so, familiarize yourself with the SCS::Receiver class.
- Use one of the supplied Makefiles.xxx to build the application.
EXAMPLE
See the examples directory for the annotated "hello-scs" example that shows the basic concept. To compile it, use the supplied Makefiles.
Windows
- Open the Qt SDK command prompt Start->Programs->Qt SDK by Nokia v2010.05 (open source)->Qt Command Prompt
- Navigate to the hello-scs directory and run
mingw32-make -f Makefile.Win
Mac
- Open a terminal, navigate to the hello-scs directory and run
Linux
- Open a terminal, navigate to the hello-scs directory and run
NOTES
- For accessing Microsoft Flight Simulator (R), FSUIPC by Pete Dowson is required.
- Detailed specification of CAN Aerospace can be found at http://stockflightsystems.com
LICENSE
Copyright (C) 2008-2010 by Philipp Münzel. All rights reserved.
You are hereby granted the right to include an unmodified copy of libcanaero in binary form into your open- or closed-source, commercially or non-commercially licensed application.
Modifying your copy of libcanaero in any way is prohibited. Although some parts of libcanaero's source code (.h-files) are published, you are not allowed to modify these parts and/or create new binary distributions of libcanaero.
THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.