theRAPTLab / gsgo

GEM-STEP Foundation repo migrated from GitLab June 2023
1 stars 1 forks source link

Feature: Pozyx Tags are randomly assigned to Blueprints - [merged] #743

Closed benloh closed 1 year ago

benloh commented 1 year ago

Merges dev-bl/random-pozyx-bp-select -> dev-next

Previously, the system expected only one blueprint to have pozyx enabled (# TAG isPozyxControllable true). If more than one blueprint had it set to true, the system would simply always pick the first blueprint it found when assigning a tag to a blueprint.

This adds a feature where the sim will now randomly choose a blueprint if more than one blueprint has isPozyxControllable set to true.

NOTE: This is not using the seeded random number generator so that students will actually get random assignments. This potentially breaks the replayability of the sim however. (Currently this is not a problem since we do not have recording and playback at the sim level).

This also fixes a bug where PTrack and FakeTrack control inputs were being skipped during the InputsUpdate cycle.

To Test

  1. Open a project with more than one blueprint.
  2. Set two blueprints # TAG isPozyxControllable true.
  3. Move a tag into the sim area. It should automatically be assigned to one of the blueprints.
  4. Move a second tag. It should also be randomly assigned.
  5. Reload Main. The tags should be randomly re-assigned.
benloh commented 1 year ago

requested review from @jdanish

benloh commented 1 year ago

mentioned in commit 61eb92c389677b4aec0904932c5442e87b6b6046