Class RsJointTarget
A RsJointTarget corresponds to a jointtarget declaration in RAPID. It defines each individual axis position, for both the robot and the external axes. Jointtargets are used to define the positions that the robot and the external axes will move to with the instruction MoveAbsJ.
Implements
Inherited Members
Namespace: ABB.Robotics.RobotStudio.Stations
Assembly: ABB.Robotics.RobotStudio.Stations.dll
Syntax
public sealed class RsJointTarget : RsDataDeclaration, ISupportCopy, IDeclaration, IGfxObject
Examples
RsJointTarget Example.
Project.UndoContext.BeginUndoStep("RsJointTargetExample");
try
{
Station station = Station.ActiveStation;
// Create a joint target corresponding to the robots home position.
RsJointTarget myHomeJointTarget = new RsJointTarget();
// Get a valid RAPID name for the target and assign it.
myHomeJointTarget.Name = station.ActiveTask.GetValidRapidName("JointTarget", "_", 1);
// Add the JointTarget to the station.
station.ActiveTask.DataDeclarations.Add(myHomeJointTarget);
// Create the RobAxisValues for the target.
RobotAxisValues rbHomeAxis = new RobotAxisValues();
rbHomeAxis.Rax_1 = 0;
rbHomeAxis.Rax_2 = 0;
rbHomeAxis.Rax_3 = 0;
rbHomeAxis.Rax_4 = 0;
rbHomeAxis.Rax_5 = 30;
rbHomeAxis.Rax_6 = 0;
// Set the robot axis values of the target.
myHomeJointTarget.SetRobotAxes(rbHomeAxis, false);
// Set the target to visible in the graphics.
myHomeJointTarget.Visible = true;
// Show the name of the target in the graphics.
myHomeJointTarget.ShowName = true;
// Make the frame size twice as big for the target.
myHomeJointTarget.FrameSize = myHomeJointTarget.FrameSize * 2;
}
catch
{
Project.UndoContext.CancelUndoStep(CancelUndoStepType.Rollback);
throw;
}
finally
{
Project.UndoContext.EndUndoStep();
}
Constructors
RsJointTarget()
Creates and initializes a new RsJointTarget object.
Declaration
public RsJointTarget()
Examples
Create RsJointTarget.
Project.UndoContext.BeginUndoStep("RsJointTargetExample");
try
{
Station station = Station.ActiveStation;
// Create a joint target corresponding to the robots home position.
RsJointTarget myHomeJointTarget = new RsJointTarget();
// Get a valid RAPID name for the target and assign it.
myHomeJointTarget.Name = station.ActiveTask.GetValidRapidName("JointTarget", "_", 1);
// Add the JointTarget to the station.
station.ActiveTask.DataDeclarations.Add(myHomeJointTarget);
// Create the RobAxisValues for the target.
RobotAxisValues rbHomeAxis = new RobotAxisValues();
rbHomeAxis.Rax_1 = 0;
rbHomeAxis.Rax_2 = 0;
rbHomeAxis.Rax_3 = 0;
rbHomeAxis.Rax_4 = 0;
rbHomeAxis.Rax_5 = 30;
rbHomeAxis.Rax_6 = 0;
// Set the robot axis values of the target.
myHomeJointTarget.SetRobotAxes(rbHomeAxis, false);
// Set the target to visible in the graphics.
myHomeJointTarget.Visible = true;
// Show the name of the target in the graphics.
myHomeJointTarget.ShowName = true;
// Make the frame size twice as big for the target.
myHomeJointTarget.FrameSize = myHomeJointTarget.FrameSize * 2;
}
catch
{
Project.UndoContext.CancelUndoStep(CancelUndoStepType.Rollback);
throw;
}
finally
{
Project.UndoContext.EndUndoStep();
}
Properties
FrameSize
Gets or set the size of the graphical representation of the RsToolData.
Declaration
public double FrameSize { get; set; }
Property Value
Type | Description |
---|---|
Double |
Examples
Get/set FrameSize.
Project.UndoContext.BeginUndoStep("RsJointTargetExample");
try
{
Station station = Station.ActiveStation;
// Create a joint target corresponding to the robots home position.
RsJointTarget myHomeJointTarget = new RsJointTarget();
// Get a valid RAPID name for the target and assign it.
myHomeJointTarget.Name = station.ActiveTask.GetValidRapidName("JointTarget", "_", 1);
// Add the JointTarget to the station.
station.ActiveTask.DataDeclarations.Add(myHomeJointTarget);
// Create the RobAxisValues for the target.
RobotAxisValues rbHomeAxis = new RobotAxisValues();
rbHomeAxis.Rax_1 = 0;
rbHomeAxis.Rax_2 = 0;
rbHomeAxis.Rax_3 = 0;
rbHomeAxis.Rax_4 = 0;
rbHomeAxis.Rax_5 = 30;
rbHomeAxis.Rax_6 = 0;
// Set the robot axis values of the target.
myHomeJointTarget.SetRobotAxes(rbHomeAxis, false);
// Set the target to visible in the graphics.
myHomeJointTarget.Visible = true;
// Show the name of the target in the graphics.
myHomeJointTarget.ShowName = true;
// Make the frame size twice as big for the target.
myHomeJointTarget.FrameSize = myHomeJointTarget.FrameSize * 2;
}
catch
{
Project.UndoContext.CancelUndoStep(CancelUndoStepType.Rollback);
throw;
}
finally
{
Project.UndoContext.EndUndoStep();
}
IsInline
Gets or sets whether the RsJointTarget will be decalared inline in the RAPID when syncronized.
Declaration
public bool IsInline { get; set; }
Property Value
Type | Description |
---|---|
Boolean |
Examples
Get/set IsInline.
Project.UndoContext.BeginUndoStep("RsJointTargetExample");
try
{
Station station = Station.ActiveStation;
// Create a joint target corresponding to the robots home position.
RsJointTarget myHomeJointTarget = new RsJointTarget();
// Get a valid RAPID name for the target and assign it.
myHomeJointTarget.Name = station.ActiveTask.GetValidRapidName("JointTarget", "_", 1);
// Add the JointTarget to the station.
station.ActiveTask.DataDeclarations.Add(myHomeJointTarget);
// Create the RobAxisValues for the target.
RobotAxisValues rbHomeAxis = new RobotAxisValues();
rbHomeAxis.Rax_1 = 0;
rbHomeAxis.Rax_2 = 0;
rbHomeAxis.Rax_3 = 0;
rbHomeAxis.Rax_4 = 0;
rbHomeAxis.Rax_5 = 30;
rbHomeAxis.Rax_6 = 0;
// Set the robot axis values of the target.
myHomeJointTarget.SetRobotAxes(rbHomeAxis, false);
// Set the target to visible in the graphics.
myHomeJointTarget.Visible = true;
// Show the name of the target in the graphics.
myHomeJointTarget.ShowName = true;
// Make the frame size twice as big for the target.
myHomeJointTarget.FrameSize = myHomeJointTarget.FrameSize * 2;
}
catch
{
Project.UndoContext.CancelUndoStep(CancelUndoStepType.Rollback);
throw;
}
finally
{
Project.UndoContext.EndUndoStep();
}
Name
Gets or sets the name of the object
Declaration
public override string Name { get; set; }
Property Value
Type | Description |
---|---|
String |
Overrides
ShowName
Gets or sets a value indicating whether the name of the JointTarge will be displayed in the graphics.
Declaration
public bool ShowName { get; set; }
Property Value
Type | Description |
---|---|
Boolean |
Examples
Get/set ShowName.
Project.UndoContext.BeginUndoStep("RsJointTargetExample");
try
{
Station station = Station.ActiveStation;
// Create a joint target corresponding to the robots home position.
RsJointTarget myHomeJointTarget = new RsJointTarget();
// Get a valid RAPID name for the target and assign it.
myHomeJointTarget.Name = station.ActiveTask.GetValidRapidName("JointTarget", "_", 1);
// Add the JointTarget to the station.
station.ActiveTask.DataDeclarations.Add(myHomeJointTarget);
// Create the RobAxisValues for the target.
RobotAxisValues rbHomeAxis = new RobotAxisValues();
rbHomeAxis.Rax_1 = 0;
rbHomeAxis.Rax_2 = 0;
rbHomeAxis.Rax_3 = 0;
rbHomeAxis.Rax_4 = 0;
rbHomeAxis.Rax_5 = 30;
rbHomeAxis.Rax_6 = 0;
// Set the robot axis values of the target.
myHomeJointTarget.SetRobotAxes(rbHomeAxis, false);
// Set the target to visible in the graphics.
myHomeJointTarget.Visible = true;
// Show the name of the target in the graphics.
myHomeJointTarget.ShowName = true;
// Make the frame size twice as big for the target.
myHomeJointTarget.FrameSize = myHomeJointTarget.FrameSize * 2;
}
catch
{
Project.UndoContext.CancelUndoStep(CancelUndoStepType.Rollback);
throw;
}
finally
{
Project.UndoContext.EndUndoStep();
}
Visible
Geta or sets a value specifying whether the joint target should be visible in the graphics or not.
Declaration
public bool Visible { get; set; }
Property Value
Type | Description |
---|---|
Boolean |
Examples
Get/set Visible.
Project.UndoContext.BeginUndoStep("RsJointTargetExample");
try
{
Station station = Station.ActiveStation;
// Create a joint target corresponding to the robots home position.
RsJointTarget myHomeJointTarget = new RsJointTarget();
// Get a valid RAPID name for the target and assign it.
myHomeJointTarget.Name = station.ActiveTask.GetValidRapidName("JointTarget", "_", 1);
// Add the JointTarget to the station.
station.ActiveTask.DataDeclarations.Add(myHomeJointTarget);
// Create the RobAxisValues for the target.
RobotAxisValues rbHomeAxis = new RobotAxisValues();
rbHomeAxis.Rax_1 = 0;
rbHomeAxis.Rax_2 = 0;
rbHomeAxis.Rax_3 = 0;
rbHomeAxis.Rax_4 = 0;
rbHomeAxis.Rax_5 = 30;
rbHomeAxis.Rax_6 = 0;
// Set the robot axis values of the target.
myHomeJointTarget.SetRobotAxes(rbHomeAxis, false);
// Set the target to visible in the graphics.
myHomeJointTarget.Visible = true;
// Show the name of the target in the graphics.
myHomeJointTarget.ShowName = true;
// Make the frame size twice as big for the target.
myHomeJointTarget.FrameSize = myHomeJointTarget.FrameSize * 2;
}
catch
{
Project.UndoContext.CancelUndoStep(CancelUndoStepType.Rollback);
throw;
}
finally
{
Project.UndoContext.EndUndoStep();
}
Methods
AfterLoad(PimDocument)
Declaration
protected override void AfterLoad(PimDocument doc)
Parameters
Type | Name | Description |
---|---|---|
RobotStudio.API.Persistence.PimDocument | doc |
Overrides
GetExternalAxes(Boolean)
Gets the ExternalAxisValues of the jointtarget.
Declaration
public ExternalAxisValues GetExternalAxes(bool convertFromRapidDataToSI)
Parameters
Type | Name | Description |
---|---|---|
Boolean | convertFromRapidDataToSI | Specifies whether the ExternalAxisValues should be converted from the RAPID data format to SI or not. |
Returns
Type | Description |
---|---|
ExternalAxisValues | The ExternalAxisValues of the jointtarget. |
GetJointValues(Mechanism, Boolean)
Declaration
public double[] GetJointValues(Mechanism mechanism, bool convertFromRapidDataToSI)
Parameters
Type | Name | Description |
---|---|---|
Mechanism | mechanism | |
Boolean | convertFromRapidDataToSI |
Returns
Type | Description |
---|---|
Double[] |
GetRobotAxes(Boolean)
Gets the RobotAxisValues of the jointtarget.
Declaration
public RobotAxisValues GetRobotAxes(bool convertFromRapidDataToSI)
Parameters
Type | Name | Description |
---|---|---|
Boolean | convertFromRapidDataToSI | Specifies whether the RobotAxisValues should be converted from the RAPID data format to SI or not. |
Returns
Type | Description |
---|---|
RobotAxisValues | The RobotAxisValues of the jointtarget |
Examples
GetRobotAxes.
Project.UndoContext.BeginUndoStep("RsJointTargetExample");
try
{
Station station = Station.ActiveStation;
// Create a joint target corresponding to the robots home position.
RsJointTarget myHomeJointTarget = new RsJointTarget();
// Get a valid RAPID name for the target and assign it.
myHomeJointTarget.Name = station.ActiveTask.GetValidRapidName("JointTarget", "_", 1);
// Add the JointTarget to the station.
station.ActiveTask.DataDeclarations.Add(myHomeJointTarget);
// Create the RobAxisValues for the target.
RobotAxisValues rbHomeAxis = new RobotAxisValues();
rbHomeAxis.Rax_1 = 0;
rbHomeAxis.Rax_2 = 0;
rbHomeAxis.Rax_3 = 0;
rbHomeAxis.Rax_4 = 0;
rbHomeAxis.Rax_5 = 30;
rbHomeAxis.Rax_6 = 0;
// Set the robot axis values of the target.
myHomeJointTarget.SetRobotAxes(rbHomeAxis, false);
// Set the target to visible in the graphics.
myHomeJointTarget.Visible = true;
// Show the name of the target in the graphics.
myHomeJointTarget.ShowName = true;
// Make the frame size twice as big for the target.
myHomeJointTarget.FrameSize = myHomeJointTarget.FrameSize * 2;
}
catch
{
Project.UndoContext.CancelUndoStep(CancelUndoStepType.Rollback);
throw;
}
finally
{
Project.UndoContext.EndUndoStep();
}
Highlight()
Sets the highlight color of the target to the default highlight color.
Declaration
public void Highlight()
Highlight(Color)
Sets the highlight color of the target.
Declaration
public void Highlight(Color color)
Parameters
Type | Name | Description |
---|---|---|
Color | color |
JumpTo()
Jumps the mechanism of the task that the jointtraget belongs to, to the position of the jointtarget.
Declaration
public bool JumpTo()
Returns
Type | Description |
---|---|
Boolean | True if it is possible to jump to the target and the jump succeded, otherwise false. |
Examples
JumpTo.
// NOTE: This example requires a station containing an IRB_140 and a running VC.
Project.UndoContext.BeginUndoStep("RsMoveInstructionMovementMethods");
try
{
Station station = Station.ActiveStation;
// Create a PathProcedure to add the move instructions to.
RsPathProcedure myPath = new RsPathProcedure("myPath");
station.ActiveTask.PathProcedures.Add(myPath);
// Create a joint target corresponding to the robots home position.
RsJointTarget myHomeJointTarget = new RsJointTarget();
myHomeJointTarget.Name = "myHomeJT";
station.ActiveTask.DataDeclarations.Add(myHomeJointTarget);
// Set the robot axis values.
RobotAxisValues rbHomeAxis = new RobotAxisValues();
rbHomeAxis.Rax_1 = 0;
rbHomeAxis.Rax_2 = 0;
rbHomeAxis.Rax_3 = 0;
rbHomeAxis.Rax_4 = 0;
rbHomeAxis.Rax_5 = 30;
rbHomeAxis.Rax_6 = 0;
myHomeJointTarget.SetRobotAxes(rbHomeAxis, false);
// Create another joint target to jump and move to.
RsJointTarget myJointTarget = new RsJointTarget();
myJointTarget.Name = "myJointTarget";
station.ActiveTask.DataDeclarations.Add(myJointTarget);
// Set the robot axis values.
RobotAxisValues rbAxis = new RobotAxisValues();
rbAxis.Rax_1 = 70.0000000000001;
rbAxis.Rax_2 = -30;
rbAxis.Rax_3 = 30;
rbAxis.Rax_4 = -55.0000000000001;
rbAxis.Rax_5 = 40;
rbAxis.Rax_6 = 10;
myJointTarget.SetRobotAxes(rbAxis, false);
// Create a move instruction.
RsMoveInstruction myMoveAbsJ = new RsMoveInstruction(station.ActiveTask, "MoveAbs", "Default", "myJointTarget");
myPath.Instructions.Add(myMoveAbsJ);
// Jump to the move instruction 'myMoveAbsJ'.
if (myMoveAbsJ.JumpTo())
{
Logger.AddMessage(new LogMessage("The robot jumped successfully!"));
}
else
{
Logger.AddMessage(new LogMessage("The JumpTo command failed!"));
}
// Jump the robot to its home postition.
myHomeJointTarget.JumpTo();
// Move to the move instruction 'myMoveAbsJ'
if (myMoveAbsJ.MoveTo())
{
Logger.AddMessage(new LogMessage("The robot moved successfully!"));
}
else
{
Logger.AddMessage(new LogMessage("The MoveTo command failed!"));
}
}
catch
{
Project.UndoContext.CancelUndoStep(CancelUndoStepType.Rollback);
throw;
}
finally
{
Project.UndoContext.EndUndoStep();
}
JumpTo(Boolean)
Jumps the mechanism of the task that the jointtraget belongs to, to the position of the jointtarget. Optionally updates the joint values in the virtual controller. Updating the joint values in the controller is time consuning compared to only updating the Mechanism joint value. If you need to frequently call this method, it is recomended to update the joint values in the controller, only for the last call.
Declaration
public bool JumpTo(bool updateController)
Parameters
Type | Name | Description |
---|---|---|
Boolean | updateController | Specifies if the joint values in the controller shall be updated in addition to the joint values of the mechanism. |
Returns
Type | Description |
---|---|
Boolean | True if it is possible to jump to the target and the jump succeded, otherwise false. |
Examples
JumpTo.
// NOTE: This example requires a station containing an IRB_140 and a running VC.
Project.UndoContext.BeginUndoStep("RsMoveInstructionMovementMethods");
try
{
Station station = Station.ActiveStation;
// Create a PathProcedure to add the move instructions to.
RsPathProcedure myPath = new RsPathProcedure("myPath");
station.ActiveTask.PathProcedures.Add(myPath);
// Create a joint target corresponding to the robots home position.
RsJointTarget myHomeJointTarget = new RsJointTarget();
myHomeJointTarget.Name = "myHomeJT";
station.ActiveTask.DataDeclarations.Add(myHomeJointTarget);
// Set the robot axis values.
RobotAxisValues rbHomeAxis = new RobotAxisValues();
rbHomeAxis.Rax_1 = 0;
rbHomeAxis.Rax_2 = 0;
rbHomeAxis.Rax_3 = 0;
rbHomeAxis.Rax_4 = 0;
rbHomeAxis.Rax_5 = 30;
rbHomeAxis.Rax_6 = 0;
myHomeJointTarget.SetRobotAxes(rbHomeAxis, false);
// Create another joint target to jump and move to.
RsJointTarget myJointTarget = new RsJointTarget();
myJointTarget.Name = "myJointTarget";
station.ActiveTask.DataDeclarations.Add(myJointTarget);
// Set the robot axis values.
RobotAxisValues rbAxis = new RobotAxisValues();
rbAxis.Rax_1 = 70.0000000000001;
rbAxis.Rax_2 = -30;
rbAxis.Rax_3 = 30;
rbAxis.Rax_4 = -55.0000000000001;
rbAxis.Rax_5 = 40;
rbAxis.Rax_6 = 10;
myJointTarget.SetRobotAxes(rbAxis, false);
// Create a move instruction.
RsMoveInstruction myMoveAbsJ = new RsMoveInstruction(station.ActiveTask, "MoveAbs", "Default", "myJointTarget");
myPath.Instructions.Add(myMoveAbsJ);
// Jump to the move instruction 'myMoveAbsJ'.
if (myMoveAbsJ.JumpTo())
{
Logger.AddMessage(new LogMessage("The robot jumped successfully!"));
}
else
{
Logger.AddMessage(new LogMessage("The JumpTo command failed!"));
}
// Jump the robot to its home postition.
myHomeJointTarget.JumpTo();
// Move to the move instruction 'myMoveAbsJ'
if (myMoveAbsJ.MoveTo())
{
Logger.AddMessage(new LogMessage("The robot moved successfully!"));
}
else
{
Logger.AddMessage(new LogMessage("The MoveTo command failed!"));
}
}
catch
{
Project.UndoContext.CancelUndoStep(CancelUndoStepType.Rollback);
throw;
}
finally
{
Project.UndoContext.EndUndoStep();
}
JumpToAsync(Boolean)
Declaration
public Task<bool> JumpToAsync(bool updateController)
Parameters
Type | Name | Description |
---|---|---|
Boolean | updateController |
Returns
Type | Description |
---|---|
Task<Boolean> |
ResetHighlight()
Resets the highlight color of the target to the default color.
Declaration
public void ResetHighlight()
SetExternalAxes(ExternalAxisValues, Boolean)
Sets the ExternalAxisValues of the jointtarget.
Declaration
public void SetExternalAxes(ExternalAxisValues value, bool convertFromSIToRapidData)
Parameters
Type | Name | Description |
---|---|---|
ExternalAxisValues | value | The ExternalAxisValues to be set for the jointtarget. |
Boolean | convertFromSIToRapidData | Specifies whether the ExternalAxisValues should be converted from the SI to RAPID data format or not. |
SetRobotAxes(RobotAxisValues, Mechanism, Boolean)
Sets the RobotAxisValues of the jointtarget to the current values of the specified Mechanism.
Declaration
public void SetRobotAxes(RobotAxisValues robotAxes, Mechanism mechanism, bool convertFromSIToRapidData)
Parameters
Type | Name | Description |
---|---|---|
RobotAxisValues | robotAxes | The RobotAxisValues to be set for the jointtarget. Axis values that correspond to active joints of the specified Mechanism are ignored. |
Mechanism | mechanism | The Mechanism from which to get the current joint values. |
Boolean | convertFromSIToRapidData | Specifies whether the RobotAxisValues should be converted from SI to RAPID data format or not. |
SetRobotAxes(RobotAxisValues, Boolean)
Sets the RobotAxisValues of the jointtarget.
Declaration
public void SetRobotAxes(RobotAxisValues value, bool convertFromSIToRapidData)
Parameters
Type | Name | Description |
---|---|---|
RobotAxisValues | value | The RobotAxisValues to be set for the jointtarget. |
Boolean | convertFromSIToRapidData | Specifies whether the RobotAxisValues should be converted from SI to RAPID data format or not. |
Examples
SetRobotAxes.
Project.UndoContext.BeginUndoStep("RsJointTargetExample");
try
{
Station station = Station.ActiveStation;
// Create a joint target corresponding to the robots home position.
RsJointTarget myHomeJointTarget = new RsJointTarget();
// Get a valid RAPID name for the target and assign it.
myHomeJointTarget.Name = station.ActiveTask.GetValidRapidName("JointTarget", "_", 1);
// Add the JointTarget to the station.
station.ActiveTask.DataDeclarations.Add(myHomeJointTarget);
// Create the RobAxisValues for the target.
RobotAxisValues rbHomeAxis = new RobotAxisValues();
rbHomeAxis.Rax_1 = 0;
rbHomeAxis.Rax_2 = 0;
rbHomeAxis.Rax_3 = 0;
rbHomeAxis.Rax_4 = 0;
rbHomeAxis.Rax_5 = 30;
rbHomeAxis.Rax_6 = 0;
// Set the robot axis values of the target.
myHomeJointTarget.SetRobotAxes(rbHomeAxis, false);
// Set the target to visible in the graphics.
myHomeJointTarget.Visible = true;
// Show the name of the target in the graphics.
myHomeJointTarget.ShowName = true;
// Make the frame size twice as big for the target.
myHomeJointTarget.FrameSize = myHomeJointTarget.FrameSize * 2;
}
catch
{
Project.UndoContext.CancelUndoStep(CancelUndoStepType.Rollback);
throw;
}
finally
{
Project.UndoContext.EndUndoStep();
}