| PST SDK 6.0.0.0-272350a

Getting tracking results

To start receiving tracking results it is important to make sure the server is started (required only once at the start or after PSTapi/Pause has been called in the meantime). Explicitly setting the right exposure and activating the required target helps limit the chance of missed detections.

A typical call sequence in Curl

      curl --header "Content-Type: application/json" --request POST --data "{}" http://localhost:7278/PSTapi/Start
      curl -X GET http://localhost:7278/PSTapi/GetTargetList
      curl --header "Content-Type: application/json" --request POST --data "{\"TargetStatus\":{\"name\":\"target_main\",\"status\":true}}" http://localhost:7278/PSTapi/SetTargetStatus
      curl --header "Content-Type: application/json" --request POST --data "{\"Framerate\":30}" http://localhost:7278/PSTapi/SetFramerate
      curl -X GET http://localhost:7278/PSTapi/GetExposureRange
      curl --header "Content-Type: application/json" --request POST --data "{\"Exposure\":0.0001189}" http://localhost:7278/PSTapi/SetExposure
      curl -X GET http://localhost:7278/PSTapi/StartTrackerDataStream

Note
  On line 3, change the name of the target "target_main" to a target name present in the target list.
  If no objects are detected, try increasing the exposure setting on line 6.
  When too many streams are opened at the same time, PSTapi/StartTrackerDataStream returns a 429 too_many_requests status code. More information on how to handle this error can be found in the PSTapi/CloseDataStream documentation.

The output of the previous example in a Windows command prompt

Type | message
--- | ---
COMMAND | `curl --header "Content-Type: application/json" --request POST --data "{}" http://localhost:7278/PSTapi/Start`
RESPONSE | `{"message":"Server Started"}`
COMMAND | `curl -X GET http://localhost:7278/PSTapi/GetTargetList`
RESPONSE | `{"TargetList":["target_main","target_test","Reference"]}`
COMMAND | `curl --header "Content-Type: application/json" --request POST --data "{\"TargetStatus\":{\"name\":\"target_main\",\"status\":true}}" http://localhost:7278/PSTapi/SetTargetStatus`
RESPONSE | `{"message":"Model Status correctly set"}`
COMMAND | `curl --header "Content-Type: application/json" --request POST --data "{\"Framerate\":30}" http://localhost:7278/PSTapi/SetFramerate`
RESPONSE | `{"message":"Frame rate set successfully"}`
COMMAND | `curl -X GET http://localhost:7278/PSTapi/GetExposureRange`
RESPONSE | `{"ExposureRange":{"max":0.0024999999441206455,"min":9.9999997473787516e-05}}`
COMMAND | `curl --header "Content-Type: application/json" --request POST --data "{\"Exposure\":0.0001189}" http://localhost:7278/PSTapi/SetExposure`
RESPONSE | `{"message":"Exposure time set successfully"}`
COMMAND | `curl -X GET http://localhost:7278/PSTapi/StartTrackerDataStream`
RESPONSE |
    data: {
      "TrackerData": {
        "Points": [
          {
            "DataPoint": {
              "id": 4979,
              "position": {
                "x": 0.036606535315513611,
                "y": -0.057408709079027176,
                "z": -0.4420783519744873
              }
            }
          },
          {
            "DataPoint": {
              "id": 5034,
              "position": {
                "x": 0.082240507006645203,
                "y": -0.039975382387638092,
                "z": -0.43901127576828003
              }
            }
          }
        ],
        "TargetPoses": [
          {
            "TargetPose": {
              "TransformationMatrix": [ 0.1579325795173645, 0.21561136841773987, 0.9636228084564209, -0.062948554754257202, -0.96623826026916504, -0.16743898391723633, 0.19582584500312805, -0.28300657868385315, 0.20357045531272888, -0.96201658248901367, 0.18188798427581787, -0.44499132037162781, 0, 0, 0, 1 ],
              "id": 6,
              "name": "Reference",
              "uuid": "88035e90-c205-49c0-b99d-da90843eb465"
            }
          }
        ],
        "seqnumber": 27,
        "timestamp": 1628315.5216415992
      }
    }

    ...