diff --git a/src/CricketVRHuntingWorld.bonsai b/src/CricketVRHuntingWorld.bonsai index d3ddb7f..d6bb918 100644 --- a/src/CricketVRHuntingWorld.bonsai +++ b/src/CricketVRHuntingWorld.bonsai @@ -10,6 +10,7 @@ xmlns:gl="clr-namespace:Bonsai.Shaders;assembly=Bonsai.Shaders" xmlns:glr="clr-namespace:Bonsai.Shaders.Rendering;assembly=Bonsai.Shaders.Rendering" xmlns:res="clr-namespace:Bonsai.Resources;assembly=Bonsai.System" + xmlns:num="clr-namespace:Bonsai.Numerics;assembly=Bonsai.Numerics" xmlns:harp="clr-namespace:Bonsai.Harp;assembly=Bonsai.Harp" xmlns:cf="clr-namespace:Bonsai.Harp.CF;assembly=Bonsai.Harp.CF" xmlns:p3="clr-namespace:;assembly=Extensions" @@ -18,7 +19,6 @@ xmlns:gli="clr-namespace:Bonsai.Shaders.Input;assembly=Bonsai.Shaders" xmlns:dsp="clr-namespace:Bonsai.Dsp;assembly=Bonsai.Dsp" xmlns:mx="clr-namespace:Bonsai.DAQmx;assembly=Bonsai.DAQmx" - xmlns:num="clr-namespace:Bonsai.Numerics;assembly=Bonsai.Numerics" xmlns:al="clr-namespace:Bonsai.Audio;assembly=Bonsai.Audio" xmlns:io="clr-namespace:Bonsai.IO;assembly=Bonsai.System" xmlns:bv="clr-namespace:BonVision;assembly=BonVision" @@ -60,10 +60,10 @@ RodentPosition - ArmGainEating + ArmGainDuringEating - ArmGainTrial + ArmGainDuringTrial UpdateArmCartPosition @@ -88,32 +88,6 @@ TrialNumber - - - - - - - - - - 0 - - - - - - - 0.0150001 - 0.27 - - - - - - RadialLimits - - 0 @@ -129,10 +103,7 @@ - - - - + @@ -414,7 +385,7 @@ Calibration\left_extrinsics.yml - YRotationAngle + WorldYRotation @@ -752,6 +723,20 @@ + + + + + + 180 + + + + + + + WorldYRotation + @@ -783,6 +768,9 @@ + + + @@ -1291,9 +1279,18 @@ new( + + + PT2S + + + + StartCameras + + @@ -3557,7 +3554,7 @@ it.Item2 as Value) TimestampStream - ArmGainTrial + ArmGainDuringTrial Write @@ -3580,7 +3577,7 @@ it.Item2 as Value) TimestampStream - ArmGainEating + ArmGainDuringEating Write @@ -3600,7 +3597,7 @@ it.Item2 as Value) SoftwareEventLogger - ShelterCorner + ShelterPosition @@ -3622,6 +3619,29 @@ it.Item2 as Value) SoftwareEventLogger + + TimestampStream + + + WorldYRotation + + + Write + 15 + Float + + + + + + + + Event + + + + SoftwareEventLogger + @@ -3660,6 +3680,11 @@ it.Item2 as Value) + + + + + @@ -3832,53 +3857,6 @@ it.Item2 as Value) - - TimestampStream - - - YRotationAngle - - - - - - LogRotationAxis - - - - - - - csv - YRotationAxis - - - - - - - - Source1 - - - C:\Users\Cricket Team\Desktop\data\230605_test2442\2023-06-09T13-26-25\YRotationAxis\YRotationAxis_2023-06-09T13-26-25.csv - false - false - None - true - Item2,Item1 - - - - - - - - - - - - @@ -3909,9 +3887,6 @@ it.Item2 as Value) - - - @@ -4731,19 +4706,11 @@ it.Y as Z) - 3dLoom + 3DLoom - - - L - Control - - - - - 1 - + + TriggerLoom 3dLoom @@ -5108,7 +5075,6 @@ it.Y as Z) - @@ -5165,31 +5131,8 @@ it.Y as Z) RodentPositionUpdate - - - - - - false - - - - - - - - - Insert - Control - - - - - false - - - - + + @@ -5208,241 +5151,48 @@ it.Y as Z) ResetRodentPosition - - - + + ResetRodentPosition - - ManualOverride + + UpdateRodentPosition - - - - - - - - A - - - - - -1 - 0 - 0 - - - - - D - - - - - 1 - 0 - 0 - - - - - W - - - - - 0 - 0 - 1 - - - - - S - - - - - 0 - 0 - -1 - - - - - Z - + + RodentPosition - - - 0 - 1 - 0 - + + + RodentPosition - - X + + 1 - - - 0 - -1 - 0 - + + RodentPositionUpdate - - - - - - - - - 0 - 0 - 1 - - - 0 - 0 - 0 - - - - - - - - - - 0.01 - 0.01 - 0.01 - - - 0 - 0 - 0 - - - - - - - - - + + Position - - EnableManualOverride + Source1 - - + + Accumulation + + + Value - - true - - - - - - - - - - - - - RodentPositionUpdate - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - ResetRodentPosition - - - UpdateRodentPosition - - - - RodentPosition - - - - RodentPosition - - - - 1 - - - - RodentPositionUpdate - - - - - - Position - - - - - - Source1 - - - Accumulation - - - Value - - - + @@ -5577,7 +5327,7 @@ it.Y as Z) Item1 - YRotationAngle + WorldYRotation @@ -5658,69 +5408,6 @@ it.Y as Z) RodentPosition - - - - - - - Home - Control - - - - ShelterCorner - - - Item1 - - - Item2 - - - - -1 - - - - - - - - - - - - - - 0 - 0 - 0 - - - - - - - - - - - - 0 - 0 - 0 - - - 0 - 0 - 0 - - - - - ResetRodentPosition - @@ -5730,29 +5417,11 @@ it.Y as Z) - - - + + - - + - - - - - - - - - - - - - - - - @@ -6171,282 +5840,57 @@ it.Y as Z) - - + + + + + 0.03 + + + + ArmGainDuringEating + + + + + + + 1 + + + + ArmGainDuringTrial + + + + + + + + + + + + + TrialLogic + + - ArmManualOverride + GetOrientation - - + + RodentPosition - - Manual_Arm_Control - - - - - - - - - - Up - - - - - 0 - 1 - - - - - Down - - - - - 0 - -1 - - - - - Left - - - - - -1 - 0 - - - - - Right - - - - - 1 - 0 - - - - - - - - - - - 0.001 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + Orientation.Y - - - - PT0.01S - - + + CurrentArmPosition - - - - - - - - Source1 - - - - - - - true - - - - - - - - - - - - - UpdateArmCartPosition - - - - - - - - - - - - - - - - GroundTruthFeedback - - - - ArmEvents - - - ArmMovingTo - - - - Source1 - - - Address - - - - 32 - - - - - - - - - - - - - - - - Float - true - - - - Seconds - - - - - Value - - - - - 0 - - - - - 1 - - - - - - - new( -it.Item1 as Seconds, -it.Item2 as Magnitude, -it.Item3 as Angle) - - - Magnitude,Angle - - - - - - TrueArmPosition - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - TrialLogic - - - - GetOrientation - - - - RodentPosition - - - Orientation.Y - - - CurrentArmPosition - - - + + @@ -7067,7 +6511,7 @@ it[8] as PerturbMagnitude) - ArmGainTrial + ArmGainDuringTrial @@ -7229,7 +6673,7 @@ it[8] as PerturbMagnitude) - ArmGainEating + ArmGainDuringEating @@ -7425,127 +6869,32 @@ it[8] as PerturbMagnitude) - ShelterCorner - - - Draw3DStim - - - - - - - - - - - - - - - - - 0 - 0 - 0 - - - - - - - - - - - - 0.02 - 0.05 - 0.02 - - - - - - - - - - - RodentPosition - - - Position - - - - - - ShelterCorner - - - Item1 - - - Item2 - - - - -1 - - - - - - - - - - + ShelterPosition - 0 - 0 - 0 + 0.66 + 0.66 + 0.66 - - - - - - Xz - - - Length - - - - 1.5 - - - - 0.9 * ((1.0) - (1.0 / (Math.Exp(-it) + 1))) - 0.15 - - - it < 0.175 ? 0 : it - - - - - + + ShelterScale - DrawTexturedModelAlpha - Draws a textured and transformed 3D model stimulus. + LuminisityControl - - Source1 + + Draw3DStim - - ViewMatrix + + + + + + + @@ -7553,1522 +6902,2249 @@ it[8] as PerturbMagnitude) - - Prepend + 0 0 0 - - - - - - - - - - - - - - - - + + + + + + - - 0 + + 0.02 + 0.05 + 0.02 - + + + - - - Prepend - 0 - + + RodentPosition + + + Position - + - - - 0 - + + ShelterPosition - - - - + + Item1 - - - Prepend - 0 - + + Item2 - - + + + -1 + - - 180 - + - + - + + - - Prepend - 3.14159274 + + 0 + 0 + 0 - - Prepend - 0.02 - 0.05 - 0.02 - + - - - modelview - TransparentTexturedModel - + + + Xz - - + + Length - - - normalMatrix - TransparentTexturedModel - - - - - Texture0 - TransparentTexturedModel - Black - Texture2D - - - - ProjectionMatrix - - - - projection - TransparentTexturedModel - + + + 1.5 + - - Light + + 0.9 * ((1.0) - (1.0 / (Math.Exp(-it) + 1))) - 0.15 - - - light - TransparentTexturedModel - + + it < 0.175 ? 0 : it - - + + + + - UpdateMaterial + DrawTexturedModelAlpha + Draws a textured and transformed 3D model stimulus. Source1 + + ViewMatrix + + + + + + + + + Prepend + 0 + 0 + 0 + + - + + + - - Eye - - 1 - 1 - 1 - + + - + + + + + + + + + + + + 0 + + + - - - + - - 1 - 1 - 1 - 1 + + Prepend + 0 + + + - - colorAmbient - TransparentTexturedModel + + 0 + + + + + + + + + + Prepend + 0 - + - - Eye - - 0 - 0 - 0 - + + + 180 + - + - - - + - - 0 - 0 - 0 - 1 + + Prepend + 3.14159274 + + + + + Prepend + 0.02 + 0.05 + 0.02 - colorDiffuse + modelview TransparentTexturedModel - - - - - Eye - - 0 - 0 - 0 - - - - - - - - + + - - 0 - 0 - 0 - 1 + + normalMatrix + TransparentTexturedModel - - colorSpecular + + Texture0 TransparentTexturedModel + Black + Texture2D - - + + ProjectionMatrix - - 10 + + projection + TransparentTexturedModel + + Light + - shininess + light TransparentTexturedModel - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 0.187860325 - - - - - alpha - TransparentTexturedModel - - - - - TransparentTexturedModel - box - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Draw3DStim - - - - ShelterCorner - - - - - - - - - - 0 - 0.1 - -0 - - - - - - - - - - - - 0.66 - 0.66 - 0.66 - - - - - - - - - - - DrawTexturedModel - Draws a textured and transformed 3D model stimulus. - - - - Source1 - - - ViewMatrix - - - - - - - - - Prepend - 0 - 0.1 - -0 - - - - - - - - - - - - - - - + + + + + UpdateMaterial + + + + Source1 + + + + + + Eye + + 1 + 1 + 1 + + + + + + + + + + + + 1 + 1 + 1 + 1 + + + + + colorAmbient + TransparentTexturedModel + + + + + + + Eye + + 0 + 0 + 0 + + + + + + + + + + + + 0 + 0 + 0 + 1 + + + + + colorDiffuse + TransparentTexturedModel + + + + + + + Eye + + 0 + 0 + 0 + + + + + + + + + + + + 0 + 0 + 0 + 1 + + + + + colorSpecular + TransparentTexturedModel + + + + + + + + 10 + + + + + shininess + TransparentTexturedModel + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0.187860325 + + + + + alpha + TransparentTexturedModel + + + + + TransparentTexturedModel + box + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + DrawShelter + + + + Draw3DStim - - - 0 - + + + ShelterPosition - + + - - Prepend - 0 + + 0 + 0.1 + -0 - - + + + + + + - - - 0 - + + ShelterScale - + + + - - Prepend - 0 - - - - - - - - 90 - - - - - - - - - - Prepend - 1.57079637 - - - - - Prepend + 0.66 0.66 0.66 - - - modelview - TexturedModel - - - - - - - - normalMatrix - TexturedModel - - - - - - - - Texture0 - TexturedModel - shelter - Texture2D - - - - ProjectionMatrix - - - - projection - TexturedModel - - - - Light - - - - light - TexturedModel - - - - + + + + + + - UpdateMaterial + DrawTexturedModel + Draws a textured and transformed 3D model stimulus. Source1 + + ViewMatrix + + + + + + + + + Prepend + 0 + 0.1 + -0 + + - + + + - - Eye - - 1 - 1 - 1 - + + - - - - - - + + + + + + + + - - 1 - 1 - 1 - 1 + + 0 + + + + + - - colorAmbient - TexturedModel + + Prepend + 0 - + - - Eye - - 0 - 0 - 0 - + + + 0 + - + - - - + - - 0 - 0 - 0 - 1 - - - - - colorDiffuse - TexturedModel + + Prepend + 0 - + - - Eye - - 0 - 0 - 0 - + + + 90 + - + - - - + - - 0 - 0 - 0 - 1 + + Prepend + 1.57079637 + + + + + Prepend + 0.66 + 0.66 + 0.66 - colorSpecular + modelview + TexturedModel + + + + + + + + normalMatrix TexturedModel - + - - 10 + + Texture0 + TexturedModel + shelter + Texture2D + + ProjectionMatrix + - shininess + projection TexturedModel - - - - - - - - - - - - - - - - - - - - - - - - - - - - TexturedModel - Plane - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Draw3DStim - - - - ShelterCorner - - - - - - - - - - 0 - -0.09 - -0 - - - - - - - - - - - - 0.66 - 0.66 - 0.66 - - - - - - - - - + + Light + + + + light + TexturedModel + + + + + + + UpdateMaterial + + + + Source1 + + + + + + Eye + + 1 + 1 + 1 + + + + + + + + + + + + 1 + 1 + 1 + 1 + + + + + colorAmbient + TexturedModel + + + + + + + Eye + + 0 + 0 + 0 + + + + + + + + + + + + 0 + 0 + 0 + 1 + + + + + colorDiffuse + TexturedModel + + + + + + + Eye + + 0 + 0 + 0 + + + + + + + + + + + + 0 + 0 + 0 + 1 + + + + + colorSpecular + TexturedModel + + + + + + + + 10 + + + + + shininess + TexturedModel + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + TexturedModel + Plane + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + DrawShelterFloor + + + + Draw3DStim + + + + ShelterPosition + + + + + + + + + + 0 + -0.09 + -0 + + + + + + + + + + + ShelterScale + + + + + + + + + + + 0.66 + 0.66 + 0.66 + + + + + + + + + + + DrawTexturedModel + Draws a textured and transformed 3D model stimulus. + + + + Source1 + + + ViewMatrix + + + + + + + + + Prepend + 0 + -0.09 + -0 + + + + + + + + + + + + + + + + + + + + + + 0 + + + + + + + + + + Prepend + 0 + + + + + + + + 0 + + + + + + + + + + Prepend + 0 + + + + + + + + 90 + + + + + + + + + + Prepend + 1.57079637 + + + + + Prepend + 0.66 + 0.66 + 0.66 + + + + + modelview + TexturedModel + + + + + + + + normalMatrix + TexturedModel + + + + + + + + Texture0 + TexturedModel + Brown + Texture2D + + + + ProjectionMatrix + + + + projection + TexturedModel + + + + Light + + + + light + TexturedModel + + + + + + + UpdateMaterial + + + + Source1 + + + + + + Eye + + 1 + 1 + 1 + + + + + + + + + + + + 1 + 1 + 1 + 1 + + + + + colorAmbient + TexturedModel + + + + + + + Eye + + 0 + 0 + 0 + + + + + + + + + + + + 0 + 0 + 0 + 1 + + + + + colorDiffuse + TexturedModel + + + + + + + Eye + + 0 + 0 + 0 + + + + + + + + + + + + 0 + 0 + 0 + 1 + + + + + colorSpecular + TexturedModel + + + + + + + + 10 + + + + + shininess + TexturedModel + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 0.15 + + + + + + + alpha + TexturedModel + + + + + + TexturedModel + Plane + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + EnableShelter + + + + + + + + true + + + + EnableShelter + + + + Source1 + + + + + + + + + + + + + + + + + + + + + + + DebugTools + + + + + ArmEncoderPosition + + + + + + D + Control + + + + + + + 0.0150001 + 0 + + + + + + + 32 + + + + + + ArmCommands + + + + + ArmCommands + + + + + + 32 + Write + + + + + + Float + true + + + + + + 0 + + + + + + + 1 + + + + + + + + + + + ArmEvents + + + + + + 32 + Write + + + + + + Float + true + + + + + + 0 + + + + + + + 1 + + + + + + + + + + + DebugString + + + + + + + + + + GroundTruthFeedback + + + + ArmEvents + + + ArmMovingTo + + + + Source1 + + + Address + + + + 32 + + + + + + + + + + + + + + + + Float + true + + + + Seconds + + + + + Value + + + + + 0 + + + + + 1 + + + + + + + new( +it.Item1 as Seconds, +it.Item2 as Magnitude, +it.Item3 as Angle) + + + Magnitude,Angle + + + + + + TrueArmPosition + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + SessionTimer + + + + + + + TimeStep.ElapsedRealTime + + + + TimeSpan.FromSeconds(it) + + + + + + + + + + + + + Visualization + + + + Pylon1FrameEvents + + + Value.Image + + + + Spinnaker1FrameEvents + + + Value.Image + + + + Spinnaker2FrameEvents + + + Value.Image + + + + 2 + 2 + + + + + + + + + + + + + + + + + + + + + + ManualControl + + - DrawTexturedModel - Draws a textured and transformed 3D model stimulus. + Stimluli - - Source1 - - - ViewMatrix - - - - - - - - Prepend - 0 - -0.09 - -0 + + PageDown + Control - - - - - - - - - - - - - - - + - - 0 + + 2 - - - - + + PlayAudioStim - - Prepend - 0 + + PageUp + Control - - - - - 0 + + 0 - - - - - - - - Prepend - 0 - + + StopAudioStim + + + + + + + + + + + + VrEnvironment + + - - - - - 90 - + + - - - - + + + - - Prepend - 1.57079637 + + Insert + Control - - Prepend - 0.66 - 0.66 - 0.66 + + false - - modelview - TexturedModel + + + 0 + 0 + 0 + + + 0 + 0 + 0 + - - - - - - normalMatrix - TexturedModel - + + ResetRodentPosition - - - - - Texture0 - TexturedModel - Brown - Texture2D - - - - ProjectionMatrix - - - - projection - TexturedModel - - - - Light - - - - light - TexturedModel - - - - + + - UpdateMaterial + ManualOverride - - Source1 + + + + - - + + + A + - - Eye - - 1 - 1 - 1 - + + + -1 + 0 + 0 + - - - - - - + + + D + - + 1 - 1 - 1 - 1 + 0 + 0 - - colorAmbient - TexturedModel + + W - - - - - Eye - - 0 - 0 - 0 - + + + 0 + 0 + 1 + - - - - - - + + + S + - + 0 0 + -1 + + + + + Z + + + + + 0 + 1 0 - 1 - - colorDiffuse - TexturedModel + + X - - + + + 0 + -1 + 0 + - - Eye - - 0 - 0 - 0 - + + - - - + - - 0 - 0 - 0 - 1 + + + 0 + 0 + 1 + + + 0 + 0 + 0 + + + + - - colorSpecular - TexturedModel + + + 0.01 + 0.01 + 0.01 + + + 0 + 0 + 0 + + + + + - + - - - 10 - + + EnableManualOverride + + + + Source1 + + + + + + + true + + + + + + + + + + - - - shininess - TexturedModel - + + RodentPositionUpdate - - - + + + + + + + + - - - + + + - + - - - + + + + - + + + + + - - - - + + + - - - - 0.15 - - + + + Home + Control + - - - - alpha - TexturedModel - - + + ShelterPosition + + + Item1 + + + Item2 + + + + -1 + - - TexturedModel - Plane + + + + + + + + + + + 0 + 0 + 0 - + + + + + + + + + + 0 + 0 + 0 + + + 0 + 0 + 0 + + + + + ResetRodentPosition + - - - - - - - - - - + + + + + + - - - + + + + - + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - EnableShelter - - - - - - - - true - - - - EnableShelter + + Arm - - Source1 + + + + + + ArmManualOverride + + + + + + + Manual_Arm_Control + + + + + + + + + + Up + + + + + 0 + 1 + + + + + Down + + + + + 0 + -1 + + + + + Left + + + + + -1 + 0 + + + + + Right + + + + + 1 + 0 + + + + + + + + + + + 0.001 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + Source1 + + + + + + + true + + + + + + + + + + + + + UpdateArmCartPosition + + + + + + + + + + + + - - - - - - - - - - - - - - - 180 - - - - - - - YRotationAngle - - - - PT2S - - - - StartCameras - - - - DebugTools - - - - - ArmEncoderPosition - - - - - - D - Control - - - - - - - 0.0150001 - 0 - - - - - - - 32 - - - - - - ArmCommands - - - - - ArmCommands - - - - - - 32 - Write - - - - - - Float - true - - - - - - 0 - - - - - - - 1 - - - - - - - - - - - ArmEvents - - - - - - 32 - Write - - - - - - Float - true - - - - - - 0 - - - - - - - 1 - - - - - - - - - - - DebugString - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - SessionTimer - - - - - - TimeStep.ElapsedRealTime - - - - TimeSpan.FromSeconds(it) - - - - - - - - - - - - - Visualization - - - - Pylon1FrameEvents - - - Value.Image - - - - Spinnaker1FrameEvents - - - Value.Image - - - - Spinnaker2FrameEvents + + L + Control + - - Value.Image + + + 1 + - - - 2 - 2 - - - - - + + TriggerLoom - - - - - - - - - - PageDown - Control - - - - - - - - 2 - - - - PlayAudioStim - - - - PageUp - Control - - - - - 0 - - - - StopAudioStim - - - - 0.03 - - - - ArmGainEating - - - - 1 - - - - ArmGainTrial - - - ArmEncoderPosition - - - - - - - - - - - \ No newline at end of file