neurogears / vestibular-vr

Closed-loop VR setup for Rancz Lab
2 stars 0 forks source link

Fix playback streaming issues #69

Closed RoboDoig closed 4 months ago

RoboDoig commented 4 months ago

This PR addresses #54.

Previously, the playback data stream was created as an observable that could be subscribed to by different parts of the workflow (PhaseProcession, MotorProcession, running threshold calculation etc.). This caused 2 issues:

This is fixed in this PR by subscribing to the observable and sending the data to a PublishSubject at the start of each block. This means all subscribers to the playback data stream are receiving the same playback values, and fixes the error caused by trying to access a disposed observable.

I've tested this a few times remotely, but would benefit from someone trying this branch out on the rig to ensure the playback is running smoothly.

RoboDoig commented 4 months ago

Tested by @EleonoraAmbrad - merging