Hi Michele,This is a wonderful contribtion.I understand that pyrapid is not only a parser ( unit testing RAPID code, huzaah! ) but also a python generator from RAPID code.The file "rapid2py.py" hints at that but also the "Palletizer" directory.When viewing the Palletizer/maintask.mod hints at this:MODULE MAINTASK!python rapid2py.py -i Pallettizer/schema.mod -s -f schema.py!python rapid2py.py -e MAIN -i Pallettizer/settings.mod -i Pallettizer/gloadschema.mod -i Pallettizer/schema.mod -i Pallettizer/maintask.mod -f pallettizer.py -rWhen running the "python rapid2py.py -i Pallettizer/schema.mod -s -f schema.py" command, I can generate a schem.py in the run directory.However, when running the 2nd command, "python rapid2py.py -e MAIN -i Pallettizer/settings.mod -i Pallettizer/gloadschema.mod -i Pallettizer/schema.mod -i Pallettizer/maintask.mod -f pallettizer.py -r", I do get the following error:$ python rapid2py.py -e MAIN -i Pallettizer/settings.mod -i Pallettizer/gloadschema.mod -i Pallettizer/schema.mod -i Pallettizer/maintask.mod -f pallettizer.py -rPARSING: ./default/standard.sysTraceback (most recent call last):File "rapid2py.py", line 1368, in <module>attriblist += parser.parse(text, fname, debuglevel=0).module_listFile "/Users/jelleferinga/GIT/pyrapidparser/rapid_parser.py", line 105, in parsereturn self.rapidparser.parse(text, lexer=self.rapidlex, debug=debuglevel)File "/Users/jelleferinga/miniconda/lib/python2.7/site-packages/ply/yacc.py", line 265, in parsereturn self.parseopt_notrack(input,lexer,debug,tracking,tokenfunc)File "/Users/jelleferinga/miniconda/lib/python2.7/site-packages/ply/yacc.py", line 1047, in parseopt_notracktok = self.errorfunc(errtoken)File "/Users/jelleferinga/GIT/pyrapidparser/rapid_parser.py", line 1443, in p_errorself._coord(p.lineno))File "/Users/jelleferinga/GIT/pyrapidparser/plyparser.py", line 54, in _parse_errorraise ParseError("%s: %s" % (coord, msg))plyparser.ParseError: ./default/standard.sys:1: before: "0" near charapter 1I'll try to look into this.To be frank, I've had a failed attempt at doing the *exact* *same* thing ( writing a RAPID parser in ply / python ), so this is much appreciated.
For now you can test syntax but also logic of your rapid code without use any abb robot or abb simulator.
That's great.Could you provide a bit of context for this project?My guess would be that pyrapid was used for testing RAPID code?( to provide some background: testing RAPID code is basically running a simulation in RobotStudio, so really, the concept of unit testing robot code even in a sophisticated offline software as RobotStudio really doesnt exist )Michele, I have a question: what would it take for pyrapid to become round trip?By that I meanpython rapid2py.py some.mod | py2rapid.py some2.moddiff some.mod some2.mod | wc -w0Being able to generate RAPID code from python would be powerful.If that generated RAPID code is isomorph to the original RAPID code that the python code was generated from, well, that would be something ;)
for now you can execute your rapid code on any pc.If someone want, and have time, it is possible to integrade this with, for example, freeCAD and try to simulate also the robot move.
Hi I'm someone ;)So, I've been developing an offline robotics package in python, on top of PythonOCC ( freecad is built on top of OCC too, and can be used to extend FreeCAD's scripting capabilities ).So, the work-in-progress name for this software is PyRAPID too ;)I've been working with it in Italy too..., experimenting with cutting marble.