Go to file
Paul Dino Jones e29cc12ab4 Fix compilation issues for arduino devices 2024-03-05 00:34:29 -05:00
conf Updated config for new pulseaudio backend 2023-11-13 07:46:04 +00:00
src Fix compilation issues for arduino devices 2024-03-05 00:34:29 -05:00
tests Updated to new release of simapi 2023-07-14 20:18:24 +00:00
udev Major refactor. Adding sim wind 2023-05-17 15:56:57 +00:00
.gitignore monocoque initial commit 2022-10-31 15:11:02 +00:00
.gitmodules Update .gitmodules 2023-09-29 12:12:47 -04:00
.valgrindrc monocoque initial commit 2022-10-31 15:11:02 +00:00
CMakeLists.txt Adding pulseaudio backend 2023-11-11 18:19:39 +00:00
LICENSE.rst Moved to GPLv3 2022-12-23 22:42:37 +00:00
README.md Add makefiles for arduino and related documentation 2024-02-27 17:36:02 -05:00

README.md

Monocoque

___   |/  /____________________________________ ____  ______ 
__  /|_/ /_  __ \_  __ \  __ \  ___/  __ \  __ `/  / / /  _ \
_  /  / / / /_/ /  / / / /_/ / /__ / /_/ / /_/ // /_/ //  __/
/_/  /_/  \____//_/ /_/\____/\___/ \____/\__, / \__,_/ \___/ 
                                           /_/

Cross Platform device manager for driving and flight simulators, for use with common simulator software titles.

Features

  • Updates at 120 frames per seconds.
  • Modular design for support with various titles and devices.
  • Supports bass shakers, tachometers, simlights, simwind etc, through usb and arduino serial.
  • Tachometer support is currently limited to the Revburner model. Supports existing revburner xml configuration files.
  • Includes utility to configure revburner tachometer
  • Can send data to any serial device. So far only tested with arduino. Includes sample arduino sketch for sim lights.
  • The support for haptic bass shakers is limited and needs the most work. So far the engine rev is a simple sine wave, which I find convincing. The gear shift event works but not convincing enough for me.
  • Choice of Portaudio or Pulseaudio backend.

Dependencies

  • libserialport - arduino serial devices
  • hidapi - usb hid devices
  • libusb - used by hidapi
  • portaudio - sound devices (haptic bass shakers)
  • pulseaudio - sound devices (haptic bass shakers)
  • libenet - UDP support (not yet implemented)
  • libxml2
  • argtable2
  • libconfig
  • slog (static)
  • simshmbridge - for sims that need shared memory mapping like AC and Project Cars related.
  • simapi

Building

This code depends on the shared memory data headers in the simapi repo. When pulling lastest if the submodule does not download run:

git submodule sync --recursive
git submodule update --init --recursive

Then to compile simply:

mkdir build; cd build
cmake ..
make

to use the pulseaudio backend use this cmake command

cmake -DUSE_PULSEAUDIO=YES ..

Using Arduino Devices

Currently Monocoque supports simwind and shiftlights through the included arduino sketches which have been tested on Uno boards. The simwind controller requires a Motor shield.

There are included Makefiles for each controller. For now, the makefiles expect the device to be attached at /dev/ttyACM0. So unplug both controllers, and then plug in just the controller you're updating to ensure the correct controller is at /dev/ttyACM0.

To compile and upload these sketches, the Makefiles use arduino-cli. Unfortunately it seems some distributions such as debian do not include this in the repositories. If this is the case follow the install instructions here:

https://arduino.github.io/arduino-cli/0.35/installation/

You may have to download the core libraries, it will prompt you to do so if you do not have them and you go further

arduino-cli core install arduino:avr

Then for shiftlights navigate to included shiftlight directory ( be sure only the shiftlight controller is plugged into the machine and is available at /dev/ttyACM0 ) and

arduino-cli lib install FastLED
make

Then for simwind navigate to the included simwind directory ( be sure only the simwind controller is plugged into the machine and is available at /dev/ttyACM0 ) and

ARDUINO_LIBRARY_ENABLE_UNSAFE_INSTALL=true arduino-cli lib install --git-url https://github.com/adafruit/Adafruit_Motor_Shield_V2_Library.git
ARDUINO_LIBRARY_ENABLE_UNSAFE_INSTALL=true arduino-cli lib install --git-url https://github.com/adafruit/Adafruit_BusIO.git
make

Testing

Static Analysis

    mkdir build; cd build
    make clean
    cmake -Danalyze=on ..
    make

Valgrind

    cd build
    valgrind -v --leak-check=full --show-leak-kinds=all --suppressions=../.valgrindrc ./monocoque play

ToDo

  • windows port
  • more memory testing
  • move config code around
  • cleanup tests which are basically just copies of the example from their respective projects
  • much, much more