Initial commit
This commit is contained in:
@@ -0,0 +1,163 @@
|
||||
##############################################################################
|
||||
# File: RoboticRulesUserDefinitions.py
|
||||
# Description
|
||||
# This file contains the machine or controller specific code for the tool path processing
|
||||
# 12-Nov-2020 Support Tape Layup device
|
||||
#
|
||||
#
|
||||
# ================================================================
|
||||
|
||||
import sys
|
||||
import math
|
||||
import os
|
||||
import NXOpen
|
||||
import NXOpen.CAM
|
||||
|
||||
|
||||
# This script assumes that all symbols from RoboticRulesSystemDefinitions.py have been imported already
|
||||
# This is usually achieved by loading both RoboticRulesSystemDefinitions.py and this file using special code
|
||||
# from RoboticToolpathProcessor import *
|
||||
|
||||
|
||||
# Define a new simple robotic calculator that computes some process parameters
|
||||
class SampleProcessParameterRoboticDataCalculator(SingleUdeRoboticDataCalculator):
|
||||
""" Just a sample calculator to set process parameters.
|
||||
It sets a value of 1 to all toolpath locations that are close to a specified point.
|
||||
"""
|
||||
def __init__(self):
|
||||
# name of the input UDE
|
||||
SingleUdeRoboticDataCalculator.__init__(self, "robot_mark_point_sample")
|
||||
# input parameter names
|
||||
self.paramName_Point = "point"
|
||||
self.paramName_Distance = "distance"
|
||||
# output parameter name
|
||||
self.paramNameLocationData_SampleParameter = "sample_processparameter"
|
||||
|
||||
# strings to show to the user
|
||||
uiLabels = {
|
||||
self.inputUdeName: "Robot Mark Point Sample",
|
||||
self.paramName_Point: "Point",
|
||||
self.paramName_Distance: "Distance",
|
||||
self.paramNameLocationData_SampleParameter: "Sample Motion Data Param"}
|
||||
|
||||
# Input UDE definition
|
||||
self.inputUdeDefinition = UdeDefinition(self.inputUdeName, uiLabels)
|
||||
self.inputUdeDefinition.AddUdeParameter(UdeParameterPoint(self.paramName_Point, uiLabels))
|
||||
self.inputUdeDefinition.AddUdeParameter(UdeParameterDouble(self.paramName_Distance,uiLabels, 0.0))
|
||||
|
||||
# Output UDE definition
|
||||
self.locationDataUdeDefinition = UdeDefinition("", "")
|
||||
self.locationDataUdeDefinition.AddUdeParameter(UdeParameterInt(self.paramNameLocationData_SampleParameter, uiLabels, 0))
|
||||
|
||||
def HandleSingleInputUde(self, ude):
|
||||
# Read the parameters of the input ude
|
||||
p = ude.GetParameter(self.paramName_Point).Point
|
||||
if p == None:
|
||||
raise ToolPathProcessingException("Parameter " + self.paramName_Point + " is not defined")
|
||||
self.point = p.Coordinates
|
||||
self.distance = ude.GetParameter(self.paramName_Distance).DoubleValue
|
||||
|
||||
def ProcessLocationDataUde(self, input, ude):
|
||||
if self.HasInputUde(): # do only something if the operation has the input ude
|
||||
inputPos = input.CurrentLocation.Position
|
||||
curDistance = RobotMath_Distance(inputPos,self.point)
|
||||
# calculate the output ude parameter
|
||||
if curDistance < self.distance:
|
||||
ude.GetParameter(self.paramNameLocationData_SampleParameter).IntegerValue = 1
|
||||
else:
|
||||
ude.GetParameter(self.paramNameLocationData_SampleParameter).IntegerValue = 0
|
||||
|
||||
|
||||
def RoboticRulesScript_GetCalculators(addAll: bool) -> tuple:
|
||||
"""Compute the calculators for the current cell.
|
||||
param addAll: If true all calculators are added, even those that do not work for the current kinematic.
|
||||
returns: a tuple of (calculator, externalAxisList) """
|
||||
|
||||
# define the list of external axes
|
||||
railAxisName = "RAIL"
|
||||
railAxisName2 = "Z_RAIL"
|
||||
positionerAxisName = "POSITIONER"
|
||||
drillingAxisName = "QUILL"
|
||||
tapeAxisName = "TAPE_ROTARY"
|
||||
extruder1AxisName = "EXTRUDER1_LINEAR"
|
||||
extruder2AxisName = "EXTRUDER2_LINEAR"
|
||||
allExternalAxes = [positionerAxisName, railAxisName, railAxisName2, drillingAxisName, tapeAxisName, extruder1AxisName, extruder2AxisName]
|
||||
|
||||
validExternalAxes = []
|
||||
for i in range(len(allExternalAxes)):
|
||||
if KinUtils_HasAxis(allExternalAxes[i]):
|
||||
validExternalAxes.append(allExternalAxes[i])
|
||||
|
||||
externalAxes = []
|
||||
if addAll:
|
||||
externalAxes = allExternalAxes
|
||||
else:
|
||||
externalAxes = validExternalAxes
|
||||
|
||||
# Define which calculators should be used
|
||||
calc = CompoundRoboticDataCalculator()
|
||||
|
||||
calc.ChildCalculators.append(ConfigurationRoboticDataCalculator())
|
||||
calc.ChildCalculators.append(ParkingPositionRoboticDataCalculator(externalAxes))
|
||||
calc.ChildCalculators.append(ParkingPositionReuseRoboticDataCalculator(externalAxes))
|
||||
calc.ChildCalculators.append(SampleProcessParameterRoboticDataCalculator())
|
||||
|
||||
positionerAxisData = []
|
||||
|
||||
if KinUtils_HasAxis(positionerAxisName):
|
||||
axisData = KinUtils_GetAxisData(positionerAxisName)
|
||||
positionerAxisData.append(axisData)
|
||||
calc.ChildCalculators.append(PositionerRoboticDataCalculator(axisData))
|
||||
elif addAll:
|
||||
axisData = AxisData(positionerAxisName, NXOpen.Vector3d(1.0,0.0,0.0), True)
|
||||
calc.ChildCalculators.append(PositionerRoboticDataCalculator(axisData))
|
||||
|
||||
calc.ChildCalculators.append(ToolOrientationRoboticDataCalculator(positionerAxisData))
|
||||
calc.ChildCalculators.append(RobotFindingResolver(validExternalAxes))
|
||||
|
||||
calc.ChildCalculators.append(TapeLayingRoboticDataCalculator([tapeAxisName, extruder1AxisName, extruder2AxisName]))
|
||||
|
||||
calc.ChildCalculators.append(DrillingDeviceRoboticDataCalculator(drillingAxisName))
|
||||
|
||||
if KinUtils_HasAxis(railAxisName):
|
||||
railAxisDir = KinUtils_GetAxisDirection(railAxisName)
|
||||
railAxisPos = KinUtils_GetPointOnAxis(railAxisName)
|
||||
railAxisLimits = KinUtils_GetAxisLimits(railAxisName)
|
||||
calc.ChildCalculators.append(RailRoboticDataCalculator(railAxisName, railAxisPos, railAxisDir, railAxisLimits))
|
||||
elif addAll:
|
||||
calc.ChildCalculators.append(RailRoboticDataCalculator(railAxisName, NXOpen.Vector3d(1.0,0.0,0.0), NXOpen.Vector3d(1.0,0.0,0.0), (0.0,1.0)))
|
||||
|
||||
if KinUtils_HasAxis(railAxisName2):
|
||||
railAxisDir = KinUtils_GetAxisDirection(railAxisName2)
|
||||
railAxisPos = KinUtils_GetPointOnAxis(railAxisName2)
|
||||
railAxisLimits = KinUtils_GetAxisLimits(railAxisName2)
|
||||
calc.ChildCalculators.append(RailRoboticDataCalculator2(railAxisName2, railAxisPos, railAxisDir, railAxisLimits))
|
||||
elif addAll:
|
||||
calc.ChildCalculators.append(RailRoboticDataCalculator2(railAxisName2, NXOpen.Vector3d(1.0,0.0,0.0), NXOpen.Vector3d(1.0,0.0,0.0), (0.0,1.0)))
|
||||
|
||||
if addAll:
|
||||
# add the calculators that exist only to write CDL file text
|
||||
calc.ChildCalculators.append(RobotZonesDefineUdeCalculator())
|
||||
calc.ChildCalculators.append(OlpCommandDefineUdeCalculator())
|
||||
calc.ChildCalculators.append(OlpCommandMultiLineDefineUdeCalculator(10))
|
||||
calc.ChildCalculators.append(PayloadDataDefineUdeCalculator())
|
||||
calc.ChildCalculators.append(ToolPathOlpCommandsDefineUdeCalculator())
|
||||
calc.ChildCalculators.append(RobotMountComponentDefineUdeCalculator())
|
||||
|
||||
|
||||
return (calc, externalAxes)
|
||||
|
||||
# Uncomment this function to implement your own main function
|
||||
# The function should parse the argument list and return with true if it
|
||||
# handled the call. If it returns false the caller will try to parse the arguments.
|
||||
# def RoboticRulesScript_Main2(args):
|
||||
# NXOpen.Session.GetSession().LogFile.WriteLine("Main called")
|
||||
# return True
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
1125
machine/installed_machines/STAUBLI_RX160-HB/robots/Robotics.cdl
Normal file
1125
machine/installed_machines/STAUBLI_RX160-HB/robots/Robotics.cdl
Normal file
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,63 @@
|
||||
react_on_speed_excess recalc;
|
||||
joint_vel_prof rot max_acc_prof;
|
||||
joints_coordination end_together;
|
||||
default_control_type control_by_speed;
|
||||
default_control_parm 1500.0;
|
||||
single_joint_prof no_single_prof;
|
||||
cart_speed_to_jnt_cnvrt by_lim_jnt;
|
||||
speed_lim_jnt 1500.0;
|
||||
cart_vel_prof max_acc_prof;
|
||||
use_config dont_use;
|
||||
config_family cf_over_head_pos;
|
||||
joint_config_family j3 joint_cf_elbow_up;
|
||||
joint_config_family j5 joint_cf_pos;
|
||||
gen_config_change no_config_change;
|
||||
joint_config_change j3 no_config_change;
|
||||
joint_config_change j5 no_config_change;
|
||||
j_motion_use_config use;
|
||||
jm_dest_config use_origin_config;
|
||||
cart_basic_lin_speed 1500.00;
|
||||
cart_max_lin_speed 1500.00;
|
||||
joint_max_speed j1 4.119;
|
||||
joint_basic_speed j1 4.119;
|
||||
joint_max_acc j1 6.213;
|
||||
joint_basic_acc j1 6.213;
|
||||
joint_max_dec j1 6.213;
|
||||
joint_basic_dec j1 6.213;
|
||||
joint_max_speed j2 3.491;
|
||||
joint_basic_speed j2 3.491;
|
||||
joint_max_acc j2 6.213;
|
||||
joint_basic_acc j2 6.213;
|
||||
joint_max_dec j2 6.213;
|
||||
joint_basic_dec j2 6.213;
|
||||
joint_basic_speed j3 4.992;
|
||||
joint_max_speed j3 4.992;
|
||||
joint_max_acc j3 5.166;
|
||||
joint_basic_acc j3 5.166;
|
||||
joint_max_dec j3 5.166;
|
||||
joint_basic_dec j3 5.166;
|
||||
joint_max_speed j4 6.999;
|
||||
joint_basic_speed j4 6.999;
|
||||
joint_max_acc j4 7.138;
|
||||
joint_basic_acc j4 7.138;
|
||||
joint_max_dec j4 7.138;
|
||||
joint_basic_dec j4 7.138;
|
||||
joint_max_speed j5 5.585;
|
||||
joint_basic_speed j5 5.585;
|
||||
joint_max_acc j5 8.377;
|
||||
joint_basic_acc j5 8.377;
|
||||
joint_max_dec j5 8.377;
|
||||
joint_basic_dec j5 8.377;
|
||||
joint_max_speed j6 10.123;
|
||||
joint_basic_speed j6 10.123;
|
||||
joint_max_acc j6 19.635;
|
||||
joint_basic_acc j6 19.635;
|
||||
joint_max_dec j6 19.635;
|
||||
joint_basic_dec j6 19.635;
|
||||
|
||||
* test zones
|
||||
zone_define fine no_smooth;
|
||||
zone_define zcl10r15 dist cartesian 12;
|
||||
zone_define zjl15r20 dist cartesian 17;
|
||||
zone_define zcl20r30 dist cartesian 25;
|
||||
|
||||
Reference in New Issue
Block a user