arenaxr / arena-web-core

An environment to view and interact in multiuser virtual and augmented reality.
https://docs.arenaxr.org
BSD 3-Clause "New" or "Revised" License
37 stars 28 forks source link

Arbitrary Tracker #602

Closed mwfarb closed 7 months ago

mwfarb commented 7 months ago

Is your feature request related to a problem? Please describe. Optitrack tracker and other systems need a way to store generated ids and tags into persist similar to ARMarker. Suggestion by @johnchoi313.

Describe the solution you'd like

Describe alternatives you've considered Hoping for input from @ivan and @nampereira

Additional context Wanted to capture discussion between @johnchoi313 and @mwfarb

hi-liang commented 7 months ago

When we process Apriltags currently, we consider its offset pose the same as the (world) pose of the entity it is attached to, which allows for parenting too. I don't think there should be any reason why that can't be applicable to all marker types.

As far arbitrary tracker, we should probably just add more markertypes as they come up, as well as any more extra more fields to ARMarker. If a specific marker type demands a bunch of custom fields very specific to it, we can maybe split it off to its own component.

nampereira commented 7 months ago

As @hi-liang said, adding a new markertype seems to cover this use case. Just for completeness: the workflow is to add an object (a box, sphere, or even an empty entity) in the scene that represents the marker and attach the ARMarker component to it. The pose of that object is then used when relocalizing.

I think the code does mostly assume apriltags, but should be easy to extend. ARMarkers are supposed to be kinda generic location markers.

johnchoi313 commented 7 months ago

Adding new arbitrary "Tracker" is cool. Essentially just need way to store offsets and mapping data for Optitrack and HTC Vive trackers (and possibly other trackers in the future). ARENA client doesn't do anything with this data except store it - connected Unity client scene uses some sensor SDK and moves the sensor object in ARENA, which moves the ARENA object with the "Tracker" data attached.

The only fields I need for now for this "Tracker" field data here are: -markertype: type string -markername: type string -offsetPosition: type Position() -offsetRotation: type Rotation()

hi-liang commented 7 months ago

After some convo with @johnchoi313 arrived at conclusion we have all the fields we need, just need to add to the markertype enum for:

mwfarb commented 7 months ago

Closed in https://github.com/arenaxr/arena-web-core/commit/b10385d81cafa7d63a2eb4f2e69d64f2540dd095