Vicon Virtual Bodies
<< Back to the Vicon Toolkit page
Editing Virtual Bodies: How to use Vicon Scripting.
In this tutorial you will learn
- How bodies are saved on the hard drive as XML files
- Why it may be necessary to modify these saved bodies to provide virtual hotspots
- How to modify bodies and change virtual hotspots
How bodies are saved on the hard drive as XML
Bodies saved from the Vicon are stored as .VSK (Vicon Skeleton) files. They use an XML notation shown in the example below for a wand using three Markers and a Body.
<?xml version="1.0" encoding="UTF-8" standalone="no" ?> <KinematicModel MODEL="Wand2" VERSION="2.1"> <Parameters> <Parameter HIDDEN="1" NAME="Shaft_Length" PRIOR="151.122421264648" SD="1.00000002004088e+020" VALUE="151.122421264648"/> <Parameter HIDDEN="1" NAME="Shaft_Unlabeled22_y" PRIOR="28.297700881958" SD="1.00000002004088e+020" VALUE="28.297700881958"/> <Parameter HIDDEN="1" NAME="Shaft_Unlabeled22_z" PRIOR="-45.4377746582031" SD="1.00000002004088e+020" VALUE="-45.4377746582031"/> </Parameters> <Skeleton> <Segment BOUNDS="-15.1122 -15.1122 -Shaft_Length 15.1122 15.1122 0" CONTEXT="General" INERTIA="0 0 0 " MASS="0 " MASS-CENTRE="0 0 0 " NAME="Shaft" RGB="255 164 0"> <JointFree BOUNDS="0 0 0 0 0 0 0 0 0 0 0 0" COVARIANCE="2.46490001678467 0 0 0 0 0 0 2.46490001678467 0 0 0 0 0 0 246.490005493164 0 0 0 0 0 0 1000000 0 0 0 0 0 0 1000000 0 0 0 0 0 0 1000000 " MEAN="0 0 0 0 0 0" NAME="World_Shaft" POST-ORIENTATION="0 0 0" POST-POSITION="0 0 0" PRE-ORIENTATION="0 0 0" PRE-POSITION="0 0 0" SIGNS="+ + + + + + " T="* * * * * * "> <JointTemplate COVARIANCE="2.46490001678467 0 0 0 0 0 0 2.46490001678467 0 0 0 0 0 0 246.490005493164 0 0 0 0 0 0 1000000 0 0 0 0 0 0 1000000 0 0 0 0 0 0 1000000 " MEAN="0 0 0 0 0 0" POST-ORIENTATION="0 0 0" POST-POSITION="0 0 0" PRE-ORIENTATION="0 0 0" PRE-POSITION="0 0 0" TPOSE-COVARIANCE="0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 " TPOSE-MEAN="0 0 0 0 0 0"/> </JointFree> </Segment> </Skeleton> <MarkerSet> <Markers> <Marker COVARIANCE="1 0 0 0 1 0 0 0 1 " NAME="Base" POSITION="-0 0 0" RADIUS="12.5" RGB="255 164 0" SEGMENT="Shaft" STATUS="required"> <MarkerTemplate COVARIANCE="1 0 0 0 1 0 0 0 1 " PLACEMENT-COVARIANCE="1 0 0 0 1 0 0 0 1 " POSITION="0 0 0"/> </Marker> <Marker COVARIANCE="1 0 0 0 1 0 0 0 1 " NAME="Head" POSITION="1.42109e-014 1.77636e-015 -151.122" RADIUS="12.5" RGB="255 164 0" SEGMENT="Shaft" STATUS="required"> <MarkerTemplate COVARIANCE="1 0 0 0 1 0 0 0 1 " PLACEMENT-COVARIANCE="1 0 0 0 1 0 0 0 1 " POSITION="0 0 -Shaft_Length"/> </Marker> <Marker COVARIANCE="1 0 0 0 1 0 0 0 1 " NAME="Side" POSITION="0 28.2977 -45.4378" RADIUS="12.5" RGB="255 164 0" SEGMENT="Shaft" STATUS="required"> <MarkerTemplate COVARIANCE="1 0 0 0 1 0 0 0 1 " PLACEMENT-COVARIANCE="1 0 0 0 1 0 0 0 1 " POSITION="0 Shaft_Unlabeled22_y Shaft_Unlabeled22_z"/> </Marker> </Markers> <Sticks> <Stick MARKER1="Base" MARKER2="Head" RGB="255 164 0"/> <Stick MARKER1="Base" MARKER2="Side" RGB="255 164 0"/> <Stick MARKER1="Head" MARKER2="Side" RGB="255 164 0"/> </Sticks> </MarkerSet> <Alignment/> </KinematicModel>
There are four components to this file are: parameters, Skeleton, Markers, and colours. Let me describe each in turn.
- Parameters define properties of the Body such as the body length and size.
- Skeleton defines the Bodies and Joints of the model. The joint is defined as a covariance matrix (how rigid must the model match the data shown in the model), a name, position, and colour. Typically this does not require changing
- Markers define the positions of each Marker on the virtual bodies. By default one of the Markers has a position of (0,0,0). If you would like to change the actual point of contact you need to change each Marker value. This is done by the 5-Marker L-Frame.
- Colours each marker can be given a specific colour, change this section to change the marker visualization in Vicon Nexus software.
Why Virtual Bodies?
The position and orientation of a body is by default set to the location of one of the Markers on the body (typically an endpoint). However, these Marker positions do not always correspond to the point of interest. For example, it may not be practical to have a marker placed on a pen tip, even though we would like to use the position of the pen tip for drawing on a table or wall.
This problem is similar to the situation with joints (e.g. the knee) of an actor wearing reflective markers on their body. You cannot physically place a marker in the centre of the joint, rather you place two markers to the side of this joint, create a body with a virtual location in the centre for the joint position.
Think of a mouse cursor, the hotspot is the actual active area of the mouse and the cursor is drawn as a visualization of the hotspot. Think of the virtual body location as the hotspot of the physical object. Do you want it on the tip or in the middle of your object?
How to modify Bodies and change virtual hotspots
To perform this task you will need a very accurate ruler. I reccomend a stainless steel digital caliper tool like this one. The reason is that you are going to have to very accurately measure the distance from the centre of the reflective marker to the exact location of your virtual hotspot.
Here's an example of a modified marker set for the 5 Marker Mini L-Frame
<Markers> <Marker COVARIANCE="50 0 0 0 50 0 0 0 50 " NAME="MarkerA" POSITION="35 0 14" RADIUS="3" RGB="255 255 255" SEGMENT="Root" STATUS="required"> <MarkerTemplate COVARIANCE="50 0 0 0 50 0 0 0 50 " PLACEMENT-COVARIANCE="1 0 0 0 1 0 0 0 1 " POSITION="35.0 0.0 14.0"/> </Marker> <Marker COVARIANCE="50 0 0 0 50 0 0 0 50 " NAME="MarkerB" POSITION="0 0 14" RADIUS="3" RGB="255 255 255" SEGMENT="Root" STATUS="required"> <MarkerTemplate COVARIANCE="50 0 0 0 50 0 0 0 50 " PLACEMENT-COVARIANCE="1 0 0 0 1 0 0 0 1 " POSITION="0.0 0.0 14.0"/> </Marker> <Marker COVARIANCE="50 0 0 0 50 0 0 0 50 " NAME="MarkerC" POSITION="-18 0 14" RADIUS="3" RGB="255 255 255" SEGMENT="Root" STATUS="required"> <MarkerTemplate COVARIANCE="50 0 0 0 50 0 0 0 50 " PLACEMENT-COVARIANCE="1 0 0 0 1 0 0 0 1 " POSITION="-18.0 0.0 14.0"/> </Marker> <Marker COVARIANCE="50 0 0 0 50 0 0 0 50 " NAME="MarkerD" POSITION="0 21.4 14" RADIUS="3" RGB="255 255 255" SEGMENT="Root" STATUS="required"> <MarkerTemplate COVARIANCE="50 0 0 0 50 0 0 0 50 " PLACEMENT-COVARIANCE="1 0 0 0 1 0 0 0 1 " POSITION="0.0 21.4 14.0"/> </Marker> <Marker COVARIANCE="50 0 0 0 50 0 0 0 50 " NAME="MarkerE" POSITION="0 44.2 14" RADIUS="3" RGB="255 255 255" SEGMENT="Root" STATUS="required"> <MarkerTemplate COVARIANCE="50 0 0 0 50 0 0 0 50 " PLACEMENT-COVARIANCE="1 0 0 0 1 0 0 0 1 " POSITION="0.0 44.2 14.0"/> </Marker> </Markers>
If you look at the position of each of the markers there is no point at (0,0,0). This is the location of the virtual hotspot. Thus to achieve a virtual hotspot at (0,0,0) it was necessary to offset the marker values accordingly.