AllenNeuralDynamics / dynamic-foraging-task

Bonsai/Harp workflow for Dynamic Foraging with Python GUI for visualization and control
MIT License
5 stars 4 forks source link

Check if high speed camera is enabled #190

Closed alexpiet closed 7 months ago

alexpiet commented 9 months ago
alexpiet commented 9 months ago

@bruno-f-cruz Can you point us in the right direction?

bruno-f-cruz commented 9 months ago

I would advise solving this at the level of the schema tbh. If there is a camera entry try to connect if not don't subscribe to the camera. I have shown xin xin how to do this with the nidaq already. Use the same pattern. Otherwise you could simply try to connect to the camera and if it doesn't exist catch the error and ignore it. Which one would you prefer?

XX-Yin commented 7 months ago

Hi @bruno-f-cruz, do you have time to show me the catch the error and ignore? The excel schema method does not work for the nidaq.

bruno-f-cruz commented 7 months ago

Pick a time from my next week s calendar. Meanwhile have you tried the docs?

https://bonsai-rx.org/docs/api/Bonsai.Reactive.Catch.html https://bonsai-rx.org/docs/api/Bonsai.Reactive.OnErrorResumeNext.html

alexpiet commented 7 months ago

IMG_20240321_092033181

@bruno-f-cruz Showed @XX-Yin and I how to do this. The idea is we put a value in the rig .csv file, and then set the workflow to only subscribe to the high speed camera node if the appropriate value is in the rig file.

I will update the setting files to contain an entry HighSpeedCamera. It will default to 0, and if its 0, the camera node will not be subscribed to. If you want to use a high speed camera, then you set the node to 1

bruno-f-cruz commented 7 months ago

For completeness sake:

image

Workflow (Copy+Paste me) ```xml RandomPieceOfHardware Any boolean expression false Source1 ```
XX-Yin commented 7 months ago

@alexpiet I can make a PR to update this and also read the camera's serial number from the CSV file.

alexpiet commented 7 months ago

Resolved by #318