Don't Panic: A Hitchhiker's Guide to Optical Motion Capture - tedcty/mmg-doco GitHub Wiki
It must be Thursday. I never could get the hang of Thursdays. Esp. when it is mocap day.
Overview
A venture into option motion capture is a venture into madness. This is where science becomes an art, and art becomes science. It is a necessary evil in order to obtain the information we need. The guide hopefully will guide you through the mad mad world of optical motion capture.
Setup
Hopefully, you never need to do these steps, but if you do, Godspeed 🫡.
Position and Watch your aim
The first step, if your cameras have not already been set up, is to place the cameras. This sets up the size of your capture volume. You need to first figure out the minimum distance and the maximum distance the cameras can see. This will determine where you place and aim the camera in relation to the motion you are trying to capture. You need at least 3 cameras in their tracking range of any point you want to capture. The best way to do this, to marker someone up and have they perform the motion to see if the camera can track the markers. Which leads to ...
Leading and Trailing Edges
Leading and Trailing Edges are parts of the signals typically generated by a system as a means of syncing different devices together.
Calibration
No matter which system you are using, the calibration steps are almost always the same: shinies, dancing, .... I mean, masking, wanding, origin, and ground plane.
The Mask
Masking is one of the most important steps to ensure you get the best possible data capture. You need to be a magpie and look at the capture volume and find all the shinies (I mean reflection). Once you identify all the reflections, try to cover them up (taping them works too) or remove the object causing the reflection from the camera's field of view. This should be done with no one inside the capture volume or around the capture volume if possible.
If there is still reflection present, then you will check if the clothing or other things the people are wearing in the room are causing reflections and if they are tape them up.
After removing all the reflections you can, you can use the application's masking tool to remove the rest.
If you have done all you can and no more reflection is present, you can move on to the next step: the dance.
The Wand Dance
Wanding is the next step, and it helps the system determine where the cameras are relative to each other and aids in taking into account camera distortion. This involves dancing through the capture with a wand, moving it in fluid motion at varying speeds. Once the system collects enough samples and reconstructs the camera's position, you will get the errors tracking each camera. Depending on the capture volume, for gait, you should aim for rms errors less than 0.3 mm. If the target errors are not achieved, you will have to dance again.
When target errors are reached, the next step is the scatter.
The Scatter
Scatter, run away. Nah, the final step in calibration is defining the origin of the system and the ground plane/ capture volume (we usually leave the volume as the default). The manuals will tell you to use their L or T frames, but in the house of thunder, this is not good enough, as placement offsets could cause large errors if you are using them to also align other equipment, like force plates.
First, define a custom lab frame with a set of markers you can reliably place. Once that is done, the system's software should then be able to use those markers to create the lab coordinate system.
Then, to set the ground plane, you scatter markers all over the capture volume. We suggest at least 8 and space them with some at or near the 4 corners and some in the middle. Use the software's ground plane adjustment setting to ensure the markers are all above the ground plane at equal distances, i.e. the actual offset off the ground. For a 14 mm marker on a 2 mm plate, the offset is 9 mm.
Dots dots and more dots
To track the markers, we usually use a labelling skeleton. This helps with auto-labelling the markers.
Predefined
We have a pre-defined group for walking gait.
[!Note] We only recommend this marker set for adult walking. Other motions, this markerset might not fully track the motion.

The course of squiggles never did run smooth
The squiggle in this case is the EMG signal. Electromyography, or EMG, is a method of measuring the neuro-control of the muscles. These signals are typically used to aid in estimating the level of muscle activity. However, measuring and using these signals are ... what is the most diplomatic way to say this ... difficult. But hopefully the next few sections will make it ... well ... a little bit more doable.
Asking yourself why
The first thing to ask yourself is if you need EMG data for your study. Then ask yourself again and again. If you do need it, then there is nothing to say other than 🎶So long, and thanks for all the fish🎶. Just kidding, the following couple of sections will help. Hopefully 🤞 well for surface EMG, anyway, for fine wire EMG, you are on your own.
Prep
For surface EMG, you have to clean the skin surface. Make sure they are free from dead skin and hair. Which means yes, you have beautify the area. First, shave the area if too hairy, then exfoliate with a scrub (do not use liquid exfoliant), and lastly clean the area with an alcohol wipe.
Not everybody will allow you to do that, which means you'll end up with bad data.
Common Placements
For the lower limb
| Muscle | Location | Orientation | Posture |
|---|---|---|---|
| Tibialis Anterior | The electrodes need to be placed at 1/3 on the line between the tip of the fibula and the tip of the medial malleolus. | In the direction of the line between the tip of the fibula and the tip of the medial malleolus. | Supine or sitting. |
| Soleus | The electrodes need to be placed at 2/3 of the line between the medial condylis of the femur to the medial malleolus. | In the direction of the line between the medial condylis to the medial malleolus. | Sitting with the knee approximately 90 degrees flexed and the heel / foot of the investigated leg on the floor. |
| Gastrocnemius Medialis | Electrodes need to be placed on the most prominent bulge of the muscle. | In the direction of the leg | Lying on the belly with the face down, the knee extended and the foot projecting over the end of the table |
| Biceps femoris (Long head and short head) | The electrodes need to be placed at 50% on the line between the ischial tuberosity and the lateral epicondyle of the tibia | In the direction of the line between the ischial tuberosity and the lateral epicondyle of the tibia. | Lying on the belly with the face down with the thigh down on the table and the knees flexed (to less than 90 degrees) with the thigh in slight lateral rotation and the leg in slight lateral rotation with respect to the thigh. |
| Semitendinosus | Electrodes need to be placed at 50% on the line between the ischial tuberosity and the medial epycondyle of the tibia. | In the direction of the line between the ischial tuberosity and the medial epycondyle of the tibia | Lying on the belly with the face down and the thigh held down on the table, in medial rotation, and the leg medially rotated with respect to the thigh. The knee needs to be flexed to less than 90 degrees. |
| Quadriceps Femoris: rectus femoris | The electrodes need to be placed at 50% on the line from the anterior spina iliaca superior to the superior part of the patella | In the direction of the line from the anterior spina iliaca superior to the superior part of the patella. | Sitting on a table with the knees in slight flexion and the upper body slightly bend backward. |
| Quadriceps Femoris: vastus lateralis | Electrodes need to be placed at 2/3 on the line from the anterior spina iliaca superior to the lateral side of the patella. | In the direction of the muscle fibres. | Sitting on a table with the knees in slight flexion and the upper body slightly bend backward. |
| Gluteus Maximus | The electrodes need to be placed at 50% on the line between the sacral vertebrae and the greater trochanter. This position corresponds with the greatest prominence of the middle of the buttocks well above the visible bulge of the greater trochanter. | In the direction of the line from the posterior superior iliac spine to the middle of the posterior aspect of the thigh. | Prone position, lying down on a table. |
MVC
Maximum voluntary contraction (MVC) is used to scale the collected EMG signals.

