Preamble
Trackman radar guns are a becoming more common in baseball parks around North America, and we've received a few calls on how to set them up to display pitch data in XPression. This document covers the setup and possible issues you might encounter.
Instructions
To set up XPression to receive data from the Trackman, first create an ASCII Datalinq source.
Trackman guns send out pitch data via a UDP stream, typically on port 20999. An example of the data string is below:
{"Id":"a235a53a-c49b-4cf0-b36b-9d3502ec9adf","Time":"2020-02-11T21:02:06.6342585Z","PitchExitSpeed":80,"HitSpeed":null}
The most sought-after data is usually PitchExitSpeed, which is what is shown in the example below.
To get just the numerical value to show up in Datalinq:
- Go to the source that was just created.
- To create a new field, select Add.
- Count the number of characters in the number value of the pitch speed starts.
- Put that value for the start byte.
- In our example data above, this would be byte 101.
- A quick way to count them is to paste the data into Notepad++, then place your cursor at the point where the data you want start. It will tell you the position on the bottom of the window.
- Set the length to 3 (to allow for pitches above 100MPH), and set the trim value to "yes".
- At the bottom of the Setup screen, check Protocol Settings to make sure the Start and End of Packet are selected correctly.
- Set them to Custom. Use values 123 and 125 (which translate to "{" and "}" respectively).
Note: You can name the Field anything, but the best practice would be to be as descriptive as possible.
Link the data to a text object as normal.
In your XPression project, right-click the text object that is going to be displaying the pitch speed data. Select Edit Script Events.
In the window that appears, copy and paste the following:
text = text.replace(",","")
Click the button to compile the script.
Close the window and test.
- This additional script is for use cases where you have a pitch that is below 99MPH, just to remove extra characters that you don't want to show up. 99MPH would show up as "99," for example.
Caveats and Cleanup
When testing to see if the source works, it's critical to note that Trackman guns are currently unable to send dummy pitch data. This means that either a pitch machine needs to be present, or there must be someone throwing pitches past the gun at a minimum speed of 45MPH (the base speed that the gun can detect)
Trackman has also sent us some documentation that can be found here.