Simulate Shot

Once a Player Session is established, golf shot measurements can be simulated with a API call. The simulated measurement will be sent to the client on a web socket connection, translated to selected bay and target and normalized.

Call the below API to simulate a shot (from any http client test application like 'Postman'), pass the appropriate Authorization header along with the request.

Pass the body shown in the example below.

  • Carry : distance of the ball flight to be simulated.
  • BayId : the bay id from where the shot is to be simulated.

Note

Refer to the Session Management section to find out what bay id to be passed.

POST /api/simulator/hitshot

body:
{
  "Carry" : "170",
  "BayId" : "9279bee1-631b-4bc2-a5b8-62eeeeca9e5d"
}

Host: https://localsite.trackmanrange.com

A successful response will look like the following example:

{
  "measurement": {
    "ballSpeed": 54.207,
    "maxHeight": 16.993,
    "carry": 168.301,
    "total": 194.798,
    "launchAngle": 13.827,
    "lastData": 3.582,
    "launchDirection": 3.173,
    "carrySide": 6.635,
    "reducedAccuracy": [],
    "ballTrajectory": [
      {
        "kind": "Flight",
        "xFit": [
          0,
          52.6111,
          -6.79995,
          0.965071,
          -0.103759,
          0.00780517,
          -0.000288703
        ],
        "yFit": [
          0,
          12.9887,
          -2.06327,
          -0.249249,
          0.0427551,
          -0.00386056,
          0.000181008
        ],
        "zFit": [
          0,
          2.91762,
          -0.604286,
          0.0959395,
          -0.0115958,
          0.000971617,
          -0.0000393042
        ],
        "spinRateFit": [
          2320.2,
          -70.2429,
          -0.262414,
          0.867525,
          -0.093799
        ],
        "timeInterval": [
          0,
          4.97712
        ],
        "measuredTimeInterval": [
          0,
          0.0665833
        ],
        "validTimeInterval": [
          0,
          4.97712
        ]
      },
      {
        "kind": "Bounce",
        "xFit": [
          100.989,
          15.7933,
          -0.461229
        ],
        "yFit": [
          -154.747,
          57.4811,
          -5.30197
        ],
        "zFit": [
          5.03448,
          0.376313,
          -0.0109899
        ],
        "timeInterval": [
          4.97712,
          5.86614
        ],
        "validTimeInterval": [
          4.97712,
          5.86614
        ]
      },
      {
        "kind": "Bounce",
        "xFit": [
          101.617,
          15.4416,
          -0.419608
        ],
        "yFit": [
          -192.803,
          63.7645,
          -5.26707
        ],
        "zFit": [
          5.04945,
          0.367932,
          -0.00999813
        ],
        "timeInterval": [
          5.86614,
          6.24027
        ],
        "validTimeInterval": [
          5.86614,
          6.24027
        ]
      },
      {
        "kind": "Roll",
        "xFit": [
          152.804,
          4.62047
        ],
        "yFit": [
          0
        ],
        "zFit": [
          6.26909,
          0.110093
        ],
        "timeInterval": [
          6.24027,
          9.05946
        ],
        "validTimeInterval": [
          6.24027,
          9.05946
        ]
      }
    ],
    "time": "2014-05-24T17:36:00.389848+02:00"
  },
  "time": "0001-01-01T00:00:00",
  "id": "8683f7d4-2b31-43ff-91a6-eb4d8026423c"
}

This response is to verify the measurement message received on web socket has the same id and other parameters. The response is only used for debugging purpose.

Refer to the Session Management section to start a session and establish a web socket connection to receive measurements.

Note

In case you receive an error, try changing the value of Carry in the request body to pass a realistic value that could range between 100 to 300 meters.

Note

This requires a authenticated user with the right authorization token. Refer to the Authorization flows section to know about retrieving correct Authorization Token.