The first working package of this project consts mainly on setting up known stuff, and making them work together. Once I figured out how to measure the EMG and track the skeleton, I had to figure out also how to bring them together in order to drive a musculoskeletal model. The answer for this was ROS.
I decided to use the robotic operating system (ROS), not because of the easy of measuring and analysing signals, but mainly as it can act as a central server that can gather all the necessary signals and move stuff around. This might seem very abstract but it is very powerful. The power comes from the fact that I can easily run different pieces of software and make them talk to each other. For instance, one piece of software can be the skeleton tracking, while another is the forward simulation of the musculoskeletal model.
For running the musculoskeletal model, I decided to use another amazing open source framework for musculoskeletal modeling called OpenSim. OpenSim allows one to construct models consisting of bones, joints, muscles and other biomechanical elements, and run simulations. The simulations can be of different flavours, based on what are the known and the unknown variables. For instance, if we know the kinematics of the bones over time, we might be interested to calculate the muscle forces that resulted in these kinematics. Such an analysis is called ‘Inverse Dynamics’.
In this project, we are interested of a Forward Dynamics simuation, meaning that we want to calculate the resulting kinematics of known muscle activations over time. This will be necessary so that we can predict the intention of motion of a patient, if we know the way the muscles are activated.
Currently, I have a working forward dynamics simulation setup using OpenSim. I am using an already published model of the human arm from some excellent researchers from the Keele University, Cleveland State University, and Case Western Reserve University. But this is not the innovative part. What I managed to do, is to bind this OpenSim model with ROS, and control the model using information transmitted over the ROS network. This is the first step for controlling the model real-time using measurements acquired over another node of ROS.
What you see in the video above is a small example of this workflow: Some EMG data are generated in a ROS node, they are transmitted over the network, and a musculoskeletal model running on another node is running a continious forward dynamics simulation providing the position of the hand.
Next step is to do this with real EMG data!