Copyright 2014 by Kevin Dahlhausen (kpd@powertwenty.com)
This package contains a C++ library and demonstration files that make working with the Concept 2 Software Development Kit (http://www.concept2.com/service/software/software-development-kit) easy. This library runs against the (latest as of writing) version of the API - the one with documents labeled version 0.14:
ErgNet net = ErgNet(); int numErgs = net.discoverErgs(); Erg erg = Erg(0); // could actually be a PM3, PM4, or PM5 ErgState state; while (1) { erg.updateState(&state); cout << "power: " << state.watts << " (watts) " << "numStrokes: " << state.numStrokesIn << " meters/stroke: " << state.metersPerStroke << "\n"; }
This software is licensed under the Mozilla Public License V 2.0. See the file 'LICENSE.txt' for full details, but my intent is that:
- You can use and modify this library freely in private, open-source, and closed-source commercial software.
- You disclose any changes you make to this library (pull-requests are ideal).
- You do not need release the source to your own software that uses this library.
Should you not wish to use the software under the Mozilla Public License, please contact Kevin Dahlhausen (kpd@powertwenty.com) to discuss alternative licensing.
- version 1.24 of the Concept 2 Software Development Kit
- cygwin with g++
- dlltool installed
- pexports installed
- Extract the concept 2 SDK and set the environment variable 'CONCEPT2SDK' to point to the directory that contains the DLL's and .h files.
- run "make"
- connect a Concept 2 ergometer via USB
- cd to demo
- run demo.exe or any of the other demonstration files there.
- Install GoogleMock (https://code.google.com/p/googlemock/) somewhere.
- Point GMOCK_DIR (test/Makefile.test around line 24) and GTEST_DIR (test/Makefile.test around line 20) to the installation.
- make all tests
The command line would be something like this:
g++ -mno-cygwin -I../easy_erg/build -I../easy_erg/lib/sdk/PC -L../easy_erg/build my_app.cpp -lEasyErg -lRPPM3USB -lRPPM3DDI
You also have to copy the DLL's from the demo directory to some directory on the path or where the new program resides.
- Average watts is calculated by sampling power at a fixed rate independent of the position or timing in the stroke. We might want to tie it to a position in the stroke.