Vicon Shogun supports a simple UDP protocol to broadcast when capture has started. Shogun can also receive these messages, which can be used to trigger a capture remotely.
The port for broadcast and trigger is configurable and defaults to 30.
Note that the packet contents are null terminated.
The XML file contains the following notifications.
|
Code examples (C++) are provided (see Example code).
The following example shows a Start notification. Note that the broadcast must fit into one UDP packet.
The indents in the following example are for clarity: the actual packet is not indented. White space between tokens is removed.
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <CaptureStart> <Name VALUE="dance"/> <Notes VALUE="The pets ants crime deer jump. "/> <Description VALUE="The crowd pencil pets alert fold deer. With welcome practice representative complete great? Or jolly tiny memorise thread. However wool insect pipe! "/> <DatabasePath VALUE="D:/Jeremy/Susan/Captures/Take"/> <Delay VALUE="33"/> <PacketID VALUE="33360"/> </CaptureStart> |
Where:
Name | The name of the trial, which is used as the filename for the capture files, for example <Name>.x2d . |
Notes | Any notes provided |
Description | Any description provided. Avoid very long description strings as the broadcast must fit into one UDP packet. If it does not, the broadcast is not sent. |
DatabasePath | The target path for the capture files. DatabasePath updates the current capture folder and capture files are written to this path. |
Delay | The number of milliseconds that the broadcast is made before the capture starts. This delay enables clients to do any preparation required to respond. |
PacketID | A unique number that individually identifies the packet. It is incremented for each packet generated. Use it to discard duplicate packets that are delivered by UDP. (This can happen if there are multiple paths between the broadcasting and listening machines.) |
The following example shows a Stop notification. It is a notification that capturing has stopped.
Note that writing the file to disk may not be complete. Wait for the corresponding Complete notification before trying to open the file.
Possible values for the result are:
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <CaptureStop RESULT="SUCCESS"> <Name VALUE="dance"/> <DatabasePath VALUE="D:/Jeremy/Susan/Captures/Take"/> <Delay VALUE="33"/> <PacketID VALUE="33361"/> </CaptureStop> |
The following example shows a Complete notification. It indicates that the captured file is ready at the path specified. Note that:
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <CaptureComplete> <Name VALUE="dance"/> <DatabasePath VALUE="D:/Jeremy/Susan/Captures/Take"/> <PacketID VALUE="33362"/> </CaptureComplete> |
The following example shows a Timecode Start notification. It is generated when the system is armed. Note that:
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <CaptureStart> <TimeCode VALUE="0 38 10 17 0 0 0 4"/> <Name VALUE="slip"/> <Notes VALUE="The last ants great blade jump. "/> <Description VALUE="The truthful pencil pets ants crime deer. With geese trail representative complete crowd? Or jolly toothbrush slip thread. However worried insect nest! "/> <DatabasePath VALUE="D:/Captures/Take/DayOne/Final"/> <PacketID VALUE="33364"/> </CaptureStart> |
Where:
TimeCode
is represented as a sequence of integers delimited with spaces.
The following example shows a Timecode Stop notification. Note that additional notifications may be generated if the Timecode Stop is updated after the system is armed or possibly even capturing.
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <CaptureStop> <TimeCode VALUE="0 46 27 15 0 0 0 4"/> <Name VALUE="slip"/> <DatabasePath VALUE="D:/Captures/Take/DayOne/Final"/> <PacketID VALUE="33365"/> </CaptureStop> |
The values for TimeCode
are as listed in Timecode start notification.
The packet is generated when the system is armed, or immediately prior to the capture being started.
<?xml version="1.0" encoding="UTF-8" standalone="no"?> <CaptureStop> <Duration FRAMES="12867" PERIOD="32865" TICKS="5553087"/> <Name VALUE="memorise"/> <DatabasePath VALUE="D:/Take/DayOne/Final/Susan"/> <PacketID VALUE="33367"/> </CaptureStop> |
Where:
Duration
is the number of frames that will be captured.
The packet may contain extra information describing the frame rate:
PERIOD
is the number of clock ticks between each frameTICKS
is the number of ticks in each secondThe frames per second of the system can be calculated as TICKS/PERIOD
. This representation of the frame rate avoids rounding errors for rates such as NTSC, which cannot be stored in a double without a loss of precision.
<Duration FRAMES="12867" PERIOD="653254" TICKS="135000000" /> |
The examples are provided in C++ and require the boost library for communications.
To download these files, go to the Example Code section of UDP capture broadcast/trigger. |