Motion domain |
The MotionDomain namespace lets you access the mechanical units of the robot system.
Using a MotionSystem object you can send jogging commands to an mechanical unit and get or set the incremental jogging mode. Using a MechanicalUnit object you can get a lot of information about the mechanical units of the robot system.
You can also subscribe to changes of the mechanical unit, for example changed tool, work object, coordinated system, motion mode or incremental step size.
MotionSystem objectYou can access the motion system by using a the Controller property MotionSystem.
private MotionSystem aMotionSystem;
aMotionSystem = aController.MotionSystem;
Private aMotionSystem As MotionSystem aMotionSystem = aController.MotionSystem
The mechanical units can be of different types, for example a robot with a TCP, a multiple axes manipulator, or a single axis unit. Mechanical units are available through the MotionSystem object. If only the active mechanical unit is of interest you may use the method GetActiveMechanicalUnit.
MechanicalUnitCollection aMechCol = aController.MotionSystem.GetMechanicalUnits(); MechanicalUnit aMechUnit = aController.MotionSystem.GetActiveMechanicalUnit();
Dim aMechCol As MechanicalUnitCollection = aController.MotionSystem.GetMechanicalUnits() Dim aMechUnit As MechanicalUnit = aController.MotionSystem.GetActiveMechanicalUnit();
It is possible to jog the active mechanical unit using the SetJoggingCmd method and the calls JoggingStart and JoggingStop. Depending on the selected MotionMode and IncrementalMode different joints and speeds are configured.
aController.MotionSystem.JoggingStop(); aMechUnit.MotionMode = MotionModeType.Linear; aController.MotionSystem.IncrementalMode = IncrementalModeType.Small; aController.MotionSystem.SetJoggingCmd(-50, 50, 0); aController.MotionSystem.JoggingStart();
aController.MotionSystem.JoggingStop() aMechUnit.MotionMode = MotionModeType.Linear aController.MotionSystem.IncrementalMode = IncrementalModeType.Small aController.MotionSystem.SetJoggingCmd(-50, 50, 0) aController.MotionSystem.JoggingStart()
There are numerous properties available for the mechanical unit, for example Name, Model, NumberOfAxes, SerialNumber, CoordinateSystem, MotionMode, IsCalibrated, Tool and WorkObject and so on. It is also possible to get the current position of a mechanical unit as a RobTarget or JointTarget.
Controller aController = new Controller();
RobTarget aRobTarget = aController.MotionSystem.ActiveMechanicalUnit.GetPosition(CoordinateSystemType.World);
JointTarget aJointTarget = aController.MotionSystem.ActiveMechanicalUnit.GetPosition2();
Dim aController As New Controller() Dim aRobTarget As RobTarget = c.MotionSystem.ActiveMechanicalUnit.GetPosition(CoordinateSystemType.World) Dim aJointTarget As JointTarget = c.MotionSystem.ActiveMechanicalUnit.GetPosition()
By subscribing to the DataChanged event of the MechanicalUnit object, you will be notified when a change of tool, work object, coordinated system, motion mode or incremental step size occurs.
aMechUnit.DataChanged += new MechanicalUnitDataEventHandler(aMech_DataChanged); ..... private void aMech_DataChanged(object sender, MechanicalUnitDataEventArgs e) { switch (e.Reason) { case MechanicalUnitDataChangeReason.Tool: ChangeOfTool((MechanicalUnit)sender) case MechanicalUnitDataChangeReason.WorkObject: ...... } }
AddHandler aMechUnit.DataChanged, AddressOf aMech_DataChanged ...... Private Sub aMech_DataChanged(sender As Object, e As MechanicalUnitDataEventArgs) Select e.Reason Case MechanicalUnitDataChangeReason.Tool ChangeOfTool(DirectCast(sender, MechanicalUnit)) Case MechanicalUnitDataChangeReason.WorkObject ...... End Select End Sub
![]() |
---|
Read more about the classes, methods and properties available in the MotionDomain in the Reference Manual FlexPendant SDK. |