Skip to content

Commit

Permalink
Add high-level commutator controller
Browse files Browse the repository at this point in the history
  • Loading branch information
glopesdev committed Aug 10, 2024
1 parent 70406c3 commit e7403b9
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 0 deletions.
47 changes: 47 additions & 0 deletions OpenEphys.Commutator/AutoCommutator.bonsai
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
<?xml version="1.0" encoding="utf-8"?>
<WorkflowBuilder Version="2.8.5"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:rx="clr-namespace:Bonsai.Reactive;assembly=Bonsai.Core"
xmlns:commutator="clr-namespace:OpenEphys.Commutator;assembly=OpenEphys.Commutator"
xmlns="https://bonsai-rx.org/2018/workflow">
<Description>Control an Open Ephys commutator by using rotation angle measurements.</Description>
<Workflow>
<Nodes>
<Expression xsi:type="WorkflowInput">
<Name>Source1</Name>
</Expression>
<Expression xsi:type="Combinator">
<Combinator xsi:type="rx:SampleInterval">
<rx:Interval>PT0.1S</rx:Interval>
</Combinator>
</Expression>
<Expression xsi:type="ExternalizedMapping">
<Property Name="RotationAxis" />
</Expression>
<Expression xsi:type="Combinator">
<Combinator xsi:type="commutator:QuaternionTwistController">
<commutator:RotationAxis>
<commutator:X>0</commutator:X>
<commutator:Y>0</commutator:Y>
<commutator:Z>1</commutator:Z>
</commutator:RotationAxis>
</Combinator>
</Expression>
<Expression xsi:type="ExternalizedMapping">
<Property Name="PortName" />
</Expression>
<Expression xsi:type="Combinator">
<Combinator xsi:type="commutator:TurnMotor" />
</Expression>
<Expression xsi:type="WorkflowOutput" />
</Nodes>
<Edges>
<Edge From="0" To="1" Label="Source1" />
<Edge From="1" To="3" Label="Source1" />
<Edge From="2" To="3" Label="Source2" />
<Edge From="3" To="5" Label="Source1" />
<Edge From="4" To="5" Label="Source2" />
<Edge From="5" To="6" Label="Source1" />
</Edges>
</Workflow>
</WorkflowBuilder>
4 changes: 4 additions & 0 deletions OpenEphys.Commutator/OpenEphys.Commutator.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@
<TargetFramework>net472</TargetFramework>
</PropertyGroup>

<ItemGroup>
<EmbeddedResource Include="**/*.bonsai" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Bonsai.Core" Version="2.8.5" />
<PackageReference Include="Bonsai.System" Version="2.8.1" />
Expand Down

0 comments on commit e7403b9

Please sign in to comment.