Skip to content

Commit

Permalink
Merge pull request #56 from AllenNeuralDynamics/feat-update-manipulat…
Browse files Browse the repository at this point in the history
…or-schemas

Allow non-integer numeric values in axis limits
  • Loading branch information
bruno-f-cruz authored Jul 12, 2024
2 parents b58800b + 1456b34 commit f14ce9c
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 26 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from pydantic import BaseModel, Field

TASK_LOGIC_VERSION = "0.2.0"
RIG_VERSION = "0.0.0"
RIG_VERSION = "0.1.0"


class Axis(IntEnum):
Expand Down Expand Up @@ -63,13 +63,13 @@ class AxisConfiguration(BaseModel):
title="Configures the time between step motor pulses (us) used when starting or stopping a movement",
)
motor_operation_mode: MotorOperationMode = Field(default=MotorOperationMode.QUIET, title="Motor operation mode")
max_limit: int = Field(default=24000, title="Maximum limit. A value of 0 disables this limit.")
min_limit: int = Field(default=-1, title="Minimum limit. A value of 0 disables this limit.")
max_limit: float = Field(default=25, title="Maximum limit in SI units. A value of 0 disables this limit.")
min_limit: float = Field(default=-0.01, title="Minimum limit in SI units. A value of 0 disables this limit.")


class AindManipulatorCalibrationInput(BaseModel):
full_step_to_mm: ManipulatorPosition = Field(
default=(ManipulatorPosition(x=0.010, y1=0.010, y2=0.010, z=0.010)), title="Full step to mm"
default=(ManipulatorPosition(x=0.010, y1=0.010, y2=0.010, z=0.010)), title="Full step to mm. Used to convert steps to SI Units"
)
axis_configuration: List[AxisConfiguration] = Field(
default=[
Expand Down
34 changes: 17 additions & 17 deletions src/DataSchemas/schemas/aind_manipulator_calibration_rig.json
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@
"y2": 0.01,
"z": 0.01
},
"title": "Full step to mm"
"title": "Full step to mm. Used to convert steps to SI Units"
},
"axis_configuration": {
"default": [
Expand All @@ -89,8 +89,8 @@
"microstep_resolution": 0,
"maximum_step_interval": 2000,
"motor_operation_mode": 0,
"max_limit": 24000,
"min_limit": -1
"max_limit": 25.0,
"min_limit": -0.01
},
{
"axis": 3,
Expand All @@ -99,8 +99,8 @@
"microstep_resolution": 0,
"maximum_step_interval": 2000,
"motor_operation_mode": 0,
"max_limit": 24000,
"min_limit": -1
"max_limit": 25.0,
"min_limit": -0.01
},
{
"axis": 1,
Expand All @@ -109,8 +109,8 @@
"microstep_resolution": 0,
"maximum_step_interval": 2000,
"motor_operation_mode": 0,
"max_limit": 24000,
"min_limit": -1
"max_limit": 25.0,
"min_limit": -0.01
},
{
"axis": 4,
Expand All @@ -119,8 +119,8 @@
"microstep_resolution": 0,
"maximum_step_interval": 2000,
"motor_operation_mode": 0,
"max_limit": 24000,
"min_limit": -1
"max_limit": 25.0,
"min_limit": -0.01
}
],
"items": {
Expand Down Expand Up @@ -299,14 +299,14 @@
"title": "Motor operation mode"
},
"max_limit": {
"default": 24000,
"title": "Maximum limit. A value of 0 disables this limit.",
"type": "integer"
"default": 25,
"title": "Maximum limit in SI units. A value of 0 disables this limit.",
"type": "number"
},
"min_limit": {
"default": -1,
"title": "Minimum limit. A value of 0 disables this limit.",
"type": "integer"
"default": -0.01,
"title": "Minimum limit in SI units. A value of 0 disables this limit.",
"type": "number"
}
},
"required": [
Expand Down Expand Up @@ -379,8 +379,8 @@
},
"properties": {
"version": {
"const": "0.0.0",
"default": "0.0.0",
"const": "0.1.0",
"default": "0.1.0",
"title": "Version",
"type": "string"
},
Expand Down
10 changes: 5 additions & 5 deletions src/Extensions/AindManipulatorCalibrationRig.cs
Original file line number Diff line number Diff line change
Expand Up @@ -532,9 +532,9 @@ public partial class AxisConfiguration

private MotorOperationMode _motorOperationMode = AindBehaviorServices.AindManipulatorCalibrationRig.MotorOperationMode.Quiet;

private int _maxLimit = 24000;
private double _maxLimit = 25D;

private int _minLimit = -1;
private double _minLimit = -0.01D;

public AxisConfiguration()
{
Expand Down Expand Up @@ -642,7 +642,7 @@ public MotorOperationMode MotorOperationMode
}

[Newtonsoft.Json.JsonPropertyAttribute("max_limit")]
public int MaxLimit
public double MaxLimit
{
get
{
Expand All @@ -655,7 +655,7 @@ public int MaxLimit
}

[Newtonsoft.Json.JsonPropertyAttribute("min_limit")]
public int MinLimit
public double MinLimit
{
get
{
Expand Down Expand Up @@ -897,7 +897,7 @@ public enum MotorOperationMode
public partial class CalibrationRig
{

private string _version = "0.0.0";
private string _version = "0.1.0";

private string _computerName;

Expand Down

0 comments on commit f14ce9c

Please sign in to comment.