# Stage Pose Computer

The Stage Pose Computer block is used to compute the required stage motion to properly align one or more parts. It can be used for two types of applications: alignment and assembly. When the type of application is selected using the ApplicationType property, the block reconfigures its pins appropriately. This block works for stationary and moving camera configurations.

Application types are as follows:

For Alignment applications, the block accepts a TrainFromRun transform. The transform can be computed externally using a PointsToPointsCenteringBlock, LinesToLinesCenteringBlock or any custom block that computes such a transform. The TrainFromRun transform will be used along with the current uncorrected stage position and the hand-eye calibration results to compute the relative and absolute stage pose parameters.

All input and output stage pose parameters will be in UnCorrectedHome2DFromStage2D. The motivation behind accepting and outputting uncorrected pose parameters is that the position is always reported by a motion control system. Similarly, the pose correction that is desired is conveyed to the motion control system.

## General Information

Class name: StagePoseComputerBlock

Namespace: Cognex.Designer.AlignPlus.Alignment

Assembly: Cognex.Designer.AlignPlus.Alignment.dll

### Properties

Name | Type | Description
--- | --- | ---
Align Part to Base | Boolean | Checked on: Align Part to Base Checked off: Align Part to Gripper
Application Type | Cognex.Designer.AlignPlus.Alignment. StagePoseComputerBlock.Application | Select the type of application as follows: When the value of this property is Alignment, the block will configure itself for use in an alignment application. The TrainFromRun pin, which takes the trainFromRun transform as an input, will be displayed. When the value of the property is Assembly, the block will configure itself for use in an assembly application. The TrainFromRun At Station With Stage and TrainFromRun At Station Without Stage pins will be displayed.

## Alignment

### Inputs

Name | Type | Description
--- | --- | ---
Current Stage X | double | X component of stage's current position
Current Stage Y | double | Y component of stage's current position
Current Stage Theta Degrees | double | Theta component of stage's current position
HandEye Calibration Results | Cognex.VisionPro. CogHandEyeCalibrationResults | HandEye Calibration Results outputted from Handeye Calibrator The results are used to convert the position reported by the stage to the actual position.
TrinFromRun | Cognex.VisionPro. CogTransform2DLinear | The TrainFromRun transform of a part. This pin is displayed if ApplicationType==Alignment

### Outputs

Name | Type | Description
--- | --- | ---
Absolute Stage Motion X | Double | The absolute X position that the stage should be moved to in order to achieve the desired alignment/assembly
Absolute Stage Motion X | Double | The absolute Y position that the stage should be moved to in order to achieve the desired alignment/assembly
Absolute Stage Motion Theta Degrees | Double | The absolute rotation in degrees that the stage should be subject to in order to achieve the desired alignment/assembly
Relative Stage Motion X | Double | The X position relative to the current position that the stage should be moved to in order to achieve the desired alignment/assembly
Relative Stage Motion Y | Double | The Y position relative to the current position that the stage should be moved to in order to achieve the desired alignment/assembly
Relative Stage Motion Theta Degrees | Double | The rotation relative to the current rotational position in degrees that the stage should be subject to in order to achieve the desired alignment/assembly

## Assembly

For Assembly applications, the block accepts two TrainFromRun transforms. One for a stationary part and the other is for a moving part. The two poses, along with the current uncorrected stage position and the hand-eye calibration results to compute the relative and absolute stage pose parameters.

For assembly applications the block assumes that during train time the parts are placed such that when assembled by a repeatable assembly mechanism the parts would have the desired assembly. The block will output stage positions that would assemble the run-time part and train-time part similarly.

When Assembly is chosen in "Application Type" property, the input pins of Stage Pose Computer will change as below:

### Inputs

Name | Type | Description
--- | --- | ---
Traintime Pose At Guided Theta Degrees | Double | Theta component of moving station's trained position
Traintime Pose At Guided X | Double | X component of moving station's trained position
Traintime Pose At Guided Y | Double | Y component of moving station's trained position
Traintime Pose At Target Theta Degrees | Double | Theta component of stationary station's trained position
Traintime Pose At Target X | Double | X component of stationary station's trained position
Traintime Pose At Target Y | Double | Y component of stationary station's trained position
Current Uncorrected Stage Theta Degrees | Double | Theta component of moving station's current position
Current Uncorrected Stage X | Double | X component of moving station's current position
Current Uncorrected Stage Y | Double | Y component of moving station's current position
HandEye Calibration Results | CogHandEyeCalibrationResults | HandEye Calibration Results outputted from Handeye Calibrator The results are used to convert the position reported by the stage to the actual position.
TrainFromRun At Station With Stage | CogTransform2DLinear | The TrainFromRun transform of the moving part. This pin is displayed if ApplicationType==Assembly
TrainFromRun At Station Without Stage | CogTransform2DLinear | The TrainFromRun transform of the stationary part. This pin is displayed if ApplicationType==Assembly

### Outputs

Name | Type | Description
--- | --- | ---
Absolute Stage Motion X | Double | The absolute X position that the stage should be moved to in order to achieve the desired assembly
Absolute Stage Motion X | Double | The absolute Y position that the stage should be moved to in order to achieve the desired assembly
Absolute Stage Motion Theta Degrees | Double | The absolute rotation in degrees that the stage should be subject to in order to achieve the desired assembly
Relative Stage Motion X | Double | The X position relative to the current position that the stage should be moved to in order to achieve the desired assembly
Relative Stage Motion Y | Double | The Y position relative to the current position that the stage should be moved to in order to achieve the desired assembly
Relative Stage Motion Theta Degrees | Double | The rotation relative to the current rotational position in degrees that the stage should be subject to in order to achieve the desired assembly