RTOSIM is a set of efficient and extensible C++ libraries to connect OpenSim with different devices. RTOSIM can use data provided by motion capture systems to solve OpenSim inverse kinematics and inverse dynamics on a frame-by-frame basis. Multiple threads operate concurrently to remove idle times due to communications with input and output devices, and the data flow is automatically managed by RTOSIM in order to preserve data integrity and avoid race conditions.
Read more about RTOSIM at the RTOSIM project page
RTOSIM depends on the following
- Cross-platform building: CMake 2.8.8 or later
- Required external libraries:
- Optional external libraries:
- Vicon DataStream SDK version 1.5+
RTOSIM works on Windows, Mac, and Linux.
- Get and compile Simbody. IMPORTANT: if you want to use multiple threads to solve the Inverse Kinematics it is necessary to first patch Simbody.
- Get and compile OpenSim
- Get and compile Concurrency
- Get and compile Filter
- If you want to enable the real-time stream from Vicon Nexus you need to download and install Vicon DataStream SDK
- Add the environmental variable VICONDATASTREAM_INSTALL_DIR that points to the installation directory of the Vicon DataStream SDK (must contain the file Client.h), as example c:\Program Files (x86)\Vicon\DataStream SDK\Win32\CPP
- Build your project using CMake.
- Explore how to use RTOSIM APIs in your project using the provided examples
If you want to use multiple threads to solve the OpenSim inverse kinematics using IpOpt as optimisation algorithm (which is the default algorithm for constrained optimisations in OpenSim), you need to patch Simbody first. To do this, get the files IpLapackSolverInterface.cpp and IpLapackSolverInterface.hpp and use them to replace the corresponding files in your Simbody distribution in the directory SimTKmath/Optimizers/src/IpOpt. Then, compile and install Simbody.
Adapt the software for your gait laboratory
The representation of force plates moments in the version of Vicon Nexus used to test RTOSIM is not what you may expect.
To have the correct representation of joint moments in the global reference system of the gait laboratory is necessary to perform a further transformation.
This requires to know the position of the force plates. You can get this by opening Vicon Nexus, clicking on your force plate -> Show Advanced -> Position.
Currently, these values are harcoded in RTOSIM for the Griffith University gait laboratory. However, what you have to do to adapt it to your lab is to modify the function
DataFromNexus::getForcePlatePosition() const with your force plates position. IMPORTANT: the position of the force plates must be consistent with the rotation used in the function
DataFromNexus::setAxisMapping(VDS::Client& client) const. You need to provide the position of the force plate already rotated.
Please see the file called LICENSE.txt.
Copyright (c) 2010-2016 C. Pizzolato, M. Reggiani
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at: http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Claudio Pizzolato email@example.com
If you are using rtosim or part of it please cite:
C. Pizzolato, M. Reggiani, L. Modenese & D. G. Lloyd (2016): Real-time inverse kinematics and inverse dynamics for lower limb applications using OpenSim, Computer Methods in Biomechanics and Biomedical Engineering, DOI: 10.1080/10255842.2016.1240789 To link to this article: http://dx.doi.org/10.1080/10255842.2016.1240789
- Australian National Health and Medical Research Council (628850)
- Royal Society of NZ Marsden Fund (12-UOA-1221)
- US National Institutes of Health Grant (R01EB009351)
- Commission of the European Union Grant (IFP7-ICT-2013-10-611695)