kobbled / tp_plus Goto Github PK
View Code? Open in Web Editor NEWFANUC TP abstraction
Home Page: http://github.com/kobbled/tp_plus
License: Apache License 2.0
FANUC TP abstraction
Home Page: http://github.com/kobbled/tp_plus
License: Apache License 2.0
e.g.:
local := R[50..90]
a = x1 * (y2 - y3) - y1 * (x2 - x3) + x2 * y3 - x3 * y2
b = (Mth::pow(x1, 2) + Mth::pow(y1, 2)) * (y3 - y2)
c = (Mth::pow(x1, 2) + Mth::pow(y1, 2)) * (x2 - x3)
d = (Mth::pow(x3, 2) + Mth::pow(y3, 2)) * (x2 * y1 - x1 * y2)
expands to this in LS:
: R[50:a]=(AR[1]*(AR[5]-AR[8])-AR[2]*(AR[4]-AR[7])+AR[4]*AR[8]-AR[7]*AR[5]) ;
: CALL MTH_POW(AR[1],2,57) ;
: CALL MTH_POW(AR[2],2,58) ;
: R[51:b]=((R[57:dvar1]+R[58:dvar2])*(AR[8]-AR[5])) ;
: CALL MTH_POW(AR[1],2,59) ;
: CALL MTH_POW(AR[2],2,60) ;
: R[52:c]=((R[59:dvar3]+R[60:dvar4])*(AR[4]-AR[7])) ;
: CALL MTH_POW(AR[7],2,61) ;
: CALL MTH_POW(AR[8],2,62) ;
: R[53:d]=((R[61:dvar5]+R[62:dvar6])*(AR[4]*AR[2]-AR[1]*AR[5])) ;
After the evaluation of b, the stack counter should be reset to 57. This can be achieved by doing $stack.push/$stack.pop before/after each expression expansion.
In trying to inline a member function within another member function, the namespace function does not recognize itself, or it other functions to check if it should inline the function call.
namespace ns
inline def func1()
# do work
return()
end
inline def func2()
#this function doesn't inline
func1()
return()
end
end
A namespace should have reference to self i.e.
inline def func2()
using self
func1()
end
self should be implicit for all functions using
scoping declaration
Add back in option to build a karel hash table from the environment file. see karel hash commit. This can be used in karel programs to return register addresses, and to make a program to reset comments.
The conversion of
if foo == 1 then
# do something
end
gives an ENDIF with two semicolons:
: IF (R[1:foo]=1) THEN ;
: ! do something ;
: ENDIF ; ;
That second semicolon gives an error when importing the file to Fanuc.
Found in section 7.28 of manual
I believe that there is some handling of motion modifiers but there are no examples of the syntax required. I specifically need to know how to add "MROT" to a joint move.
There is currently no way to tell if the return of a call statement in a expression is a posreg, or a numreg, due to handle_arg_funcs
in CallNode being evaluated during parsing, before the functions are evaluated, and the return type of a function is decided. Also the preprocessing of local variables is done before funtions.
# first pass
#---------
#set a list of declared positions into @pose_list
#populate_pose_set
#create definitions from ranges
traverse_nodes(@nodes, :preprocess_local_variables)
# second pass
#----------
#prepare/allocate functions
traverse_nodes(@nodes, :preprocess_functions)
This may have to be switched around in order for this issue to be resolved.
The option term(-1) should result in the FINE option activated in the LS-file, but it gives CNT(-1).
local := R[70..80]
def func2(val, exp) : numreg
return(Mth::exp(exp * Mth::ln(val)))
end
power := R[20]
power = ns1::func2(4, 2)
gives error:
indirect_node.rb:70:in `id': undefined method `value' for #<TPPlus::Nodes::ArgumentNode:0x000001f424c699f8 @id=3, @comment=:ret> (NoMethodError)
@target.value\r
tp+
def circleCenter3Points(x1,y1,z1,x2,y2,z2,x3,y3,z3) : numreg, numreg, numreg
a = x1 * (y2 - y3) - y1 * (x2 - x3) + x2 * y3 - x3 * y2
b = (Mth::pow(x1, 2) + Mth::pow(y1, 2)) * (y3 - y2)
c = (Mth::pow(x1, 2) + Mth::pow(y1, 2)) * (x2 - x3)
d = (Mth::pow(x3, 2) + Mth::pow(y3, 2)) * (x2 * y1 - x1 * y2)
x = -b / (a * 2)
y = -c / (a * 2)
z = (z1+z2+z3)/3
return(x, y, z)
end
center := R[30..33]
center = circleCenter3Points(X1,Y1,Z1,X2,Y2,Z3,X3,Y3,Z3)
LS would turn into
/MN
: CALL CIRCLECENTER3POINTS(X1,Y1,Z1,X2,Y2,Z3,X3,Y3,Z3,30,31,32) ;
/END
/MN
: R[50:a]=(AR[1]*(AR[5]-AR[8])-AR[2]*(AR[4]-AR[7])+AR[4]*AR[8]-AR[7]*AR[5]) ;
: CALL MTH_POW(AR[1],2,57) ;
: CALL MTH_POW(AR[2],2,58) ;
: R[51:b]=((R[57:dvar1]+R[58:dvar2])*(AR[8]-AR[5])) ;
: CALL MTH_POW(AR[1],2,59) ;
: CALL MTH_POW(AR[2],2,60) ;
: R[52:c]=((R[59:dvar3]+R[60:dvar4])*(AR[4]-AR[7])) ;
: CALL MTH_POW(AR[7],2,61) ;
: CALL MTH_POW(AR[8],2,62) ;
: R[53:d]=((R[61:dvar5]+R[62:dvar6])*(AR[4]*AR[2]-AR[1]*AR[5])) ;
: ;
: R[54:x]=(R[51:b]*(-1)/(R[50:a]*2)) ;
: R[55:y]=(R[52:c]*(-1)/(R[50:a]*2)) ;
: R[56:z]=((AR[3]+AR[6]+AR[9])/3) ;
: ! Multiple return ;
: R[AR[10]]=R[54:x] ;
: R[AR[11]]=R[55:y] ;
: R[AR[12]]=R[56:z] ;
/END
When using the indirect function inside the inlined function. The output PR has to be attached to the end of the function call and pointing to the PR number. See the example below.
Not working:
pr6 = correctFrame(&pr4, &pr5, Calib::Z)
-- > PR[PR[86]]=PR[61:dummy_pr1] ;
Working:
correctFrame(&pr4, &pr5, Calib::Z, &pr6)
-- > PR[86]=PR[61:dummy_pr1] ;
i.e.
foo((i+j), Mth::arcang(6, 50))
does not compile. TP does not support such functionality.
TP+ should support it, and interpret to:
: local := R[1..2];
: local1 = i + j ;
: Mth_arcang(6, 50, 2) ;
: CALL FOO(local1, local2);
make folder with example .tpp code for reference
TP+
local := R[50..70]
EPSILON := 0.001
x := LR[]
if (Mth::abs(x) > EPSILON)
#do stuff in here
x = Mth::abs(x)
end
The local register seems to use a different group configuration instead of the default. Here is an example.
import Tasks
#constents
GRIPPER_DEPTH := 75
PPC := 3 # points per circle
#variables
part_rad := LR[]
farCir_pos := LR[]
closeCir_pos := LR[]
part2tof_dist := LR[]
centers := LR[]
#end of variables
#user input:
# workpiece information
PART_DIA := 153
PART_LEN := 576
part_rad = PART_DIA/2
# far and close circles positions
FARCIR := 10 #mm wrt part edge
CLOSECIR := 10 #mm wrt gripper edge
#for approach target calculation
farCir_pos = PART_LEN - (GRIPPER_DEPTH + FARCIR)
closeCir_pos = farCir_pos - CLOSECIR
# robot pose approach
CLEARANCE := 0.03 # initial clearance between part and tof with respect to measure frame
TOFAPPROACH_ANGLE := 0 # with respect to tof measure frame
part2tof_dist = PART_DIA/2 + CLEARANCE
#end of user input
#preprocessing section
# getting robot ready
TP_GROUPMASK = "1,*,*,*,*"
TP_COMMENT = "3D tcp correction"
zero_pos := P[1]
default.group(1).pose -> [0, 0, 0, 0, 0 ,0]
default.group(1).config -> ['N', 'U', 'T', 0, 0, 0]
#safe_pos := PR[12]
#move to safe pose
#joint_move.to(safe_pos).at(30, '%').term(FINE)
# clear tool offset
Pos::clrpr(&tool_ofset)
#check safe pos
#G0_SAFE_POS()
#rotate J1 to 95 deg
#G1_ROTT_J1(95)
#G0_DOOR_OPEN()
dummypr1 = base_gripper
part_frame = dummypr1
# move into approach
use_uframe tcp_calib_frame
use_utool base_gripper
#end of perprocessing section
#approach tof
Tasks::appro_tof(TOFAPPROACH_ANGLE, part2tof_dist, farCir_pos)
For the tasks module, it contains a local posreg which should have (NUT) config but instead uses (NBU) config.
def appro_tof(tofApproach_angle, part2tof_dist, farCir)
# perform proper robot motion to approach the tof sensor, until surface is at zero with respect to
# the tof measure frame. This motion is only on the z-axis.
TP_GROUPMASK = "1,*,*,*,*"
#vars
pr1 := LPR[]
# building target approach pose for the first time only
# when correcting for the second time we use initial pose
#if not len(self.initCloseTrgt):
pr1 = Pos::setxyz(-1*part2tof_dist, 0, -1*farCir, tofApproach_angle, 0, 0)
#move to the target
joint_move.to(pr1).at(20, '%').term(FINE)
end
But it will work if we use and initialize global posreg as in this code:
def appro_tof(tofApproach_angle, part2tof_dist, farCir)
# perform proper robot motion to approach the tof sensor, until surface is at zero with respect to
# the tof measure frame. This motion is only on the z-axis.
TP_GROUPMASK = "1,*,*,*,*"
#vars
pr1 := P[60]
pr1.group(1).pose -> [0, 0, 0, 0, 0 ,0]
pr1.group(1).config -> ['N', 'U', 'T', 0, 0, 0]
# building target approach pose for the first time only
# when correcting for the second time we use initial pose
#if not len(self.initCloseTrgt):
pr1 = Pos::setxyz(-1*part2tof_dist, 0, -1*farCir, tofApproach_angle, 0, 0)
#move to the target
joint_move.to(pr1).at(20, '%').term(FINE)
end
TP+
pos := P[1]
linear_move.to(pos).at(100, 'mm/s').term(-1)
LS
/MN
: ;
: L P[1:pos] 100mm/sec FINE ;
/POS
P[1:"pos"]{
};
/END
vision registers -> VR[]
VOFFSET CONDITION VR[1]
L P[1] 50mm/sec CNT100 VOFFSET
The following code will not work:
pos.indirect('r',&numreg)
it is supposed to look like this:
PR[i,R[1]]
Errors are currently posted as TPPlus::Parser::ParseError: Parse error on line 2 column 6: "inc" (INC)
for example. This does not give an indication that this is a keyword, and should not be used.
currently you have to use IFTHEN, or force a code block by adding a comment into the if blocks.
Independent motion
linear_move.to(p1).at(100, 'mm/s').term(100).independent(group(1))
joint_move.to(p1).at(100, '%').term(50).independent(group(3))
Independent GP
GP1 L P[1] 50mm/s CNT100
GP3 J P[1] 100% CNT50
simultaneous motion
linear_move.to(p1).at(90, 'mm/s').term(100).simultaneous(group(1))
joint_move.to(p1).at(100, '%').term(50).simultaneous(group(3))
Simultaneous GP
GP1 L P[1] 90mm/s CNT100
GP3 J P[1] 100% CNT50
While building the parser
Calling `DidYouMean::SPELL_CHECKERS.merge!(error_name => spell_checker)' has been deprecated. Please call `DidYouMean.correct_error(error_name, spell_checker)' instead.
Calling `DidYouMean::SPELL_CHECKERS.merge!(error_name => spell_checker)' has been deprecated. Please call `DidYouMean.correct_error(error_name, spell_checker)' instead.
racc -l -t -v -o lib/tp_plus/parser.rb generators/parser.y
Calling `DidYouMean::SPELL_CHECKERS.merge!(error_name => spell_checker)' has been deprecated. Please call `DidYouMean.correct_error(error_name, spell_checker)' instead.
1 useless nonterminals
2 useless rules
32 shift/reduce conflicts
3 reduce/reduce conflicts
C:/Ruby31-x64/bin/ruby.exe -w -I"lib;test" -I"C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/rake-12.3.3/lib" "C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/rake-12.3.3/lib/rake/rake_test_loader.rb" "test/test_helper.rb" "test/tp_plus/test_interpreter.rb" "test/tp_plus/test_parser.rb" "test/tp_plus/test_scanner.rb"
C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/bundler-2.1.4/lib/bundler/vendor/thor/lib/thor/error.rb:105: warning: constant DidYouMean::SPELL_CHECKERS is deprecated
Calling `DidYouMean::SPELL_CHECKERS.merge!(error_name => spell_checker)' has been deprecated. Please call `DidYouMean.correct_error(error_name, spell_checker)' instead.
tp_plus/lib/tp_plus/motion/pose_templates.rb:84: warning: mismatched indentations at 'end' with 'module' at 1
File does not exist: matrix
rake aborted!
Command failed with status (1): [ruby -w -I"lib;test" -I"C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/rake-12.3.3/lib" "C:/Ruby31-x64/lib/ruby/gems/3.1.0/gems/rake-12.3.3/lib/rake/rake_test_loader.rb" "test/test_helper.rb" "test/tp_plus/test_interpreter.rb" "test/tp_plus/test_parser.rb" "test/tp_plus/test_scanner.rb" ]
Tasks: TOP => default => test
(See full trace by running task with --trace)
and while interpreting
tp_plus/lib/tp_plus/motion/pose_factory.rb:449: warning: Passing safe_level with the 2nd argument of ERB.new is deprecated. Do not use it, and specify other arguments as keyword arguments.
tp_plus/lib/tp_plus/motion/pose_factory.rb:449: warning: Passing trim_mode with the 3rd argument of ERB.new is deprecated. Use keyword argument like ERB.new(str, trim_mode: ...) instead.
add functionality to import other files with
using math, system, etc...
could use gpp preprocessor similar to ktransw for full preprocessor directives
When more than one call of an inlined function exists in the same file, the tpp will throw an error when compiling as follows.
FAILED: C:/Users/HamdanAl-Musaibeli/workhub/myhub/sensing_tpp/build/G1_UFRAME_CALIBRATE.ls
"C:\Users\HamdanAl-Musaibeli\workhub\shrdhub\pub\tp_plus\bin\tpp.bat" C:\Users\HamdanAl-Musaibeli\workhub\myhub\sensing_tpp\src\G1_UFRAME_CALIBRATE.tpp -o C:\Users\HamdanAl-Musaibeli\workhub\myhub\sensing_tpp\build\G1_UFRAME_CALIBRATE.ls -e "C:\Users\HamdanAl-Musaibeli\workhub\myhub\sensing_tpp\temp\env2.tpp" /I"C:\Users\HamdanAl-Musaibeli\workhub\myhub\sensing_tpp\include"
default position not set! May give unintended results! Check position data before running!
C:/Users/HamdanAl-Musaibeli/workhub/shrdhub/pub/tp_plus/lib/tp_plus/function.rb:172:in `block in preinline': undefined method `identifier' for #<TPPlus::Nodes::DigitNode:0x000001ca6c88d668 @value=3, @name=""> (NoMethodError)
map[v.identifier] = map[k]
^^^^^^^^^^^
from C:/Users/HamdanAl-Musaibeli/workhub/shrdhub/pub/tp_plus/lib/tp_plus/function.rb:167:in `each'
from C:/Users/HamdanAl-Musaibeli/workhub/shrdhub/pub/tp_plus/lib/tp_plus/function.rb:167:in `preinline'
from C:/Users/HamdanAl-Musaibeli/workhub/shrdhub/pub/tp_plus/lib/tp_plus/nodes/call_node.rb:159:in `eval'
from C:/Users/HamdanAl-Musaibeli/workhub/shrdhub/pub/tp_plus/lib/tp_plus/nodes/conditional_node.rb:56:in `block in string_for'
from C:/Users/HamdanAl-Musaibeli/workhub/shrdhub/pub/tp_plus/lib/tp_plus/nodes/conditional_node.rb:56:in `each'
from C:/Users/HamdanAl-Musaibeli/workhub/shrdhub/pub/tp_plus/lib/tp_plus/nodes/conditional_node.rb:56:in `inject'
from C:/Users/HamdanAl-Musaibeli/workhub/shrdhub/pub/tp_plus/lib/tp_plus/nodes/conditional_node.rb:56:in `string_for'
from C:/Users/HamdanAl-Musaibeli/workhub/shrdhub/pub/tp_plus/lib/tp_plus/nodes/conditional_node.rb:22:in `true_block'
from C:/Users/HamdanAl-Musaibeli/workhub/shrdhub/pub/tp_plus/lib/tp_plus/nodes/conditional_node.rb:89:in `eval'
from C:/Users/HamdanAl-Musaibeli/workhub/shrdhub/pub/tp_plus/lib/tp_plus/nodes/conditional_node.rb:56:in `block in string_for'
from C:/Users/HamdanAl-Musaibeli/workhub/shrdhub/pub/tp_plus/lib/tp_plus/nodes/conditional_node.rb:56:in `each'
from C:/Users/HamdanAl-Musaibeli/workhub/shrdhub/pub/tp_plus/lib/tp_plus/nodes/conditional_node.rb:56:in `inject'
from C:/Users/HamdanAl-Musaibeli/workhub/shrdhub/pub/tp_plus/lib/tp_plus/nodes/conditional_node.rb:56:in `string_for'
from C:/Users/HamdanAl-Musaibeli/workhub/shrdhub/pub/tp_plus/lib/tp_plus/nodes/conditional_node.rb:38:in `false_block'
from C:/Users/HamdanAl-Musaibeli/workhub/shrdhub/pub/tp_plus/lib/tp_plus/nodes/conditional_node.rb:98:in `eval'
from C:/Users/HamdanAl-Musaibeli/workhub/shrdhub/pub/tp_plus/lib/tp_plus/interpreter.rb:406:in `block in eval'
from C:/Users/HamdanAl-Musaibeli/workhub/shrdhub/pub/tp_plus/lib/tp_plus/interpreter.rb:399:in `each'
from C:/Users/HamdanAl-Musaibeli/workhub/shrdhub/pub/tp_plus/lib/tp_plus/interpreter.rb:399:in `eval'
from C:/Users/HamdanAl-Musaibeli/workhub/shrdhub/pub/tp_plus/bin/tpp:192:in `<main>'
ninja: build stopped: subcommand failed.
p2.group(1).xyz.offset -> [0,0,10]
Use to offset from the previous positionp2 = p1
p1..p3.group(1).xyz -> [10,0,100]
p6..p10 = p1..p5.reverse
copy positions into next set in reverse ordertranslate.group(1).pose(0,0,100,0,0,0)
related to #23
need functionality for imports to work
namespace idhead
SLOPE := -0.7457
INTERCEPT := 41.537
OFFSET := -0.4
end
def frame_offset(frame, standoff)
frame.x += (idhead::SLOPE*standoff + idhead::INTERCEPT)+idhead::OFFSET
end
In Fanuc's TP it is possible to call a program like this:
CALL PROG(1, 2, (-1))
In tp_plus, the parser throws an error on the minus sign:
Parse error on line 27 column 32: "" (MINUS) (TPPlus::Parser::ParseError)
Calling members from the same namespace and trying to inline them does not work:
TP+
local := R[50..80]
namespace Calc
inline def normalizeVector(n1,n2,n3,e1,e2,e3)
norm := LR[]
norm = Mth::SQRT(n1*n1 + n2*n2 + n3*n3)
indirect('r', e1) = n1/norm
indirect('r', e2) = n2/norm
indirect('r', e3) = n3/norm
end
inline def dot(nx,ny,nz,vx,vy,vz,d)
indirect('r', d) = nx*vx + ny*vy + nz*vz
end
inline def intersect(x1,y1,z1,x2,y2,z2,nx,ny,nz)
ux := LR[]
uy := LR[]
uz := LR[]
vx := LR[]
vy := LR[]
vz := LR[]
d := LR[]
# vector from two points
vx=x2-x1
vy=y2-y1
vz=z2-z1
Calc::normalizeVector(vx,vy,vz,&ux,&uy,&uz) # unit vector
d = Calc::dot(nx,ny,nz,ux,uy,uz) # dot product
end
end
X1 := -0.30694321232747335
Y1 := 1.6723049456001353
Z1 := 1.432745154010752
X2 := -0.7868785787889008
Y2 := 1.7975569490378929
Z2 := 1.44473503116485
CX := -0.23966969549655914
CY := 1.6529096364974976
CZ := 1.438263177871704
Calc::intersect(X1,Y1,Z1,X2,Y2,Z2,CX,CY,CZ)
add shared register stack in along side the local stack.
We use the singularity avoidance option most of the time, therefore it is needed to include the following statement in the LS-file's header:
/APPL
AUTO_SINGULARITY_HEADER;
ENABLE_SINGULARITY_AVOIDANCE : TRUE;
This should be between the DEFAULT_GROUP and the /MN line. I think it would be useful if we could set or unset this option from the tpp file.
I have solved it for now by adding the lines manually in the bin\tpp file, so there is no need for hurry.
Create dockerfile. Apparently ruby3 has issues in a docker container. Possibly downgrade back to ruby2, or branch until issue is resolved.
export each function as a different ls file with function name, except for the main function, export that as the program name.
Map the path defined in the .tpp file to catch errors before running on an actual robot. Visualize path for the user. Catch singularities, and limit errors.
Packages that might be useful:
https://github.com/icsl-Jeon/traj_gen
https://github.com/mahmoud-a-ali/scurve_traj_generation
-positions are ignoring uframe, and utool sets.
-default positions are not being saved
TP+
x := LR[]
x = 24
x = SQRT[x]
conversion example
# MAIN
inline def arclength(angle, radius) : numreg
return(angle*radius*M_PI/180)
end
length := R[1]
length2 := R[2]
length3 := R[3]
radius := R[4]
angle := R[5]
length = arclength(90, 100)
length2 = arclength(180, 50)
length3 = arclength(angle, radius)
: ! MAIN ;
: R[1:length]=(90*100*3.14159/180) ;
: R[2:length2]=(180*50*3.14159/180) ;
: R[3:length3]=(R[5:angle]*R[4:radius]*3.14159/180) ;
: END ;
Would have to convert argument registers to the actual parent call input arguments. It would also have to interpret returns to map them to the set output registers.
utilize a block of designated registers and position registers to use as local variables in functions, that get released once out of scope.
Hi Matt,
I've got some issues with the case statement. It seems that the 'else' statement is mandatory, since it throws an error there is no else case.
case SubProgram
when 1
# case 1
when 2
# case 2
end
Error:
Traceback (most recent call last):
7: from C:/Users/d.vandodeweerd/tp_plus/bin/tpp:66:in `<main>'
6: from C:/Users/d.vandodeweerd/tp_plus/lib/tp_plus/interpreter.rb:121:in `list_warnings'
5: from C:/Users/d.vandodeweerd/tp_plus/lib/tp_plus/interpreter.rb:89:in `find_warnings'
4: from C:/Users/d.vandodeweerd/tp_plus/lib/tp_plus/interpreter.rb:89:in `each'
3: from C:/Users/d.vandodeweerd/tp_plus/lib/tp_plus/interpreter.rb:93:in `block in find_warnings'
2: from C:/Users/d.vandodeweerd/tp_plus/lib/tp_plus/interpreter.rb:103:in `find_warnings'
1: from C:/Users/d.vandodeweerd/tp_plus/lib/tp_plus/interpreter.rb:103:in `each'
C:/Users/d.vandodeweerd/tp_plus/lib/tp_plus/interpreter.rb:104:in `block in find_warnings': undefined method `get_block' for nil:NilClass (NoMethodError)
Second issue: when I use the case statement inside a function, I get an error too:
def test()
case SubProgram
when 1
# case 1
when 2
# case 2
else
# else
end
end
Error:
Traceback (most recent call last):
12: from C:/Users/d.vandodeweerd/tp_plus/bin/tpp:103:in `<main>'
11: from C:/Users/d.vandodeweerd/tp_plus/lib/tp_plus/interpreter.rb:135:in `output_functions'
10: from C:/Users/d.vandodeweerd/tp_plus/lib/tp_plus/interpreter.rb:135:in `each'
9: from C:/Users/d.vandodeweerd/tp_plus/lib/tp_plus/interpreter.rb:136:in `block in output_functions'
8: from C:/Users/d.vandodeweerd/tp_plus/lib/tp_plus/function.rb:77:in `output_program'
7: from C:/Users/d.vandodeweerd/tp_plus/lib/tp_plus/interpreter.rb:200:in `eval'
6: from C:/Users/d.vandodeweerd/tp_plus/lib/tp_plus/interpreter.rb:200:in `each'
5: from C:/Users/d.vandodeweerd/tp_plus/lib/tp_plus/interpreter.rb:204:in `block in eval'
4: from C:/Users/d.vandodeweerd/tp_plus/lib/tp_plus/nodes/case_node.rb:79:in `eval'
3: from C:/Users/d.vandodeweerd/tp_plus/lib/tp_plus/nodes/case_node.rb:26:in `first_cond_statement'
2: from C:/Users/d.vandodeweerd/tp_plus/lib/tp_plus/nodes/case_condition_node.rb:39:in `eval'
1: from C:/Users/d.vandodeweerd/tp_plus/lib/tp_plus/nodes/case_condition_node.rb:26:in `is_jump_label'
C:/Users/d.vandodeweerd/tp_plus/lib/tp_plus/nodes/jump_node.rb:17:in `eval': Label (caselbl1) not found (RuntimeError)
6: from C:/Users/d.vandodeweerd/tp_plus/bin/tpp:103:in `<main>'
5: from C:/Users/d.vandodeweerd/tp_plus/lib/tp_plus/interpreter.rb:135:in `output_functions'
4: from C:/Users/d.vandodeweerd/tp_plus/lib/tp_plus/interpreter.rb:135:in `each'
3: from C:/Users/d.vandodeweerd/tp_plus/lib/tp_plus/interpreter.rb:136:in `block in output_functions'
2: from C:/Users/d.vandodeweerd/tp_plus/lib/tp_plus/function.rb:77:in `output_program'
1: from C:/Users/d.vandodeweerd/tp_plus/lib/tp_plus/interpreter.rb:192:in `eval'
C:/Users/d.vandodeweerd/tp_plus/lib/tp_plus/interpreter.rb:219:in `rescue in eval': Runtime error on line 1: (RuntimeError)
These issues are not very urgent, because I can work around them, it is just to let you know.
Kind regards,
Dick
Replace old json data
but parse into pose_factory.rb for error checking and saving state
position_data {
P[1:"p1"]{
GP1:
UF : 3, UT : 5, CONFIG : 'F U T, 0, 0, 0',
X = 0.000 mm, Y = 50.000 mm, Z = 0.000 mm,
W = 0.000 deg, P = 0.000 deg, R = 0.000 deg
GP2:
UF : 3, UT : 5,
J1 = 0.000 deg,
J2 = 0.000 deg
GP3:
UF : 3, UT : 5,
J1 = 500.000 mm
};
P[2:"p2"]{
GP1:
UF : 3, UT : 5, CONFIG : 'F U T, 0, 0, 0',
X = 0.000 mm, Y = 50.000 mm, Z = 100.000 mm,
W = 90.000 deg, P = 0.000 deg, R = -90.000 deg
GP2:
UF : 3, UT : 5,
J1 = 90.000 deg,
J2 = 0.000 deg
GP3:
UF : 3, UT : 5,
J1 = 500.000 mm
};
}
end
Section 7.3 of Handling Tool Manual
-Corner Region Termination (CRy)
-Corner Distance (CDy)
-Approach Linear Distance (AP_LDx)
-Retract Linear Distance (RT_LDx)
-Process Speed (PSPDx)
-Continuous Rotation Velocity (CTVx)
-Simultaneous Extended Axis Velocity (EVx%)
-Independent Extended Axis Velocity (Ind.EVx%)
-Remote TCP motion (RTCP)
-Search Motion Option (Search [ ])
-Distance Before (DB xmm, prog)
-'POINT LOGIC' for use in TA,TB,DB statements
TP+
a = (X1 * (Y2 - Y3)) - (Y1 * (X2 - X3)) + (X2 * Y3) - (X3 * Y2)
giving this:
LS
: R[295:a]=((-2.52127529e-06)*(-0.04156384)-(-0.03740988)-(0.0716490895*(0.071994-(-0.06479058)))+(0.071994*(-0.03740988))-(-0.06479058)*(-0.04156384)) ;
variables in an environment file do not have scope into functions.
Environmental file:
reg1 := R[1]
Function declaration:
def foo()
reg1 = 1
end
Results in this error:
C:/Users/184/TP-plus/tp_plus/lib/tp_plus/interpreter.rb:214:in `rescue in eval': Runtime error on line 1: (RuntimeError)
Variable (reg1) not defined
from C:/Users/184/TP-plus/tp_plus/lib/tp_plus/interpreter.rb:177:in `eval'
from C:/Users/184/TP-plus/tp_plus/lib/tp_plus/function.rb:165:in `output_program'
from C:/Users/184/TP-plus/tp_plus/lib/tp_plus/interpreter.rb:121:in `block in output_functions'
from C:/Users/184/TP-plus/tp_plus/lib/tp_plus/interpreter.rb:120:in `each'
from C:/Users/184/TP-plus/tp_plus/lib/tp_plus/interpreter.rb:120:in `output_functions'
from C:/Users/184/TP-plus/tp_plus/bin/tpp:128:in `<main>'
C:/Users/184/TP-plus/tp_plus/lib/tp_plus/base_block.rb:123:in `get_var': Variable (reg1) not defined (RuntimeError)
from C:/Users/184/TP-plus/tp_plus/lib/tp_plus/nodes/var_node.rb:10:in `target_node'
from C:/Users/184/TP-plus/tp_plus/lib/tp_plus/nodes/var_node.rb:35:in `eval'
from C:/Users/184/TP-plus/tp_plus/lib/tp_plus/nodes/assignment_node.rb:44:in `identifier_string'
from C:/Users/184/TP-plus/tp_plus/lib/tp_plus/nodes/assignment_node.rb:55:in `eval'
from C:/Users/184/TP-plus/tp_plus/lib/tp_plus/interpreter.rb:199:in `block in eval'
from C:/Users/184/TP-plus/tp_plus/lib/tp_plus/interpreter.rb:195:in `each'
from C:/Users/184/TP-plus/tp_plus/lib/tp_plus/interpreter.rb:195:in `eval'
from C:/Users/184/TP-plus/tp_plus/lib/tp_plus/function.rb:165:in `output_program'
from C:/Users/184/TP-plus/tp_plus/lib/tp_plus/interpreter.rb:121:in `block in output_functions'
from C:/Users/184/TP-plus/tp_plus/lib/tp_plus/interpreter.rb:120:in `each'
from C:/Users/184/TP-plus/tp_plus/lib/tp_plus/interpreter.rb:120:in `output_functions'
from C:/Users/184/TP-plus/tp_plus/bin/tpp:128:in `<main>'
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.