diff --git a/bonsai/Bonsai.config b/bonsai/Bonsai.config index 987dfe22..d8d0d951 100644 --- a/bonsai/Bonsai.config +++ b/bonsai/Bonsai.config @@ -1,10 +1,10 @@  - - - - + + + + @@ -22,8 +22,8 @@ - - + + @@ -35,7 +35,7 @@ - + @@ -111,10 +111,10 @@ - - - - + + + + @@ -137,8 +137,8 @@ - - + + @@ -149,7 +149,7 @@ - + diff --git a/workflows/social/EnvironmentEasy.yml b/workflows/social/EnvironmentEasy.yml index 4a9e24f7..b98412da 100644 --- a/workflows/social/EnvironmentEasy.yml +++ b/workflows/social/EnvironmentEasy.yml @@ -8,4 +8,5 @@ blocks: patches: patch1: { distributionRef: easy } patch2: { distributionRef: easy } - patch3: { distributionRef: easy } \ No newline at end of file + patch3: { distributionRef: easy } + patchDummy1: { distributionRef: easy } \ No newline at end of file diff --git a/workflows/social/EnvironmentRandom.yml b/workflows/social/EnvironmentRandom.yml index cc26431c..e01cf533 100644 --- a/workflows/social/EnvironmentRandom.yml +++ b/workflows/social/EnvironmentRandom.yml @@ -9,6 +9,9 @@ distributions: hard: rate: 0.002 offset: 75 + dummy: + rate: .inf + offset: 375 blocks: - &baseParameters weight: 1 @@ -18,38 +21,46 @@ blocks: patch1: { distributionRef: easy } patch2: { distributionRef: easy } patch3: { distributionRef: easy } - - <<: *baseParameters + patchDummy1: { distributionRef: dummy } + - <<: *baseParameters patches: patch1: { distributionRef: easy } patch2: { distributionRef: medium } patch3: { distributionRef: hard } + patchDummy1: { distributionRef: dummy } - <<: *baseParameters patches: patch1: { distributionRef: easy } patch2: { distributionRef: hard } patch3: { distributionRef: medium } + patchDummy1: { distributionRef: dummy } - <<: *baseParameters patches: patch1: { distributionRef: medium } patch2: { distributionRef: easy } patch3: { distributionRef: hard } + patchDummy1: { distributionRef: dummy } - <<: *baseParameters patches: patch1: { distributionRef: medium } patch2: { distributionRef: hard } patch3: { distributionRef: easy } + patchDummy1: { distributionRef: dummy } - <<: *baseParameters patches: patch1: { distributionRef: hard } patch2: { distributionRef: easy } patch3: { distributionRef: medium } + patchDummy1: { distributionRef: dummy } - <<: *baseParameters patches: patch1: { distributionRef: hard } patch2: { distributionRef: medium } patch3: { distributionRef: easy } + patchDummy1: { distributionRef: dummy } - <<: *baseParameters patches: patch1: { distributionRef: hard } patch2: { distributionRef: hard } - patch3: { distributionRef: hard } \ No newline at end of file + patch3: { distributionRef: hard } + patchDummy1: { distributionRef: dummy } \ No newline at end of file diff --git a/workflows/social/Environments/.gitignore b/workflows/social/Environments/.gitignore new file mode 100644 index 00000000..ad30bfec --- /dev/null +++ b/workflows/social/Environments/.gitignore @@ -0,0 +1 @@ +*.yml \ No newline at end of file diff --git a/workflows/social/Environments/README.md b/workflows/social/Environments/README.md new file mode 100644 index 00000000..24937203 --- /dev/null +++ b/workflows/social/Environments/README.md @@ -0,0 +1,5 @@ +## Randomly Sampled Environments + +This folder contains dynamic YAML configuration files to be sampled. The workflow will randomly sample from the list of files when manually reloading the environment and at midnight each day. If the list is empty, or if the sampled file is invalid, the current environment configuration will be maintained. + +The default environment configuration will be used if no configuration file is loaded. In this case, the environment configuration name will be empty in the experiment metadata text box. \ No newline at end of file diff --git a/workflows/social/EnvironmentExample.yml b/workflows/social/ExampleEnvironment.yml similarity index 80% rename from workflows/social/EnvironmentExample.yml rename to workflows/social/ExampleEnvironment.yml index 9d16a0c0..24083601 100644 --- a/workflows/social/EnvironmentExample.yml +++ b/workflows/social/ExampleEnvironment.yml @@ -20,13 +20,16 @@ blocks: patch1: { distributionRef: easy } patch2: { distributionRef: easy } patch3: { distributionRef: easy } + patchDummy1: { distributionRef: easy } - <<: *baseParameters patches: patch1: { distributionRef: easy } patch2: { distributionRef: medium } patch3: { distributionRef: hard } + patchDummy1: { distributionRef: easy } - <<: *baseParameters patches: patch1: { distributionRef: hard } patch2: { distributionRef: hard } - patch3: { distributionRef: hard } \ No newline at end of file + patch3: { distributionRef: hard } + patchDummy1: { distributionRef: easy } \ No newline at end of file diff --git a/workflows/social/Extensions.csproj b/workflows/social/Extensions.csproj index 2047db82..642742a6 100644 --- a/workflows/social/Extensions.csproj +++ b/workflows/social/Extensions.csproj @@ -1,21 +1,21 @@ - - net472 - true - + + net472 + true + - - - - - - - - - - - - + + + + + + + + + + + + \ No newline at end of file diff --git a/workflows/social/Extensions/ActiveSubjectPoses.bonsai b/workflows/social/Extensions/ActiveSubjectPoses.bonsai deleted file mode 100644 index 2cf51abb..00000000 --- a/workflows/social/Extensions/ActiveSubjectPoses.bonsai +++ /dev/null @@ -1,141 +0,0 @@ - - - - - - SubjectStart - - - - - - Source1 - - - ActiveSubject - - - PoseTrackingTop - - - - - - Value - - - ActiveSubject - - - Value.Id - - - - - - - - - Item1 - - - - - - - - SubjectStop - - - Value.Id - - - IsActiveSubject - - - - Source1 - - - ActiveSubject - - - Value.Id - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - PoseTrackingTop - - - - - - Seconds - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/workflows/social/Extensions/ActiveSubjectVisualizerBuilder.cs b/workflows/social/Extensions/ActiveSubjectVisualizerBuilder.cs deleted file mode 100644 index ff6015e4..00000000 --- a/workflows/social/Extensions/ActiveSubjectVisualizerBuilder.cs +++ /dev/null @@ -1,35 +0,0 @@ -using Bonsai; -using System; -using System.ComponentModel; -using System.Collections.Generic; -using Bonsai.Sleap; -using Bonsai.Sleap.Design; -using OpenCV.Net; - -[Combinator] -[Description("Provides a type visualizer that draws a visual representation of active subjects.")] -[TypeVisualizer(typeof(ActiveSubjectVisualizer))] -[WorkflowElementIcon("Bonsai:ElementIcon.Visualizer")] -[WorkflowElementCategory(ElementCategory.Combinator)] -public class ActiveSubjectVisualizerBuilder -{ - public IObservable, IplImage>> Process(IObservable, IplImage>> source) - { - return source; - } -} - -public class ActiveSubjectVisualizer : PoseIdentityCollectionVisualizer -{ - public override void Show(object value) - { - var sourceValue = (Tuple, IplImage>)value; - var image = sourceValue.Item2; - var poseIdentities = new PoseIdentityCollection(image); - foreach (var pose in sourceValue.Item1) - { - poseIdentities.Add(pose); - } - base.Show(poseIdentities); - } -} diff --git a/workflows/social/Extensions/Alerts.bonsai b/workflows/social/Extensions/Alerts.bonsai index e49f22e2..580452b4 100644 --- a/workflows/social/Extensions/Alerts.bonsai +++ b/workflows/social/Extensions/Alerts.bonsai @@ -1,5 +1,5 @@  - - + + Test1 + ActiveSubjectPose @@ -742,15 +744,6 @@ Item1 as Value) PT5M - - ## **Tracking Unstable** -**Subject**: {0} - - Identity - - - SubjectAlertMessages - {0} Identity @@ -779,9 +772,7 @@ Item1 as Value) - - diff --git a/workflows/social/Extensions/AverageLightIntensity.bonsai b/workflows/social/Extensions/AverageLightIntensity.bonsai new file mode 100644 index 00000000..209bfb1c --- /dev/null +++ b/workflows/social/Extensions/AverageLightIntensity.bonsai @@ -0,0 +1,139 @@ + + + Measures average pixel intensity across the light monitor camera. + + + + + + + CameraLightMonitor + + + + + + Source1 + + + Image + + + + + + Val0 + + + + + + + + + + + + + + PT1S + + + + HasMeasures + + + + Source1 + + + Count + + + + 0 + + + + + + + + + + + + + AverageIntensity + + + + Source1 + + + + + + Value + + + + + + Seconds + + + + + + + + + + + + + + + + + + + + + + + + + + + Event + + 204 + TimestampedFloat + + + + + + + LightMonitor + + + + + + + + + + + + + + \ No newline at end of file diff --git a/workflows/social/Extensions/ControlPanel.bonsai b/workflows/social/Extensions/ControlPanel.bonsai index 78f2e81a..b3492ec6 100644 --- a/workflows/social/Extensions/ControlPanel.bonsai +++ b/workflows/social/Extensions/ControlPanel.bonsai @@ -1,5 +1,5 @@  - StartCameras - - - - LButton ShiftKey ControlKey Space Prior PageUp D0 D1 A P Q NumPad0 NumPad1 F1 F2 Shift - false - - + + + LButton ShiftKey ControlKey Space Prior PageUp D0 D1 A P Q NumPad0 NumPad1 F1 F2 Shift + false + - - - StopCameras - + + StopCameras PatchActivity @@ -141,7 +136,7 @@ 0 - 3 + 4 @@ -153,7 +148,7 @@ 1 - 4 + 5 @@ -165,7 +160,7 @@ 2 - 5 + 6 @@ -281,32 +276,6 @@ - - false - false - - - - VideoEvents - - - - Reload Environment - - - - ReloadEnvironment - - - - PatchStatistics - 1 - 2 - - - - - RfidMeasurements @@ -330,6 +299,18 @@ + + PatchState + + + + + 3 + 7 + + + + TimeSinceLastVisit @@ -453,30 +434,25 @@ - + - + - + - - - + + + - - + + - - - + + + - - - - - @@ -484,32 +460,44 @@ SubjectActivity - - Heatmap + + false + false - CameraTop - - - TrackingTop - - - Value + VideoEvents - + + Reload Environment + - - Centroid + + ReloadEnvironment + + + + Environment + 1 + 2 + + + + + SubjectPoses + - Value.Image + Value - LightMonitor + CameraLightMonitor + + + Value.Image @@ -524,18 +512,20 @@ - - + + - + - + - - - + + + + + @@ -734,15 +724,22 @@ Item1.MaxPellets as BlockThreshold, .TotalMinutes as BlockDueTime, Item3 as BlockCount) + + EnvironmentConfiguration + + + string.IsNullOrEmpty(Name) ? "NO ENVIRONMENT LOADED" : Name + - Block ({9}, plt: {10}, thr: {11}, timeout: {12:0.##}) + {13} +Block ({9}, plt: {10}, thr: {11}, timeout: {12:0.##}) P1 (rate: {2}, d0: {1}, thr: {0:0.##}) P2 (rate: {5}, d0: {4}, thr: {3:0.##}) P3 (rate: {8}, d0: {7}, thr: {6:0.##}) - Item1.Threshold,Item1.D0,Item1.Rate,Item2.Threshold,Item2.D0,Item2.Rate,Item3.Threshold,Item3.D0,Item3.Rate,Item4.BlockCount,Item4.BlockPelletCount,Item4.BlockThreshold,Item4.BlockDueTime + Item1.Threshold,Item1.D0,Item1.Rate,Item2.Threshold,Item2.D0,Item2.Rate,Item3.Threshold,Item3.D0,Item3.Rate,Item4.BlockCount,Item4.BlockPelletCount,Item4.BlockThreshold,Item4.BlockDueTime,Item5 @@ -758,23 +755,44 @@ P3 (rate: {8}, d0: {7}, thr: {6:0.##}) Percent - 60 + 57.5 Percent - 40 + 42.5 - Patch1Controller + PatchDummy1PelletDelivered - - - 1 - + + RisingEdge + + + + Source1 + + + Value + + + + + + + + + + + PatchDummy1Controller + PatchDummy1Dispenser + PatchDummy1 + + + Patch1Controller Reset @@ -837,11 +855,6 @@ P3 (rate: {8}, d0: {7}, thr: {6:0.##}) Patch2Controller - - - 1 - - Reset @@ -903,11 +916,6 @@ P3 (rate: {8}, d0: {7}, thr: {6:0.##}) Patch3Controller - - - 1 - - Reset @@ -971,29 +979,29 @@ P3 (rate: {8}, d0: {7}, thr: {6:0.##}) - + - + - + - + - + - + - + - + @@ -1004,33 +1012,35 @@ P3 (rate: {8}, d0: {7}, thr: {6:0.##}) - + - + - + + - - - + - + + - + - - + + - + + + EnvironmentSubjectState @@ -1104,6 +1114,24 @@ FilteredWeight.Value - BaselinedWeight.Value as Baseline) + + + EnvironmentState + 1 + 2 + + + + Percent + 40 + + + Percent + 60 + + + + @@ -1165,6 +1193,12 @@ FilteredWeight.Value - BaselinedWeight.Value as Baseline) Value.Image + + Heatmap + + + LedTrackingImage + @@ -1181,6 +1215,8 @@ FilteredWeight.Value - BaselinedWeight.Value as Baseline) CameraPatch1 CameraPatch2 CameraPatch3 + HeatMap + LedTrackingTop @@ -1188,25 +1224,27 @@ FilteredWeight.Value - BaselinedWeight.Value as Baseline) - + - + - + - + - + - + - + - + - - - + + + + + @@ -1218,7 +1256,11 @@ FilteredWeight.Value - BaselinedWeight.Value as Baseline) + + + + \ No newline at end of file diff --git a/workflows/social/Extensions/Declarations.bonsai b/workflows/social/Extensions/Declarations.bonsai index a0ba1571..2ce08b67 100644 --- a/workflows/social/Extensions/Declarations.bonsai +++ b/workflows/social/Extensions/Declarations.bonsai @@ -9,7 +9,6 @@ xmlns:p1="clr-namespace:Social;assembly=Extensions" xmlns:aeon-frg="clr-namespace:Aeon.Foraging;assembly=Aeon.Foraging" xmlns:p2="clr-namespace:Harp.OutputExpander;assembly=Harp.OutputExpander" - xmlns:p3="clr-namespace:OpenCV.Net;assembly=OpenCV.Net" xmlns="https://bonsai-rx.org/2018/workflow"> @@ -34,6 +33,9 @@ Patch3State + + PatchDummy1State + BlockState @@ -64,6 +66,9 @@ Patch3Dispenser + + PatchDummy1Dispenser + SubjectState @@ -85,9 +90,6 @@ SubjectAlertMessages - - LightMonitor - diff --git a/workflows/social/Extensions/Environment.json b/workflows/social/Extensions/Environment.json index 9e55a117..397f64f1 100644 --- a/workflows/social/Extensions/Environment.json +++ b/workflows/social/Extensions/Environment.json @@ -5,6 +5,10 @@ "title": "Environment", "type": "object", "properties": { + "name": { + "type": "string", + "description": "An optional name for the environment configuration." + }, "distributions": { "type": "object", "description": "Specifies a pre-defined set of named probability distributions.", diff --git a/workflows/social/Extensions/EnvironmentLogic.bonsai b/workflows/social/Extensions/EnvironmentLogic.bonsai index 7dda715f..2d3a86f2 100644 --- a/workflows/social/Extensions/EnvironmentLogic.bonsai +++ b/workflows/social/Extensions/EnvironmentLogic.bonsai @@ -1,14 +1,16 @@  - @@ -21,32 +23,292 @@ Random + + DayTransition + + + + Heartbeats + + + + + + Day + + + + + + + 1 + + + + + DayTransition + + + + + + + + + + + + + + ReloadEnvironment - - + + Value - - ReadEnvironment + + + + + ReloadEnvironment - - + + Source1 - - - EnvironmentRandom.yml - + + GetEnvironmentFiles + + + + + + + + Environments + *.yml + TopDirectoryOnly + + + + + + + + + - - + + NonEmpty + + + + Source1 + + + Length + + + + 0 + + + + + + + + + + - - + + SampleEnvironment + + + + Source1 + + + EnvironmentFiles + + + EnvironmentFiles + + + EnvironmentFiles + + + Length + + + + 1 + + + + + + + + + + 0 + 0 + + + + + + + + + + + + + 0 + + + + + + + + + + + + + + + + + - - + + ReadEnvironment + + + + Source1 + + + Path + + + Path + + + + + + + + + + + + + + + + + + + + Path + + + + + + WriteErrorTrace + + + + Source1 + + + OnError + + + + Source1 + + + Item1.Kind + + + + OnError + + + + + + + + + + + + + "[LoadEnvironment Error]: (" + Item2 + ") " + Item1.Exception.ToString() + + + + + + + + + + + + + + + + OnNext + + + + Source1 + + + Item1.HasValue + + + + + + + + + + + Item1.Value + + + + + + + + + + + + + + + + + + + @@ -62,6 +324,130 @@ EnvironmentConfiguration + + EnvironmentLoaded + + + PatchLogic + + + + Patch1WheelDisplacement + + + Value + + + + + + + Patch1DistanceState + 75 + 0.01 + Patch1DeliveryCount + Patch1State + + + Patch1DeliverPellet + + + Patch1ThresholdCrossing + + + Patch2WheelDisplacement + + + Value + + + + + + + Patch2DistanceState + 75 + 0.01 + Patch2DeliveryCount + Patch2State + + + Patch2DeliverPellet + + + Patch2ThresholdCrossing + + + Patch3WheelDisplacement + + + Value + + + + + + + Patch3DistanceState + 75 + 0.01 + Patch3DeliveryCount + Patch3State + + + Patch3DeliverPellet + + + Patch3ThresholdCrossing + + + PatchDummy1WheelDisplacement + + + Value + + + + + + + PatchDummy1DistanceState + 75 + 0.01 + PatchDummy1DeliveryCount + PatchDummy1State + + + PatchDummy1DeliverPellet + + + PatchDummy1ThresholdCrossing + + + + + + + + + + + + + + + + + + + + + + + + + + BlockLogic @@ -226,7 +612,7 @@ - ReloadEnvironment + EnvironmentLoaded @@ -353,16 +739,14 @@ - - - 1 - 1 - 1 - + + + 1 + - + @@ -429,13 +813,13 @@ - - 5 - 15 + + 0 + 0 - + Random @@ -450,13 +834,13 @@ - - 0 - 0 + + 0 + 0 - + Heartbeats @@ -489,6 +873,8 @@ Item1["patch2"].Distribution.Rate as RatePatch2, Item1["patch3"].Distribution.Offset as ThresholdPatch3, Item1["patch3"].Distribution.Rate as RatePatch3, + Item1["patchDummy1"].Distribution.Offset as ThresholdPatchDummy1, + Item1["patchDummy1"].Distribution.Rate as RatePatchDummy1, 0 as BlockPelletCount, Item2 as BlockMaxPellets, Item3 as BlockDueTime @@ -577,17 +963,33 @@ RatePatch3 as Rate) Patch3State + + new( +Double.NaN as Threshold, +ThresholdPatchDummy1 as D0, +RatePatchDummy1 as Rate) + + + Threshold,D0,Rate + + + + PatchDummy1State + + + + @@ -612,10 +1014,10 @@ RatePatch3 as Rate) - - 0 - 0 - 0 + + 0 + 0 + 0 @@ -639,15 +1041,6 @@ RatePatch3 as Rate) - - new( - ThresholdPatch1 as ThresholdPatch1, - RatePatch1 as RatePatch1, - ThresholdPatch2 as ThresholdPatch2, - RatePatch2 as RatePatch2, - ThresholdPatch3 as ThresholdPatch3, - RatePatch3 as RatePatch3) - @@ -656,110 +1049,6 @@ RatePatch3 as Rate) - - - - - - - - - - - - - - - - PatchLogic - - - - Patch1WheelDisplacement - - - Value - - - - - - - Patch1DistanceState - 75 - 0.01 - Patch1DeliveryCount - Patch1State - - - Patch1DeliverPellet - - - Patch1ThresholdCrossing - - - Patch2WheelDisplacement - - - Value - - - - - - - Patch2DistanceState - 75 - 0.01 - Patch2DeliveryCount - Patch2State - - - Patch2DeliverPellet - - - Patch2ThresholdCrossing - - - Patch3WheelDisplacement - - - Value - - - - - - - Patch3DistanceState - 75 - 0.01 - Patch3DeliveryCount - Patch3State - - - Patch3DeliverPellet - - - Patch3ThresholdCrossing - - - - - - - - - - - - - - - - - - @@ -784,6 +1073,9 @@ RatePatch3 as Rate) Patch3ThresholdCrossing + + PatchDummy1ThresholdCrossing + UpdatePelletCount @@ -811,10 +1103,10 @@ RatePatch3 as Rate) - - 0 - 0 - 0 + + 0 + 0 + 0 @@ -843,17 +1135,18 @@ RatePatch3 as Rate) - - - + + + + - - - + + + \ No newline at end of file diff --git a/workflows/social/Extensions/FormatBinaryRegions.cs b/workflows/social/Extensions/FormatBinaryRegions.cs new file mode 100644 index 00000000..08059e0f --- /dev/null +++ b/workflows/social/Extensions/FormatBinaryRegions.cs @@ -0,0 +1,60 @@ +using Bonsai; +using System; +using System.ComponentModel; +using System.Linq; +using System.Reactive.Linq; +using Bonsai.Vision; +using Bonsai.Harp; + +[Combinator] +[Description("Converts timestamped binary regions into a sequence of Harp messages.")] +[WorkflowElementCategory(ElementCategory.Transform)] +public class FormatBinaryRegions +{ + private int address = 200; + public int Address + { + get { return address; } + set { address = value; } + } + + + public IObservable Process(IObservable> source) + { + return source.Select(x => + { + var region = x.Value; + var timestamp = x.Seconds; + return HarpMessage.FromSingle( + address, + timestamp, + MessageType.Event, + region.Centroid.X, + region.Centroid.Y, + (float)region.Orientation, + (float)region.MajorAxisLength, + (float)region.MinorAxisLength, + (float)region.Area); + }); + } + + public IObservable Process(IObservable> source) + { + return source.SelectMany(x => + { + var regions = x.Value; + var timestamp = x.Seconds; + return regions.Select((region, index) => HarpMessage.FromSingle( + address, + timestamp, + MessageType.Event, + region.Centroid.X, + region.Centroid.Y, + (float)region.Orientation, + (float)region.MajorAxisLength, + (float)region.MinorAxisLength, + (float)region.Area, + index)); + }); + } +} \ No newline at end of file diff --git a/workflows/social/Extensions/FormatRegionVisits.bonsai b/workflows/social/Extensions/FormatRegionVisits.bonsai index 5de493b4..343b2684 100644 --- a/workflows/social/Extensions/FormatRegionVisits.bonsai +++ b/workflows/social/Extensions/FormatRegionVisits.bonsai @@ -1,5 +1,5 @@  -Formats region entry and exit events for the event log. + + Source1 + + + Value + + + + 1 + + SubjectState @@ -18,38 +29,31 @@ - - Source1 - - - Value - - - 1 - + - + new( Item1.Seconds as Seconds, -new(Item2.Value.Id as Id, +new(Item2.Item1.Value.Id as Id, Item1.Value ? "Enter" : "Exit" as Event, - Item3 as Value) as Value) + Item2.Item2 as Value) as Value) - + - - + + - - + + + \ No newline at end of file diff --git a/workflows/social/Extensions/GetActiveSubject.cs b/workflows/social/Extensions/GetActiveSubject.cs index 5a7a6412..e1d17edd 100644 --- a/workflows/social/Extensions/GetActiveSubject.cs +++ b/workflows/social/Extensions/GetActiveSubject.cs @@ -15,7 +15,7 @@ public class GetActiveSubject [Description("The identity of the pose to retrieve.")] public string Identity { get; set; } - public IObservable> Process(IObservable>> source) + public IObservable> Process(IObservable> source) { return source.Select(timestampedPoses => Timestamped.Create( timestampedPoses.Value.FirstOrDefault(pose => pose.Identity == Identity), diff --git a/workflows/social/Extensions/GetLinearDrivePosition.cs b/workflows/social/Extensions/GetLinearDrivePosition.cs index 0a11821d..49192b1c 100644 --- a/workflows/social/Extensions/GetLinearDrivePosition.cs +++ b/workflows/social/Extensions/GetLinearDrivePosition.cs @@ -1,7 +1,6 @@ using Bonsai; using System; using System.ComponentModel; -using System.Collections.Generic; using System.Linq; using System.Reactive.Linq; using Bonsai.Vision; @@ -26,6 +25,9 @@ public GetLinearDrivePosition() [Description("The coordinates of the arena center, in pixels.")] public Point ArenaCenter { get; set; } + [Description("The coordinates of the motor plumb line on the floor of the arena, in pixels.")] + public Point MotorPlumbLine { get; set; } + [Description("The radius of the circular arena, in pixels.")] public double ArenaRadiusPixels { get; set; } @@ -44,9 +46,6 @@ public GetLinearDrivePosition() [Description("Length of the linear drive rail, in centimeters.")] public double LinearRailLength { get; set; } - [Description("Horizontal distance between center of the arena and the plumb line from the bottom of the tether guide, in centimeters.")] - public double RadialDistanceOffset { get; set; } - public IObservable Process(IObservable source) { return source.Select(value => @@ -57,13 +56,22 @@ public IObservable Process(IObservable sou var center = ArenaCenter; var tetherGuideAltitude = TetherGuideAltitude; // c2 var tetherGuideHeight = TetherGuideHeight; + var motorPlumbLine = MotorPlumbLine; var pixelsToCentimeters = ArenaRadiusCentimeters / ArenaRadiusPixels; var centroid = value[0].Centroid; centroid.X -= center.X; centroid.Y -= center.Y; - var radialDistance = Math.Sqrt(centroid.X * centroid.X + centroid.Y * centroid.Y) * pixelsToCentimeters + RadialDistanceOffset; // c1 + + // Get motor plumb line position relative to the arena center + var motorOffsetX = motorPlumbLine.X - center.X; + var motorOffsetY = motorPlumbLine.Y - center.Y; + + // Compute radial distance from the motor's plumb line + var radialDistance = Math.Sqrt((centroid.X - motorOffsetX) * (centroid.X - motorOffsetX) + (centroid.Y - motorOffsetY) * (centroid.Y - motorOffsetY)) * pixelsToCentimeters; var distanceToTetherGuide = Math.Sqrt(radialDistance * radialDistance + tetherGuideAltitude * tetherGuideAltitude); - var tetherGuideSlack = distanceToTetherGuide - tetherGuideAltitude; // D + + // Slack adjustment and motor position + var tetherGuideSlack = distanceToTetherGuide - tetherGuideAltitude; var remainingSlack = TetherMaxSlackLength - tetherGuideSlack; var linearMotorPosition = Math.Sqrt(remainingSlack * remainingSlack - tetherGuideHeight * tetherGuideHeight); return linearMotorPosition / LinearRailLength; diff --git a/workflows/social/Extensions/LoadEnvironment.bonsai b/workflows/social/Extensions/LoadEnvironment.bonsai new file mode 100644 index 00000000..fc1cd74c --- /dev/null +++ b/workflows/social/Extensions/LoadEnvironment.bonsai @@ -0,0 +1,145 @@ + + + + + + Source1 + + + Deserialize + + + + Source1 + + + Path + + + Path + + + + + + + + + + + + + + + + + + + + Path + + + + + + WriteErrorTrace + + + + Source1 + + + OnError + + + + Source1 + + + Item1.Kind + + + + OnError + + + + + + + + + + + + + "[LoadEnvironment Error]: (" + Item2 + ") " + Item1.Exception.ToString() + + + + + + + + + + + + + + + + OnNext + + + + Source1 + + + Item1.HasValue + + + + + + + + + + + Item1.Value + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/workflows/social/Extensions/Logging.bonsai b/workflows/social/Extensions/Logging.bonsai index 6b15e94c..f22e8124 100644 --- a/workflows/social/Extensions/Logging.bonsai +++ b/workflows/social/Extensions/Logging.bonsai @@ -1,11 +1,12 @@  - @@ -140,6 +141,19 @@ Heartbeats PT2S + + LedTrackingTop + + + + 210 + + + + CameraTop + Heartbeats + PT2S + PoseTrackingTop @@ -165,15 +179,30 @@ + + PoseIdentityCollection + +
202
+ CameraTop + PoseTrackingMetadata +
+ + PoseIdentityMatching + + +
203
CameraTop PoseTrackingMetadata
+ + + @@ -181,9 +210,15 @@ - - - + + + + + + + + + @@ -259,6 +294,14 @@ CameraPatch3 125 + + LightMonitor + + + CameraLightMonitor + + + Patch1Events @@ -466,6 +509,55 @@ Item3 as Delta) Patch3_State + + PatchDummy1Events + + + PatchDummy1Dispenser + + + Patch3Events + + + + 200 + + + + + + + PatchDummy1 + Heartbeats + PT2S + + + PatchDummy1State + + + new( +Item1 as Threshold, +Item2 as D1, +Item3 as Delta) + + + PatchDummy1Events + + + + Timestamp + false + + + + + + + Heartbeats + PT2S + PatchDummy1_State + + BlockState @@ -478,6 +570,17 @@ Item3 as Delta) Environment_BlockState + + EnvironmentConfiguration + + + Patch1Events + + + Heartbeats + PT2S + Environment_ActiveConfiguration + AudioAmbient @@ -611,6 +714,22 @@ new(Value.Id as Id, Heartbeats PT2S + + GateEastRfidEvents + + + GateEastRfid + Heartbeats + PT2S + + + GateWestRfidEvents + + + GateWestRfid + Heartbeats + PT2S + Patch1RfidEvents @@ -635,6 +754,14 @@ new(Value.Id as Id, Heartbeats PT2S + + PatchDummy1RfidEvents + + + PatchDummy1Rfid + Heartbeats + PT2S + PT0S @@ -733,105 +860,123 @@ new(Value.Id as Id, - - - - - - - - - + + + + + + + + + - - - - + + - - - - - - - - + + + + + + + + + - - - - + + + - - - - - - - - + + + + + + + + + - - - - + + + - - - - - - - - + + + + + + + + + + - - + + + + + - - - - + + - - - - - + + - - - - - - - - - - - - + + + + + + + + + + + + + + + + - + - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + +
\ No newline at end of file diff --git a/workflows/social/Extensions/PoseTracking.bonsai b/workflows/social/Extensions/PoseTracking.bonsai index db31b17b..c0c239f4 100644 --- a/workflows/social/Extensions/PoseTracking.bonsai +++ b/workflows/social/Extensions/PoseTracking.bonsai @@ -1,9 +1,11 @@  - @@ -64,7 +66,6 @@ - @@ -85,6 +86,41 @@ PoseTrackingEvents + + + + + FindPoseIdentityMatching + + + + Source1 + + + + + + + + + + + + + + + + + + + + + + + new( +Item1 as PoseIdentityCollection, +Item2 as PoseIdentityMatching) + PoseTrackingMetadata @@ -116,11 +152,16 @@ + - + - - + + + + + + diff --git a/workflows/social/Extensions/Social.Generated.cs b/workflows/social/Extensions/Social.Generated.cs index c6c2f219..473ec6d2 100644 --- a/workflows/social/Extensions/Social.Generated.cs +++ b/workflows/social/Extensions/Social.Generated.cs @@ -426,10 +426,30 @@ public System.IObservable Process() public partial class Environment { + private string _name; + private System.Collections.Generic.IDictionary _distributions; private System.Collections.Generic.List _blocks = new System.Collections.Generic.List(); + /// + /// An optional name for the environment configuration. + /// + [Newtonsoft.Json.JsonPropertyAttribute("name", Order = int.MinValue)] + [YamlDotNet.Serialization.YamlMemberAttribute(Alias="name")] + [System.ComponentModel.DescriptionAttribute("An optional name for the environment configuration.")] + public string Name + { + get + { + return _name; + } + set + { + _name = value; + } + } + /// /// Specifies a pre-defined set of named probability distributions. /// @@ -473,6 +493,7 @@ public System.IObservable Process() return System.Reactive.Linq.Observable.Defer(() => System.Reactive.Linq.Observable.Return( new Environment { + Name = _name, Distributions = _distributions, Blocks = _blocks })); diff --git a/workflows/social/Extensions/TetherSlackController.bonsai b/workflows/social/Extensions/TetherSlackController.bonsai index 886585e6..80898a58 100644 --- a/workflows/social/Extensions/TetherSlackController.bonsai +++ b/workflows/social/Extensions/TetherSlackController.bonsai @@ -1,5 +1,5 @@ - - + @@ -23,7 +23,7 @@ - + @@ -31,6 +31,10 @@ 731 561 + + 0 + 0 + 510 100 129.5 diff --git a/workflows/social/Extensions/ValidateEnvironment.cs b/workflows/social/Extensions/ValidateEnvironment.cs index 3c9848b8..caad23f8 100644 --- a/workflows/social/Extensions/ValidateEnvironment.cs +++ b/workflows/social/Extensions/ValidateEnvironment.cs @@ -8,10 +8,17 @@ [WorkflowElementCategory(ElementCategory.Sink)] public class ValidateEnvironment { + public string Path { get; set; } + public IObservable Process(IObservable source) { return source.Do(environment => { + if (string.IsNullOrEmpty(environment.Name)) + { + environment.Name = System.IO.Path.GetFileNameWithoutExtension(Path); + } + foreach (var block in environment.Blocks) { foreach (var patch in block.Patches.Values) diff --git a/workflows/social/Extensions/Visualization.bonsai b/workflows/social/Extensions/Visualization.bonsai index c2c20703..51188c8c 100644 --- a/workflows/social/Extensions/Visualization.bonsai +++ b/workflows/social/Extensions/Visualization.bonsai @@ -1,5 +1,5 @@  - Patch3DistanceState + + PatchDummy1DistanceState + Patch1State @@ -95,6 +98,12 @@ Item1 + + PatchDummy1State + + + Item1 + @@ -555,7 +564,15 @@ Item3 as Patch3) Patch3TimeSinceLastVisit - + + PoseTrackingTop + + + + + + PoseIdentityMatching + SubjectPoses @@ -1260,6 +1277,28 @@ Value.Location as Location, Value.TagId as TagId, "Gate" as Name, 0 as Index) + + + GateEastRfidInboundDetected + + + new( +Seconds as Seconds, +Value.Location as Location, +Value.TagId as TagId, +"GateEast" as Name, +1 as Index) + + + GateWestRfidInboundDetected + + + new( +Seconds as Seconds, +Value.Location as Location, +Value.TagId as TagId, +"GateWest" as Name, +2 as Index) NestRfid1InboundDetected @@ -1270,7 +1309,7 @@ Seconds as Seconds, Value.Location as Location, Value.TagId as TagId, "NestRfid1" as Name, -1 as Index) +3 as Index) NestRfid2InboundDetected @@ -1281,7 +1320,7 @@ Seconds as Seconds, Value.Location as Location, Value.TagId as TagId, "NestRfid2" as Name, -2 as Index) +4 as Index) Patch1RfidInboundDetected @@ -1292,7 +1331,7 @@ Seconds as Seconds, Value.Location as Location, Value.TagId as TagId, "Patch1" as Name, -3 as Index) +5 as Index) Patch2RfidInboundDetected @@ -1303,7 +1342,7 @@ Seconds as Seconds, Value.Location as Location, Value.TagId as TagId, "Patch2" as Name, -4 as Index) +6 as Index) Patch3RfidInboundDetected @@ -1314,7 +1353,18 @@ Seconds as Seconds, Value.Location as Location, Value.TagId as TagId, "Patch3" as Name, -5 as Index) +7 as Index) + + + PatchDummy1RfidInboundDetected + + + new( +Seconds as Seconds, +Value.Location as Location, +Value.TagId as TagId, +"PatchDummy1" as Name, +8 as Index) @@ -1340,161 +1390,172 @@ Value.TagId as TagId, - - - - - - - - - - - + + + + + + + + + + + - + + - - + - + + - - + - + + - - + - + + - + - + - - - - - - - - - - - - - + + + + + + + + + + + + + - - + - + - + + - + - + - + - + - - - + + + - + - - - - + + + - - - - - - + + + + + + + - - - - + + + + - + - - + - - + + + - + - + + - - + + - + - + - + - + - + - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/workflows/social/Social-AEON3.bonsai b/workflows/social/Social-AEON3.bonsai index 933a2abb..9e6d31b1 100644 --- a/workflows/social/Social-AEON3.bonsai +++ b/workflows/social/Social-AEON3.bonsai @@ -1,7 +1,13 @@  - @@ -69,7 +75,7 @@ GlobalTrigger GlobalTriggerFrequency - 7500 + 4500 23032909 0 1 @@ -323,6 +329,36 @@ + + CameraLightMonitor + + + + + + + + + + + + + LocalTrigger + LocalTriggerFrequency + INF + 21199218 + 0 + 2 + CameraLightMonitor + + + + + + + + + AudioAmbient @@ -453,6 +489,42 @@ + + PatchDummy1 + + + + + + + + + + + + + + + + PatchDummy1Events + SampleRate500Hz + PatchDummy1DeliverPellet + PatchDummy1PelletDelivered + PT1S + 2 + PatchDummy1ResetFeeder + COM20 + -4 + PatchDummy1WheelDisplacement + + + + + + + + + Nest @@ -568,6 +640,64 @@ + + GateEastRfid + + + + + + + + + + + None + COM22 + GateEastRfidEvents + + 977 + 984 + + GateEastRfidInboundDetected + + + + + + + + + + + GateWestRfid + + + + + + + + + + + None + COM23 + GateWestRfidEvents + + 955 + 95 + + GateWestRfidInboundDetected + + + + + + + + + Patch1Rfid @@ -581,7 +711,7 @@ None - COM12 + COM35 Patch1RfidEvents 940 @@ -655,6 +785,35 @@ + + PatchDummy1Rfid + + + + + + + + + + + None + COM21 + PatchDummy1RfidEvents + + 675 + 594 + + PatchDummy1RfidInboundDetected + + + + + + + + + LightCycle @@ -696,6 +855,36 @@ + + LinearDriveController + + + + + + + + + + + + + LinearDrivePosition + 4500 + 5500 + 50000 + LinearDriveSetPosition + COM30 + LinearDriveEvents + + + + + + + + + @@ -731,6 +920,495 @@ + + LedTrackingTop + + + + + + + CameraTop + + + + + + + + + LedPositionTracking + Extracts information on the largest binary blob in the input image. + + + + Source1 + + + Value.Image + + + + + 0 + 0 + 0 + 0 + + + + + + + + + 1245 + 480 + + + 1353 + 482 + + + 1353 + 581 + + + 1246 + 587 + + + 1246 + 634 + + + 1222 + 724 + + + 1182 + 810 + + + 1128 + 886 + + + 1062 + 953 + + + 985 + 1007 + + + 900 + 1046 + + + 809 + 1071 + + + 715 + 1079 + + + 622 + 1071 + + + 531 + 1046 + + + 446 + 1007 + + + 369 + 953 + + + 303 + 886 + + + 249 + 810 + + + 209 + 724 + + + 185 + 634 + + + 177 + 540 + + + 185 + 446 + + + 209 + 356 + + + 249 + 270 + + + 303 + 194 + + + 369 + 127 + + + 446 + 73 + + + 531 + 34 + + + 622 + 9 + + + 715 + 1 + + + 809 + 9 + + + 900 + 34 + + + 985 + 73 + + + 1062 + 127 + + + 1128 + 194 + + + 1182 + 271 + + + 1222 + 356 + + + 1246 + 446 + + + + + 1415 + 1040 + + + 1439 + 1040 + + + 1439 + 1079 + + + 1415 + 1079 + + + + + 24 + 0 + + + 0 + 0 + + + 0 + 27 + + + 24 + 27 + + + + ToZero + + 0 + 0 + 0 + 0 + + + + + + + + + 241 + 255 + Binary + + + + + + 3 + 3 + + + -1 + -1 + + Rectangle + 1 + Dilate + + + + + External + ChainApproxNone + + 0 + 0 + + 0 + 500 + + + + + + + + + + + 1 + + + + Seconds + + + + + + + + + + + + LedTrackingTop + + + + + + + + + + + + + + + + + + + + + + + + + + + LedTrackingImage + + + + CameraTop + + + + + 1440 + 1080 + + U8 + 3 + + 0 + 0 + 0 + 0 + + + + + CameraTop + + + Value.Image + + + + Gray2Bgr + + + + + + + + + + + 0 + 0 + 0 + 0 + + Linear + + + + + + + + + + + + + LedTrackingTop + + + Value.Count + + + + 1 + + + + + + + + + + + + + + LedTrackingTop + + + Value + + + + 0 + + + + Centroid + + + + + + + + + + -2147483648 + -2147483648 + + 10 + + 0 + 0 + 255 + 255 + + 1 + Connected8 + 0 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + LedTrackingImage + + + + + + + + + + + + + ModelPathController @@ -951,6 +1629,69 @@ + + AverageLightIntensity + + + + + + + + CameraLightMonitor + LightMonitor + + + + + + + + + + + TetherSlackController + + + + + + + + + + + + + + + + + LedTrackingTop + + 710 + 555 + + 550 + 100 + 172 + 17 + 48 + 58 + + 792 + 606 + + LinearDriveSetPosition + + + + + + + + + @@ -965,28 +1706,70 @@ - CameraTop + LedTrackingTop - - + + + LinearDriveEvents - - EnvironmentRandom.yml + + LinearDriveController + + - - 0 - + + RButton ShiftKey Menu Space Next PageDown D0 D2 B P R NumPad0 NumPad2 F1 F3 Shift + false - LightMonitor + EnableMotor + + + Patch2Events + + + Include + + + + Patch1Events + + + Patch3Events + + + + LButton RButton Cancel ShiftKey ControlKey Menu Pause Space Prior PageUp Next PageDown End D0 D1 D2 D3 A B C P Q R S NumPad0 NumPad1 NumPad2 NumPad3 F1 F2 F3 F4 Shift + false + + + + DisableMotor + + + + LButton Back Tab ShiftKey ControlKey FinalMode HanjaMode KanjiMode Space Prior PageUp Down Select D0 D1 D8 D9 A H I P Q X Y NumPad0 NumPad1 NumPad8 NumPad9 F1 F2 F9 F10 Shift + false + + + + CalibrateMotorLimits + + + SurrogateTrigger - - + + + + + + + \ No newline at end of file diff --git a/workflows/social/Social-AEON3.bonsai.layout b/workflows/social/Social-AEON3.bonsai.layout index 6da1f5b7..1d770f05 100644 --- a/workflows/social/Social-AEON3.bonsai.layout +++ b/workflows/social/Social-AEON3.bonsai.layout @@ -1430,7 +1430,283 @@ Normal - + + false + + 0 + 0 + + + 0 + 0 + + Normal + + + false + + 0 + 0 + + + 0 + 0 + + Normal + + + false + + 0 + 0 + + + 0 + 0 + + Normal + + + false + + 0 + 0 + + + 0 + 0 + + Normal + + + false + + 0 + 0 + + + 0 + 0 + + Normal + + + false + + 0 + 0 + + + 0 + 0 + + Normal + + + false + + 0 + 0 + + + 0 + 0 + + Normal + + + false + + 0 + 0 + + + 0 + 0 + + Normal + + + false + + 0 + 0 + + + 0 + 0 + + Normal + + + false + + 0 + 0 + + + 0 + 0 + + Normal + + + false + + 0 + 0 + + + 0 + 0 + + Normal + + + false + + 0 + 0 + + + 0 + 0 + + Normal + + + false + + 0 + 0 + + + 0 + 0 + + Normal + + + false + + 0 + 0 + + + 0 + 0 + + Normal + + + false + + 0 + 0 + + + 0 + 0 + + Normal + + + false + + 0 + 0 + + + 0 + 0 + + Normal + + + false + + 0 + 0 + + + 0 + 0 + + Normal + + + false + + 0 + 0 + + + 0 + 0 + + Normal + + + false + + 0 + 0 + + + 0 + 0 + + Normal + + + false + + 0 + 0 + + + 0 + 0 + + Normal + + + false + + 0 + 0 + + + 0 + 0 + + Normal + + + false + + 0 + 0 + + + 0 + 0 + + Normal + + + false + + 0 + 0 + + + 0 + 0 + + Normal + + false 0 @@ -1441,18 +1717,6 @@ 0 Normal - - false - - 4 - 5 - - - 1294 - 762 - - Normal - false @@ -2015,7 +2279,7 @@ 0 - 960 + 920 1047 Normal @@ -2051,7 +2315,7 @@ 0 1500 0 - 600 + 250.00000000000003 true true 0 @@ -2070,7 +2334,7 @@ 0 1500 0 - 300 + 120 true true 0 @@ -2089,7 +2353,7 @@ 0 1500 0 - 249.99999999999997 + 200 true true 0 @@ -2106,8 +2370,8 @@ 0 - 530 - 600 + 0 + 1.1 true @@ -2117,8 +2381,8 @@ 0 - 240 - 270 + 0 + 1.1 true @@ -2128,8 +2392,8 @@ 0 - 220 - 245 + 0 + 1.1 true @@ -2166,28 +2430,28 @@ - Bonsai.Design.Visualizers.TableLayoutPanelVisualizer + RfidMeasurementVisualizer - - - Aeon.Environment.ExternalizedPropertiesVisualizer - - - - - - Aeon.Environment.ButtonSourceVisualizer - - - - - + - RfidMeasurementVisualizer + Bonsai.Dsp.Design.MatVisualizer - + + 0 + 1500 + 0 + 200 + true + true + 0 + 16 + true + 0 + 100 + 1 + @@ -2206,7 +2470,7 @@ 0 - -0.0035000000000000005 + -0.007000000000000001 0 true @@ -2233,21 +2497,34 @@ true - 953 - 10 + 912 + 3 - 694 - 207 + 703 + 216 Normal Bonsai.Design.Visualizers.TableLayoutPanelVisualizer - Bonsai.Vision.Design.IplImageVisualizer + Bonsai.Design.Visualizers.TableLayoutPanelVisualizer - + + + Aeon.Environment.ExternalizedPropertiesVisualizer + + + + + + Aeon.Environment.ButtonSourceVisualizer + + + + + @@ -2280,57 +2557,16 @@ - true + false 952 216 962 - 333 + 381 Normal - Bonsai.Design.Visualizers.TableLayoutPanelVisualizer - - - - Aeon.Foraging.DispenserEventVisualizer - - - - - - Aeon.Foraging.DispenserEventVisualizer - - - - - - Aeon.Foraging.DispenserEventVisualizer - - - - - - Aeon.Environment.AnnotationSourceVisualizer - - - - - - Aeon.Environment.EnvironmentStateVisualizer - - - - - - Aeon.Environment.LabelVisualizer - - - - - - false @@ -2348,11 +2584,11 @@ true 952 - 546 + 608 962 - 497 + 435 Normal Bonsai.Design.Visualizers.TableLayoutPanelVisualizer @@ -2375,8 +2611,8 @@ 640 - 0 - 1.1 + 10.6 + 10.709999999999999 true @@ -2397,7 +2633,7 @@ - true + false 1638 12 @@ -2407,30 +2643,136 @@ 203 Normal + + + true + + 1643 + 10 + + + 249 + 207 + + Normal Bonsai.Vision.Design.IplImageVisualizer - + + + + + true + + 912 + 214 + + + 1002 + 831 + + Normal + Bonsai.Design.Visualizers.TableLayoutPanelVisualizer + + + + 11 + Bonsai.Design.Visualizers.TableLayoutPanelVisualizer + + + + Aeon.Foraging.DispenserEventVisualizer + + + + + + Aeon.Foraging.DispenserEventVisualizer + + + + + + Aeon.Foraging.DispenserEventVisualizer + + + + + + Aeon.Environment.AnnotationSourceVisualizer + + + + + + Aeon.Environment.EnvironmentStateVisualizer + + + + + + Aeon.Environment.LabelVisualizer + + + + + + + - Bonsai.Vision.Design.PointOverlay + 13 + Bonsai.Design.Visualizers.TableLayoutPanelVisualizer - - None - 1 - + + + Aeon.Environment.EnvironmentSubjectStateVisualizer + + + + + + LabeledSeriesVisualizer + + + + + + Bonsai.Design.Visualizers.RollingGraphVisualizer + + + 640 + 0 + 1.1 + true + + + + - + + + false + + 0 + 0 + + + 0 + 0 + + Normal + true - 1643 - 10 + 1660 + 3 - 249 - 207 + 253 + 215 Normal Bonsai.Vision.Design.IplImageVisualizer @@ -2440,18 +2782,6 @@ - - false - - 0 - 0 - - - 0 - 0 - - Normal - false @@ -2466,38 +2796,14 @@ false - 4 - 5 + 3 + 3 - 1294 - 762 + 1506 + 903 Normal - - false - - 0 - 0 - - - 0 - 0 - - Normal - - - false - - 0 - 0 - - - 0 - 0 - - Normal - \ No newline at end of file diff --git a/workflows/social/Social-AEON4.bonsai b/workflows/social/Social-AEON4.bonsai index ba72d683..3678c942 100644 --- a/workflows/social/Social-AEON4.bonsai +++ b/workflows/social/Social-AEON4.bonsai @@ -1,7 +1,6 @@  @@ -324,7 +323,7 @@ - CameraEnvironment + CameraLightMonitor @@ -343,35 +342,13 @@ 23032826 0 2 - CameraEnvironment - - - - - - Source1 - - - Value.Image - - - LightMonitor - - - - - - - - - + CameraLightMonitor - @@ -505,6 +482,42 @@ + + PatchDummy1 + + + + + + + + + + + + + + + + PatchDummy1Events + SampleRate500Hz + PatchDummy1DeliverPellet + PatchDummy1PelletDelivered + PT1S + 2 + PatchDummy1ResetFeeder + COM20 + -4 + PatchDummy1WheelDisplacement + + + + + + + + + Nest @@ -620,6 +633,64 @@ + + GateEastRfid + + + + + + + + + + + None + COM22 + GateEastRfidEvents + + 930 + 993 + + GateEastRfidInboundDetected + + + + + + + + + + + GateWestRfid + + + + + + + + + + + None + COM23 + GateWestRfidEvents + + 928 + 134 + + GateWestRfidInboundDetected + + + + + + + + + Patch1Rfid @@ -707,6 +778,35 @@ + + PatchDummy1Rfid + + + + + + + + + + + None + COM21 + PatchDummy1RfidEvents + + 639 + 566 + + PatchDummy1RfidInboundDetected + + + + + + + + + LightCycle @@ -1003,6 +1103,26 @@ + + AverageLightIntensity + + + + + + + + CameraLightMonitor + LightMonitor + + + + + + + + + @@ -1019,16 +1139,10 @@ CameraTop - - - - - EnvironmentRandom.yml - + - \ No newline at end of file diff --git a/workflows/social/Social-AEON4.bonsai.layout b/workflows/social/Social-AEON4.bonsai.layout index 6da1f5b7..1d770f05 100644 --- a/workflows/social/Social-AEON4.bonsai.layout +++ b/workflows/social/Social-AEON4.bonsai.layout @@ -1430,7 +1430,283 @@ Normal - + + false + + 0 + 0 + + + 0 + 0 + + Normal + + + false + + 0 + 0 + + + 0 + 0 + + Normal + + + false + + 0 + 0 + + + 0 + 0 + + Normal + + + false + + 0 + 0 + + + 0 + 0 + + Normal + + + false + + 0 + 0 + + + 0 + 0 + + Normal + + + false + + 0 + 0 + + + 0 + 0 + + Normal + + + false + + 0 + 0 + + + 0 + 0 + + Normal + + + false + + 0 + 0 + + + 0 + 0 + + Normal + + + false + + 0 + 0 + + + 0 + 0 + + Normal + + + false + + 0 + 0 + + + 0 + 0 + + Normal + + + false + + 0 + 0 + + + 0 + 0 + + Normal + + + false + + 0 + 0 + + + 0 + 0 + + Normal + + + false + + 0 + 0 + + + 0 + 0 + + Normal + + + false + + 0 + 0 + + + 0 + 0 + + Normal + + + false + + 0 + 0 + + + 0 + 0 + + Normal + + + false + + 0 + 0 + + + 0 + 0 + + Normal + + + false + + 0 + 0 + + + 0 + 0 + + Normal + + + false + + 0 + 0 + + + 0 + 0 + + Normal + + + false + + 0 + 0 + + + 0 + 0 + + Normal + + + false + + 0 + 0 + + + 0 + 0 + + Normal + + + false + + 0 + 0 + + + 0 + 0 + + Normal + + + false + + 0 + 0 + + + 0 + 0 + + Normal + + + false + + 0 + 0 + + + 0 + 0 + + Normal + + false 0 @@ -1441,18 +1717,6 @@ 0 Normal - - false - - 4 - 5 - - - 1294 - 762 - - Normal - false @@ -2015,7 +2279,7 @@ 0 - 960 + 920 1047 Normal @@ -2051,7 +2315,7 @@ 0 1500 0 - 600 + 250.00000000000003 true true 0 @@ -2070,7 +2334,7 @@ 0 1500 0 - 300 + 120 true true 0 @@ -2089,7 +2353,7 @@ 0 1500 0 - 249.99999999999997 + 200 true true 0 @@ -2106,8 +2370,8 @@ 0 - 530 - 600 + 0 + 1.1 true @@ -2117,8 +2381,8 @@ 0 - 240 - 270 + 0 + 1.1 true @@ -2128,8 +2392,8 @@ 0 - 220 - 245 + 0 + 1.1 true @@ -2166,28 +2430,28 @@ - Bonsai.Design.Visualizers.TableLayoutPanelVisualizer + RfidMeasurementVisualizer - - - Aeon.Environment.ExternalizedPropertiesVisualizer - - - - - - Aeon.Environment.ButtonSourceVisualizer - - - - - + - RfidMeasurementVisualizer + Bonsai.Dsp.Design.MatVisualizer - + + 0 + 1500 + 0 + 200 + true + true + 0 + 16 + true + 0 + 100 + 1 + @@ -2206,7 +2470,7 @@ 0 - -0.0035000000000000005 + -0.007000000000000001 0 true @@ -2233,21 +2497,34 @@ true - 953 - 10 + 912 + 3 - 694 - 207 + 703 + 216 Normal Bonsai.Design.Visualizers.TableLayoutPanelVisualizer - Bonsai.Vision.Design.IplImageVisualizer + Bonsai.Design.Visualizers.TableLayoutPanelVisualizer - + + + Aeon.Environment.ExternalizedPropertiesVisualizer + + + + + + Aeon.Environment.ButtonSourceVisualizer + + + + + @@ -2280,57 +2557,16 @@ - true + false 952 216 962 - 333 + 381 Normal - Bonsai.Design.Visualizers.TableLayoutPanelVisualizer - - - - Aeon.Foraging.DispenserEventVisualizer - - - - - - Aeon.Foraging.DispenserEventVisualizer - - - - - - Aeon.Foraging.DispenserEventVisualizer - - - - - - Aeon.Environment.AnnotationSourceVisualizer - - - - - - Aeon.Environment.EnvironmentStateVisualizer - - - - - - Aeon.Environment.LabelVisualizer - - - - - - false @@ -2348,11 +2584,11 @@ true 952 - 546 + 608 962 - 497 + 435 Normal Bonsai.Design.Visualizers.TableLayoutPanelVisualizer @@ -2375,8 +2611,8 @@ 640 - 0 - 1.1 + 10.6 + 10.709999999999999 true @@ -2397,7 +2633,7 @@ - true + false 1638 12 @@ -2407,30 +2643,136 @@ 203 Normal + + + true + + 1643 + 10 + + + 249 + 207 + + Normal Bonsai.Vision.Design.IplImageVisualizer - + + + + + true + + 912 + 214 + + + 1002 + 831 + + Normal + Bonsai.Design.Visualizers.TableLayoutPanelVisualizer + + + + 11 + Bonsai.Design.Visualizers.TableLayoutPanelVisualizer + + + + Aeon.Foraging.DispenserEventVisualizer + + + + + + Aeon.Foraging.DispenserEventVisualizer + + + + + + Aeon.Foraging.DispenserEventVisualizer + + + + + + Aeon.Environment.AnnotationSourceVisualizer + + + + + + Aeon.Environment.EnvironmentStateVisualizer + + + + + + Aeon.Environment.LabelVisualizer + + + + + + + - Bonsai.Vision.Design.PointOverlay + 13 + Bonsai.Design.Visualizers.TableLayoutPanelVisualizer - - None - 1 - + + + Aeon.Environment.EnvironmentSubjectStateVisualizer + + + + + + LabeledSeriesVisualizer + + + + + + Bonsai.Design.Visualizers.RollingGraphVisualizer + + + 640 + 0 + 1.1 + true + + + + - + + + false + + 0 + 0 + + + 0 + 0 + + Normal + true - 1643 - 10 + 1660 + 3 - 249 - 207 + 253 + 215 Normal Bonsai.Vision.Design.IplImageVisualizer @@ -2440,18 +2782,6 @@ - - false - - 0 - 0 - - - 0 - 0 - - Normal - false @@ -2466,38 +2796,14 @@ false - 4 - 5 + 3 + 3 - 1294 - 762 + 1506 + 903 Normal - - false - - 0 - 0 - - - 0 - 0 - - Normal - - - false - - 0 - 0 - - - 0 - 0 - - Normal - \ No newline at end of file