PTrack Setup - theRAPTLab/gsgo GitHub Wiki

SETUP

1. Make sure OpenPTrack is working and sending data

If you're just testing Pozyx or CharControl, you can skip this step.

  1. Start OpenPTrack with PeopleTracking on. e.g. use roslaunch tracking single_camera_tracking_node.launch enable_people_tracking:=true enable_pose:=false enable_object:=false

You can leave ObjectTracking and PoseTracking on, but they might cause some false positives.

  1. Use roslaunch opt_utils udp_listener.launch to make sure that your OpenPTrack system is running and sending JSON data.

2. Download the PTrack demo project

If you have not set up your local gs_assets folder with a local project, or are using a different default project folder, please see !159. Follow the "To Test" instructions. You'll need to do all that before continuing.

  1. Go to your art-assets repo.
  2. Change the branch to asset-server: git checkout asset-server
  3. Pull the latest: git pull
  4. Copy the projects/ptrack-demo.gemprj file to your gsgo/gs_assets/local/projects folder.

3. Update the code

PTrack functionality was introduced with !174 (October 27, 2021). Make sure you're running code that includes this.

  1. If you haven't run recent builds, do npm run bootstrap
  2. If you haven't set up your local mqtt settings in locale, follow the directions in !171 to set up a local-settings file. DO NOT commit the local-settings file. Each game machine should have its own settings file.
  3. npm run start
  4. Go to http://localhost/app/main?project=ptrack-demo

4. Set up PTrack transforms.

Pozyx and PTrack use separate transforms to translate the input tracking system into game world coordinates. You'll need to set each one up separately.

NOTE: I haven't been able to test this very well because my current PTrack PeopleTrack setup does not send a very consistent data stream. Mine had very sporadic output. Turning on the Object and Pose tracks will give you a better stream to work with, but you'll also likely end up tracking far more objects than you want.

  1. Go to http://localhost/app/main?project=ptrack-demo
  2. Click "tracker" in the top navbar.
  3. Select your locale, e.g. "vanderbilt"
  4. Select Data Track: "PTrack"
  5. Notice the TRACKER DATA: BOUNDS is reset to "Infinity".
  6. At this point you should walk around your tracker area to see what kinds of values PTrack is providing. You should see the BOUNDS and Suggested Settings change. Use these numbers to set scale, rotation, and offsets. See Pozyx-Setup in the wiki for a more detailed walkthrough. The walkthrough is for Pozyx, but the principles are the same.
  7. At the end of this process you should see PTrack inputs as Fish labeled "pp" (where is a number) in the simulation.

For reference, if you enabled other PTrack tracks the labels are as follows:

  • "ob" = PTrack Objects
  • "po" = PTrack Poses
  • "pp" = PTrack People

You might write down the good transforms in case you need to restore them later. They should be saved in the database, but if you reset the database the changes will be lost.

NOTE: PTrack Objects can detect specific objects like "person" and "pottedplant". We are currently not distinguishing between different types of objects. This will be added with a later grant.

5. Test

The ptrack-demo project demonstrates all three controllers:

  • PTrack People Tracking
  • Pozyx Tag Tracking
  • CharControl
  1. Go to http://localhost/app/main?project=ptrack-demo
  2. If PTrack is on and transforms are correct, you should see PTrack inputs as Fish.
  3. Move a Pozyx tag in the space and you'll see a dot cursor.
  4. Click "PREP ROUND"
  5. Click "PICKUP CHARACTERS"
  6. Using the Pozyx tag cursor, you can walk through the Bee to pick it up and control it.
  7. Reload the Main page
  8. Click "PREP ROUND"
  9. Click "PICKUP CHARACTERS"
  10. Open a new window with a controller: http://localhost/app/charcontrol
  11. The CharController should default to a Cursor.
  12. Move the CharController cursor over the bee and it should pick up the bee.

NOTE: PTrack inputs can also be used as a cursor. You would have to modify the Cursor Feature's Cursor blueprint definition to include # TAG isPTrackControllable true. I assumed you would not want to use PTrack input as cursors because they are so unstable you would constantly lose your picked up character.

See Defining Input Controls PTrack/Pozyx/CharControl for information on how to use GEMSCRIPT to set input controls

Test your projects to make sure they still work.

⚠️ **GitHub.com Fallback** ⚠️