Anemomind: a sailing data recording, visualization and analysis solution.
- a web server (visible on anemolab and Regatta Polar)
- an optional onboard computer system (called 'anemobox')
- c++ code to compute performance statistics and predictions
- an iOS app.
The solution is described on Anemomind web site.
- visualize sailing logs, including wind data on a web page.
- works on mobile.
- automatic true-wind calibration based on uploaded logs.
- computes VMG performance estimations based on logged data.
- supports NMEA0183, NMEA 2000, and other formats.
The easiest is to test it on anemolab. Simply create an account, create a boat, and upload some data.
If you want to test it on your local machine, the easiest is to use docker-compose, see below.
- For the C++ processing code, start by reading the main processing function.
- For the anemobox (the embedded device), see the nodejs entry point.
- The web server is there
- The angular js web client code is here for anemolab and there for Regatta Polar.
- The iOS app is not is this repo. The code will be published soon.
You can contact me at [email protected] and send questions.
The following process use existing docker images to start running the web server.
- Install docker.
- Install docker-compose.
git clone https://github.com/jpilet/anemomind.git
- Run
./src/bootstrap-docker-compose.sh
from the anemomind directory. - Wait a bit, and browse to http://localhost:9000/.
To build the docker images, use ./src/build_docker_prod.sh <tag>
The following command will build a docker image and compile all the c++ code.
./src/compile_in_docker.sh
You can run any command in the development environment with:
./src/docker_run.sh <docker flags> <command>
For example:
./src/docker_run.sh -it bash
will open a shell in which you can type make -j8 && make test
.
vagrant up
vagrant provsion (should be done first time only or if you make any changes in vagrant file)
vagrant ssh
To build the cpp code in release mode:
mkdir build_release
cd build_release
cmake .. -DCMAKE_BUILD_TYPE=RelWithDebInfo
make -j$(nproc)
If you get a compilation error, you can try to call make -j 4
again until everything builds with no errors.
Instead of RelWidthDebInfo
, it is possible to use or Debug
(removes optimisations).
To build the test database:
- Start mongo with
mkdir -p www/db ; mongod -bind_ip 127.0.0.1 -dbpath www/db
- Once mongo is running, run (and wait a bit):
build_release/src/server/nautical/tiles/generateDevDB.sh
You can safely ignore errors such as "file empty or format not recognized."
If you dont find any data in the mongo db after the UI is up and running plase re-run the last command to generate the db.
- Now prepare the web server:
cd www2
mkdir uploads
- Kill mongodb, if it is running (this is necessary because grunt will start a new instance)
killall mongod
- start the dev server:
CLIENT=client ./grunt.sh serve:dev
Note that you can replace CLIENT=client
with CLIENT=esalab
. The
code name 'client' corresponds to anemolab.com site, and 'esalab' corresponds to
regattapolar.it.
The first time grunt.sh runs, it will install all dependencies, it may take a while. Subsequent runs are much faster.
The system compiles at least under Ubuntu 64-bit and Mac OSX 64-bit.
- Eigen 3
- C++ compiler, such as GCC or LLVM/Clang
- CMake build system.
- Boost libraries: libboost-iostreams-dev, libboost-filesystem-dev, libboost-system-dev, libboost-regex-dev, libboost-thread-dev, libboost-dev
- The following packages, used by POCO:
libssl-dev,
unixodbc-dev, libmysqlclient-dev,libkrb5-dev - The following packages, used by Ceres: libeigen3-dev libsuitesparse-dev libcsparse2.2.3 libcxsparse2.2.3
- Used by Armadillo: liblapack-dev, libblas-dev, libatlas3-base. See this page for help setting it up: http://danielnouri.org/notes/2012/12/19/libblas-and-liblapack-issues-and-speed,-with-scipy-and-ubuntu/
- Armadillo
- gnuplot (only necessary if you want to plot)
- libprotobuf-dev
- protobuf-compiler
- cairo
Summary:
On debian/ubuntu:
sudo apt-get install cmake libboost-iostreams-dev libboost-filesystem-dev libboost-system-dev libboost-regex-dev libboost-thread-dev libboost-dev libeigen3-dev libsuitesparse-dev libcxsparse3 liblapack-dev libblas-dev libatlas3-base libprotobuf-dev protobuf-compiler libssl-dev libcairo2-dev build-essential git libarmadillo-dev f2c parallel mongodb-clients catdoc clang libicu-dev libpython2.7 libsqlite3-dev build-essential cmake libblkid-dev e2fslibs-dev libboost-all-dev libaudit-dev libeigen3-dev libcairo2-dev libblas-dev liblapack-dev libarmadillo-dev libceres-dev
additionally, swift has to be installed: see https://www.cansurmeli.com/posts/install-swift-on-debian/
On macOS with macports:
sudo port install cairo cmake eigen3 f2c armadillo protobuf-cpp catdoc
- node and npm. Find packages here:
https://nodejs.org/en/download/package-manager/
- mocha, for running unit tests:
npm install -g mocha
(possibly withsudo
) - bower, install with
npm install -g bower
(possibly withsudo
) - grunt, install with
npm install -g grunt
, or should it begrunt-cli
? Try out yourself. (possibly withsudo
)
- gtest
- ADOL-C
- POCO
- ceres
- mongodb c++ client
The following steps cover building and testing all the code:
- Install dependencies
- Clone this repository
- From the root directory,
mkdir build
cd build
cmake ../
make -j N
whereN
is the number of cores, e.g. 8make test
cd ../www2
npm install
bower install
grunt test
mocha
cd ../nodemodules/endpoint
npm install
mocha
cd ../mangler
npm install
mocha
cd ../../src/device/anemobox/anemonode/
npm install
mocha
Some things are difficult to test with unit tests. The pipeline that processes logs and upload tiles can be run, by first ensuring a that a clean mongo server is running either
sudo killall mongod
mkdir /tmp/anemotestdb
mongod --dbpath /tmp/anemotestdb
or by doing from the project root
mkdir www/db
cd www2
grunt serve:dev
Then perform a build of the C++ code in your build directory (e.g. build
),
and run
build/src/server/nautical/tiles$ sh generateDevDB.sh
Although this will not perform any correctness checks in particular, a great deal of the pipeline will nevertheless be run and it can therefore be a conventient tool when searching for bugs.
If you used the second example for starting mongodb indirectly using grunt grunt serve:dev
, the result will be visible on http://localhost:9000.
Install CERN's ROOT. On mac, do it with: sudo port install root6
Then got to the build folder and type:
make root
To check that it worked, you can type:
NavDataset().outputSummary(&std::cout)