PTrack Setup - theRAPTLab/gsgo GitHub Wiki
If you're just testing Pozyx or CharControl, you can skip this step.
- 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.
- Use
roslaunch opt_utils udp_listener.launch
to make sure that your OpenPTrack system is running and sending JSON data.
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.
- Go to your
art-assets
repo. - Change the branch to
asset-server
:git checkout asset-server
- Pull the latest:
git pull
- Copy the
projects/ptrack-demo.gemprj
file to yourgsgo/gs_assets/local/projects
folder.
PTrack functionality was introduced with !174 (October 27, 2021). Make sure you're running code that includes this.
- If you haven't run recent builds, do
npm run bootstrap
- 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.
npm run start
- Go to
http://localhost/app/main?project=ptrack-demo
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.
- Go to
http://localhost/app/main?project=ptrack-demo
- Click "tracker" in the top navbar.
- Select your locale, e.g. "vanderbilt"
- Select Data Track: "PTrack"
- Notice the TRACKER DATA: BOUNDS is reset to "Infinity".
- 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.
- 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.
The ptrack-demo
project demonstrates all three controllers:
- PTrack People Tracking
- Pozyx Tag Tracking
- CharControl
- Go to
http://localhost/app/main?project=ptrack-demo
- If PTrack is on and transforms are correct, you should see PTrack inputs as Fish.
- Move a Pozyx tag in the space and you'll see a dot cursor.
- Click "PREP ROUND"
- Click "PICKUP CHARACTERS"
- Using the Pozyx tag cursor, you can walk through the Bee to pick it up and control it.
- Reload the Main page
- Click "PREP ROUND"
- Click "PICKUP CHARACTERS"
- Open a new window with a controller:
http://localhost/app/charcontrol
- The CharController should default to a Cursor.
- 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.