Skip to content

Commit

Permalink
Merge pull request #36 from AllenNeuralDynamics/fix-manipulator-confi…
Browse files Browse the repository at this point in the history
…g-mask

Fix motor bit mask and improve bit manipulation pattern
  • Loading branch information
bruno-f-cruz authored Jun 7, 2024
2 parents f5adca0 + 0391543 commit 29e2bd8
Showing 1 changed file with 70 additions and 86 deletions.
156 changes: 70 additions & 86 deletions src/AllenNeuralDynamics.AindManipulator/AindManipulator.bonsai
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,34 @@
<Property Name="StepIntervalAcceleration" Selector="StepAccelerationInterval" />
<Property Name="OperationMode" Selector="MotorOperationMode" />
<Property Name="MaximumStepInterval" Selector="MaximumStepInterval" />
<Property Name="Motor" Selector="Axis" />
</PropertyMappings>
</Expression>
<Expression xsi:type="Combinator">
<Combinator xsi:type="ByteProperty">
<Value>1</Value>
</Combinator>
</Expression>
<Expression xsi:type="SubscribeSubject">
<Name>Motor</Name>
</Expression>
<Expression xsi:type="MemberSelector">
<Selector>Axis</Selector>
</Expression>
<Expression xsi:type="scr:ExpressionTransform">
<scr:Name>ToByte - 1</scr:Name>
<scr:Expression>byte(it) - 1</scr:Expression>
</Expression>
<Expression xsi:type="PropertyMapping">
<PropertyMappings>
<Property Name="Value" />
</PropertyMappings>
</Expression>
<Expression xsi:type="LeftShift">
<Value>3</Value>
</Expression>
<Expression xsi:type="PropertyMapping">
<PropertyMappings>
<Property Name="Motor" />
</PropertyMappings>
</Expression>
<Expression xsi:type="IncludeWorkflow" Path="AllenNeuralDynamics.AindManipulator:ConfigureMotor.bonsai">
Expand All @@ -274,17 +301,24 @@
<StepInterval>100</StepInterval>
<StepIntervalAcceleration>100</StepIntervalAcceleration>
<OperationMode>QuietMode</OperationMode>
<MaximumStepInterval>100</MaximumStepInterval>
<MaximumStepInterval>2000</MaximumStepInterval>
</Expression>
<Expression xsi:type="WorkflowOutput" />
</Nodes>
<Edges>
<Edge From="0" To="1" Label="Source1" />
<Edge From="1" To="2" Label="Source1" />
<Edge From="3" To="6" Label="Source1" />
<Edge From="3" To="13" Label="Source1" />
<Edge From="4" To="5" Label="Source1" />
<Edge From="5" To="6" Label="Source2" />
<Edge From="6" To="7" Label="Source1" />
<Edge From="5" To="13" Label="Source2" />
<Edge From="6" To="11" Label="Source1" />
<Edge From="7" To="8" Label="Source1" />
<Edge From="8" To="9" Label="Source1" />
<Edge From="9" To="10" Label="Source1" />
<Edge From="10" To="11" Label="Source2" />
<Edge From="11" To="12" Label="Source1" />
<Edge From="12" To="13" Label="Source3" />
<Edge From="13" To="14" Label="Source1" />
</Edges>
</Workflow>
</Expression>
Expand Down Expand Up @@ -324,6 +358,11 @@
<rx:Count>1</rx:Count>
</Combinator>
</Expression>
<Expression xsi:type="Combinator">
<Combinator xsi:type="ByteProperty">
<Value>1</Value>
</Combinator>
</Expression>
<Expression xsi:type="SubscribeSubject">
<Name>Settings</Name>
</Expression>
Expand All @@ -336,42 +375,17 @@
<Expression xsi:type="MemberSelector">
<Selector>Axis</Selector>
</Expression>
<Expression xsi:type="Combinator">
<Combinator xsi:type="ByteProperty">
<Value>1</Value>
</Combinator>
</Expression>
<Expression xsi:type="Combinator">
<Combinator xsi:type="rx:Take">
<rx:Count>1</rx:Count>
</Combinator>
<Expression xsi:type="scr:ExpressionTransform">
<scr:Name>ToByte - 1</scr:Name>
<scr:Expression>byte(it) - 1</scr:Expression>
</Expression>
<Expression xsi:type="PropertyMapping">
<PropertyMappings>
<Property Name="Value" />
</PropertyMappings>
</Expression>
<Expression xsi:type="Subtract">
<Operand xsi:type="WorkflowProperty" TypeArguments="p2:Axis">
<Value>X</Value>
</Operand>
</Expression>
<Expression xsi:type="Combinator">
<Combinator xsi:type="ByteProperty">
<Value>1</Value>
</Combinator>
</Expression>
<Expression xsi:type="Combinator">
<Combinator xsi:type="rx:Zip" />
</Expression>
<Expression xsi:type="InputMapping">
<PropertyMappings>
<Property Name="Value" Selector="Item2" />
</PropertyMappings>
<Selector>Item1</Selector>
</Expression>
<Expression xsi:type="LeftShift">
<Value>2</Value>
<Value>3</Value>
</Expression>
<Expression xsi:type="Combinator">
<Combinator xsi:type="rx:Merge" />
Expand Down Expand Up @@ -404,30 +418,25 @@
</Nodes>
<Edges>
<Edge From="0" To="1" Label="Source1" />
<Edge From="1" To="14" Label="Source1" />
<Edge From="2" To="3" Label="Source1" />
<Edge From="1" To="10" Label="Source1" />
<Edge From="2" To="9" Label="Source1" />
<Edge From="3" To="4" Label="Source1" />
<Edge From="4" To="5" Label="Source1" />
<Edge From="5" To="9" Label="Source1" />
<Edge From="5" To="6" Label="Source1" />
<Edge From="6" To="7" Label="Source1" />
<Edge From="7" To="8" Label="Source1" />
<Edge From="8" To="9" Label="Source2" />
<Edge From="9" To="10" Label="Source1" />
<Edge From="9" To="11" Label="Source2" />
<Edge From="9" To="10" Label="Source2" />
<Edge From="10" To="11" Label="Source1" />
<Edge From="11" To="12" Label="Source1" />
<Edge From="12" To="13" Label="Source1" />
<Edge From="13" To="14" Label="Source2" />
<Edge From="12" To="14" Label="Source1" />
<Edge From="13" To="16" Label="Source1" />
<Edge From="14" To="15" Label="Source1" />
<Edge From="15" To="16" Label="Source1" />
<Edge From="15" To="16" Label="Source2" />
<Edge From="16" To="17" Label="Source1" />
<Edge From="16" To="18" Label="Source1" />
<Edge From="17" To="20" Label="Source1" />
<Edge From="17" To="18" Label="Source1" />
<Edge From="18" To="19" Label="Source1" />
<Edge From="19" To="20" Label="Source2" />
<Edge From="20" To="21" Label="Source1" />
<Edge From="21" To="22" Label="Source1" />
<Edge From="22" To="23" Label="Source1" />
</Edges>
</Workflow>
</Expression>
Expand Down Expand Up @@ -555,48 +564,28 @@
<Property Name="MaxLimit" Selector="MaxLimit" />
</PropertyMappings>
</Expression>
<Expression xsi:type="Combinator">
<Combinator xsi:type="ByteProperty">
<Value>1</Value>
</Combinator>
</Expression>
<Expression xsi:type="SubscribeSubject">
<Name>Motor</Name>
</Expression>
<Expression xsi:type="MemberSelector">
<Selector>Axis</Selector>
</Expression>
<Expression xsi:type="Combinator">
<Combinator xsi:type="ByteProperty">
<Value>1</Value>
</Combinator>
</Expression>
<Expression xsi:type="Combinator">
<Combinator xsi:type="rx:Take">
<rx:Count>1</rx:Count>
</Combinator>
<Expression xsi:type="scr:ExpressionTransform">
<scr:Name>ToByte - 1</scr:Name>
<scr:Expression>byte(it) - 1</scr:Expression>
</Expression>
<Expression xsi:type="PropertyMapping">
<PropertyMappings>
<Property Name="Value" />
</PropertyMappings>
</Expression>
<Expression xsi:type="Subtract">
<Operand xsi:type="WorkflowProperty" TypeArguments="p2:Axis">
<Value>X</Value>
</Operand>
</Expression>
<Expression xsi:type="Combinator">
<Combinator xsi:type="ByteProperty">
<Value>1</Value>
</Combinator>
</Expression>
<Expression xsi:type="Combinator">
<Combinator xsi:type="rx:Zip" />
</Expression>
<Expression xsi:type="InputMapping">
<PropertyMappings>
<Property Name="Value" Selector="Item2" />
</PropertyMappings>
<Selector>Item1</Selector>
</Expression>
<Expression xsi:type="LeftShift">
<Value>2</Value>
<Value>3</Value>
</Expression>
<Expression xsi:type="PropertyMapping">
<PropertyMappings>
Expand All @@ -613,22 +602,17 @@
<Edges>
<Edge From="0" To="1" Label="Source1" />
<Edge From="1" To="2" Label="Source1" />
<Edge From="3" To="17" Label="Source1" />
<Edge From="3" To="13" Label="Source1" />
<Edge From="4" To="5" Label="Source1" />
<Edge From="5" To="17" Label="Source2" />
<Edge From="6" To="7" Label="Source1" />
<Edge From="7" To="11" Label="Source1" />
<Edge From="5" To="13" Label="Source2" />
<Edge From="6" To="11" Label="Source1" />
<Edge From="7" To="8" Label="Source1" />
<Edge From="8" To="9" Label="Source1" />
<Edge From="9" To="10" Label="Source1" />
<Edge From="10" To="11" Label="Source2" />
<Edge From="11" To="12" Label="Source1" />
<Edge From="11" To="13" Label="Source2" />
<Edge From="12" To="13" Label="Source1" />
<Edge From="12" To="13" Label="Source3" />
<Edge From="13" To="14" Label="Source1" />
<Edge From="14" To="15" Label="Source1" />
<Edge From="15" To="16" Label="Source1" />
<Edge From="16" To="17" Label="Source3" />
<Edge From="17" To="18" Label="Source1" />
</Edges>
</Workflow>
</Expression>
Expand Down

0 comments on commit 29e2bd8

Please sign in to comment.