Difference between revisions of "MC-Basic:IsLocationReachable"
(14 intermediate revisions by the same user not shown) | |||
Line 1: | Line 1: | ||
+ | {{Languages|MC-Basic:IsLocationReachable}} | ||
+ | {{MC-Basic |SHORT FORM= |SYNTAX= <''joint_variable''>=IsLocationReachable''({<robot>,} <location>, <configuration>)'' | ||
+ | |AVAILABILITY= Since Version 4.20.x | ||
+ | |DESCRIPTION= Checks the given point if it is reachable by the given robot. Checks both Cartesian and joint limits. Input parameters: | ||
+ | <''robot''> : name of the group for which the direct kinematics is computed, when a WITH command is executed this argument is not needed (the comma should also be omitted). <br> | ||
+ | <location>: location coordinates of the point to be translated into joint coordinates. <br> | ||
+ | <configuration>: integer describing the configuration of the returned joint position (for SCARA it is the same as ARMCMD or ARMFBK). The number and type of configuration flags depend on each robot type. Note that robot properties ARMCMD, ECMD, WCMD have all three values(0, 1, 2), where 0 is reserved for AUTO option. The configuration bits however have only two values (0, 1)! | ||
− | + | ||
+ | for SCARA robot : Arm<br> | ||
+ | (Bit 0) <br> | ||
+ | value = 0 – Lefty (armcd = 1) <br> | ||
+ | value = 1 – Righty (armcmd = 2) <br> | ||
+ | |||
+ | for PUMA robot:<br> | ||
+ | Arm (Bit 0) <br> | ||
+ | value = 0 – Lefty (armcd = 1) <br> | ||
+ | value = 1 – Righty (armcmd = 2) <br> | ||
+ | |||
+ | Elbow (Bit 1) <br> | ||
+ | value = 0 – Below (ecmd = 1) <br> | ||
+ | value = 1 – Above (ecmd = 2) <br> | ||
+ | |||
+ | Wrist (Bit 2):<br> | ||
+ | Noflip (wcmd = 1) <br> | ||
+ | value = 1 – Flip (wcmd = 2) <br> | ||
+ | |||
+ | for TRAVERSEARM robot : <br> | ||
+ | Arm ( Bit 0)<br> | ||
+ | value = 0 – Lefty (armcd = 1)<br> | ||
+ | value = 1 – Righty (armcmd = 2) <br> | ||
+ | |||
+ | for DELTA, SCISSORS, … and other robots, that have no configuration flags, these fields are not used.<br> | ||
+ | The configuration flag argument of the IsLocationReachable is defined as:<br> | ||
+ | [[File:ISREACHABLEBITS.PNG |300px]] | ||
+ | {{Note | In this function we cannot use "AUTO" option, therefore this formula differ slightly from bitmap in [[MC-Basic:TOJOINT |TOJOINT]]}}<br> | ||
+ | {{Note | Constants lefty, righty, above, below, flip and noflip are defined as [[MC-Basic Constants | built-in constants]] of the MC-Basic language.}} | ||
+ | |TYPE= Return Type: Long 0 - point is reachable<br> | ||
+ | 1,2,3,4,... - index of axis that exceed position limits<br> | ||
+ | Others - system error, basically there is no single axis that exceeds limit but the combination of segment length and input cartesian point does not have solution of Inverse Kinematics. Can be:<br> | ||
+ | * 70 - Not calibrated/configured | ||
+ | * 117 - Point too close. The target coordinates are too close to the robot's Cartesian space origin point.<br> | ||
+ | * 119 - Point too far. Outside of the working envelope. The target coordinates are too far from the robot's Cartesian space origin point.<br> | ||
+ | * 121 - The target point is not reachable. <br> | ||
+ | * 125 - Wrong point type.<br> | ||
+ | * 105 - World Xmax exceeded<br> | ||
+ | * 106 - World Xmin exceeded<br> | ||
+ | * 107 - World Ymax exceeded<br> | ||
+ | * 108 - World Ymin exceeded<br> | ||
+ | * 109 - World Zmax exceeded<br> | ||
+ | * 110 - World Zmin exceeded<br> | ||
+ | * 142 - Work Piece Xmax exceeded <br> | ||
+ | * 143 - Work Piece Xmin exceeded <br> | ||
+ | * 144 - Work Piece Ymax exceeded <br> | ||
+ | * 145 - Work Piece Ymin exceeded <br> | ||
+ | * 146 - Work Piece Zmax exceeded <br> | ||
+ | * 147 - Work Piece Zmin exceeded <br> | ||
+ | * 148 - Machine Table Xmax exceeded <br> | ||
+ | * 149 - Machine Table Xmin exceeded <br> | ||
+ | * 150 - Machine Table Ymax exceeded <br> | ||
+ | * 151 - Machine Table Ymin exceeded <br> | ||
+ | * 152 - Machine Table Zmax exceeded <br> | ||
+ | * 153 - Machine Table Zmin exceeded <br> | ||
+ | * 154 - Base Xmax exceeded <br> | ||
+ | * 155 - Base Xmin exceeded <br> | ||
+ | * 156 - Base Ymax exceeded <br> | ||
+ | * 157 - Base Ymin exceeded <br> | ||
+ | * 157 - Base Zmax exceeded <br> | ||
+ | * 158 - Base Zmin exceeded <br> | ||
+ | * 159 - Tool Xmax exceeded <br> | ||
+ | * 160 - Tool Xmin exceeded <br> | ||
+ | * 161 - Tool Ymax exceeded <br> | ||
+ | * 162 - Tool Ymin exceeded <br> | ||
+ | * 163 - Tool Zmax exceeded <br> | ||
+ | * 164 - Tool Zmin exceeded <br> | ||
+ | more of them can be found in [[http://softmc.servotronix.com/wiki/Error_Codes|Error Codes]], just add to return value 3000 for motion and 13000 for robot | ||
+ | errors<br> | ||
+ | |RANGE= | ||
+ | |UNITS= | ||
+ | |DEFAULT= | ||
+ | |SCOPE= Task, Terminal | ||
+ | |LIMITATIONS= | ||
+ | * Not in Configuration context.<br> | ||
+ | * The joint variable and the location parameter must either have a group type identical to the group parameter, or have the same number of coordinates.<br> | ||
+ | * The values of the configuration argument (the long type parameter) can be only: 0, or 1<br> | ||
+ | |EXAMPLE= | ||
+ | |SEE ALSO= | ||
+ | * [[MC-Basic:TOCART|TOCART]]<br> | ||
+ | * [[MC-Basic:isJointReachable|isJointReachable]] | ||
+ | |||
+ | [[Category:MC-Basic:Points Handling|IsLocationReachable]] | ||
+ | }} |
Latest revision as of 13:40, 1 April 2021
Language: | English |
---|
Checks the given point if it is reachable by the given robot. Checks both Cartesian and joint limits. Input parameters:
<robot> : name of the group for which the direct kinematics is computed, when a WITH command is executed this argument is not needed (the comma should also be omitted).
<location>: location coordinates of the point to be translated into joint coordinates.
<configuration>: integer describing the configuration of the returned joint position (for SCARA it is the same as ARMCMD or ARMFBK). The number and type of configuration flags depend on each robot type. Note that robot properties ARMCMD, ECMD, WCMD have all three values(0, 1, 2), where 0 is reserved for AUTO option. The configuration bits however have only two values (0, 1)!
for SCARA robot : Arm
(Bit 0)
value = 0 – Lefty (armcd = 1)
value = 1 – Righty (armcmd = 2)
for PUMA robot:
Arm (Bit 0)
value = 0 – Lefty (armcd = 1)
value = 1 – Righty (armcmd = 2)
Elbow (Bit 1)
value = 0 – Below (ecmd = 1)
value = 1 – Above (ecmd = 2)
Wrist (Bit 2):
Noflip (wcmd = 1)
value = 1 – Flip (wcmd = 2)
for TRAVERSEARM robot :
Arm ( Bit 0)
value = 0 – Lefty (armcd = 1)
value = 1 – Righty (armcmd = 2)
for DELTA, SCISSORS, … and other robots, that have no configuration flags, these fields are not used.
The configuration flag argument of the IsLocationReachable is defined as:
NOTE | |
In this function we cannot use "AUTO" option, therefore this formula differ slightly from bitmap in TOJOINT |
NOTE | |
Constants lefty, righty, above, below, flip and noflip are defined as built-in constants of the MC-Basic language. |
Syntax
<joint_variable>=IsLocationReachable({<robot>,} <location>, <configuration>)
Availability
Since Version 4.20.x
Type
Return Type: Long 0 - point is reachable
1,2,3,4,... - index of axis that exceed position limits
Others - system error, basically there is no single axis that exceeds limit but the combination of segment length and input cartesian point does not have solution of Inverse Kinematics. Can be:
* 70 - Not calibrated/configured * 117 - Point too close. The target coordinates are too close to the robot's Cartesian space origin point.
* 119 - Point too far. Outside of the working envelope. The target coordinates are too far from the robot's Cartesian space origin point.
* 121 - The target point is not reachable.
* 125 - Wrong point type.
* 105 - World Xmax exceeded
* 106 - World Xmin exceeded
* 107 - World Ymax exceeded
* 108 - World Ymin exceeded
* 109 - World Zmax exceeded
* 110 - World Zmin exceeded
* 142 - Work Piece Xmax exceeded
* 143 - Work Piece Xmin exceeded
* 144 - Work Piece Ymax exceeded
* 145 - Work Piece Ymin exceeded
* 146 - Work Piece Zmax exceeded
* 147 - Work Piece Zmin exceeded
* 148 - Machine Table Xmax exceeded
* 149 - Machine Table Xmin exceeded
* 150 - Machine Table Ymax exceeded
* 151 - Machine Table Ymin exceeded
* 152 - Machine Table Zmax exceeded
* 153 - Machine Table Zmin exceeded
* 154 - Base Xmax exceeded
* 155 - Base Xmin exceeded
* 156 - Base Ymax exceeded
* 157 - Base Ymin exceeded
* 157 - Base Zmax exceeded
* 158 - Base Zmin exceeded
* 159 - Tool Xmax exceeded
* 160 - Tool Xmin exceeded
* 161 - Tool Ymax exceeded
* 162 - Tool Ymin exceeded
* 163 - Tool Zmax exceeded
* 164 - Tool Zmin exceeded
more of them can be found in [Codes], just add to return value 3000 for motion and 13000 for robot errors
Scope
Task, Terminal
Limitations
- Not in Configuration context.
* The joint variable and the location parameter must either have a group type identical to the group parameter, or have the same number of coordinates.
* The values of the configuration argument (the long type parameter) can be only: 0, or 1