[!note] If the participant could not do the the MVC movements, then you have to get the participant move as fast as possible. Then use that to scale EMG signals.
Why force plate, whhyyy 😫...
🎶If you see something weird in your force data, who are you going to call ... maybe your local friendly lab tech. If they are not available, then the following steps may help.
The check
- The first thing to check is always the data, whether you have matching force plate data with the motion. You may have to check the raw data in case the files are missed labelled.
- You should also check the strikes on the plates whether the strikes are clean i.e. only one foot per force plate and no cross plate strikes.
- If check 1,2 looks good then check the motion capture/ opensim pipeline to see if everything is done correctly.
- If it is still weird then it maybe the hardware. In this case you are in trouble. But before asking yourself “Would it save you a lot of time if I just gave up and went mad now?” there is a few more steps and steps and steps ....
The Steps and steps and ...
and steps and steps .... sorry got caught in loop. Where was I, ah yes, checking the errors in the hardware (force plates). If the force plates seem to be acting up ,then try to see what is wrong:
-
Check if the force plate is reading the force right by putting a known weight
-
If it is a reading right, then check the location with a pokie stick.
You should always poke in a grid, like so ...
Then, using some maths, you can work out where the tip is and compare that to the record data:$$ x(i) = a_xi + b_x, \ y(i) = a_yi + b_y, \ z(i) = a_zi + b_z, where \ i = 0, 1, 2 $$
$$ Δx = x(2) − x(0), \ Δy = y(2) − y(0), \ Δz = z(2) − z(0) $$
$$ v = {\left\lbrack \matrix{Δx \cr Δy \cr Δz} \right\rbrack} $$
$$ nv = {\frac{v}{||v||}}$$
If stick mid point is p_mid and lenght of the stick is L then the tip is:
$$ point_{tip} = point_{mid} + L*nv $$
-
If the points do not match i.e. the RMSE is high (> 5 mm), then you need to check the force and moment data. To do this, you need to recalculate the centre of pressure.
$$ COP_x = - {\frac{M_y}{F_z}} $$
$$ COP_y = - {\frac{M_x}{F_z}} $$
$$ COP_{global} = R\times{\left\lbrack \matrix{ COP_x \cr COP_y \cr 0} \right\rbrack} + t $$
O Labels Labels, wherefore art thou Labels
Labels can go missing from time to time to time to time .... when that happens you have to re-track the data and re-label so find youself a good series of podcast (like ologies by alie ward, e.g. Ludology) and a comfy chair because this will take a while.
Click Click Clicky Click
The very basic way of labeling is to click, click and click on the markers an set the labels manually. Software like VICON nexus have tools to do this but it is better if the automated pipeline can do it for you. The attached guide uses VICON Nexus as an example but most optical motion capture software will have similar workflows: Nexus Guide.
Trouble Troubles
Cannot read TRC file from Nexus in other programs
If you have the MMG's ptb package installed, you can try running the following Python script:
from ptb.util.io.helper import StorageIO
from ptb.util.io.mocap.file_formats import TRC
if __name__ == "__main__":
t:TRC = StorageIO.trc_reader('walk.trc')
t.write('walk_re_exported.trc')
Other Steps to try:
- First, download Mokka-0.6.2 and open mokka.exe
- Import the trc file.
- If the trc can not be imported, then open the corresponding c3d file and export as trc
- If you don't have the C3D file, then you can check the header of the file by opening the TRC file in Notepad++
- Enable viewing whitespace characters
- Remove whitespace (tab or space) from the end of the metadata/header
[!note] Mokka-0.6.2 and BTK are the final versions of Mokka and BTK before Moveck company took over the project. The new versions from Moveck: Bridge (btk) and Explore (Mokka) are behind a paywall. The last version of Mokka and BtK is still functional as of 07/09/2025.