CN109352645A - A kind of easy programming method and device applied to robot teaching - Google Patents

A kind of easy programming method and device applied to robot teaching Download PDF

Info

Publication number
CN109352645A
CN109352645A CN201811143880.2A CN201811143880A CN109352645A CN 109352645 A CN109352645 A CN 109352645A CN 201811143880 A CN201811143880 A CN 201811143880A CN 109352645 A CN109352645 A CN 109352645A
Authority
CN
China
Prior art keywords
program
language
interpreter
robot teaching
primary
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201811143880.2A
Other languages
Chinese (zh)
Inventor
毛明
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Kuche Education Technology Co Ltd
Original Assignee
Kuche Education Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Kuche Education Technology Co Ltd filed Critical Kuche Education Technology Co Ltd
Priority to CN201811143880.2A priority Critical patent/CN109352645A/en
Publication of CN109352645A publication Critical patent/CN109352645A/en
Pending legal-status Critical Current

Links

Classifications

    • BPERFORMING OPERATIONS; TRANSPORTING
    • B25HAND TOOLS; PORTABLE POWER-DRIVEN TOOLS; MANIPULATORS
    • B25JMANIPULATORS; CHAMBERS PROVIDED WITH MANIPULATION DEVICES
    • B25J9/00Programme-controlled manipulators
    • B25J9/16Programme controls
    • B25J9/1656Programme controls characterised by programming, planning systems for manipulators
    • B25J9/1658Programme controls characterised by programming, planning systems for manipulators characterised by programming language
    • BPERFORMING OPERATIONS; TRANSPORTING
    • B25HAND TOOLS; PORTABLE POWER-DRIVEN TOOLS; MANIPULATORS
    • B25JMANIPULATORS; CHAMBERS PROVIDED WITH MANIPULATION DEVICES
    • B25J9/00Programme-controlled manipulators
    • B25J9/16Programme controls
    • B25J9/1602Programme controls characterised by the control system, structure, architecture
    • B25J9/161Hardware, e.g. neural networks, fuzzy logic, interfaces, processor

Abstract

The present invention relates to a kind of easy programming method and devices applied to robot teaching, and method includes: S1: writing language Transformation Program and be arranged in development board;S2: student writes the primary program of scripting language class according to instructional objective;S3: primary program is resolved to that the side program of formula equipment can be embedded into through language Transformation Program;S4: built-in equipment operation side program.Wherein, primary program and side program use different types of programming language.The present invention allows user only to need to write simple script formula control statement by the interpreter run in embedded device, and interpreter will automatically parse the language that can be performed for embedded device, and then control the control logic that hardware executes user.There is no need to use high-level language to configure embedded device by user in this way.The programming mode of user in this way can quickly be familiar with the logic of programming, learn the thinking of programming, be familiar with hardware, lay the foundation for subsequent study in depth.

Description

A kind of easy programming method and device applied to robot teaching
Technical field
The present invention relates to robot teaching field, especially a kind of easy programming method and dress applied to robot teaching It sets.
Background technique
Robot teaching refers to by assembling, building, running robot, excites students ' interest of study;Programming, machine are merged Each subject knowledge such as tool, electronics, physics promotes the integration capability of student especially teenager student.Robot, which has become, exhales The very high creative teaching platform of sound, and basic education is moved towards in big strides.Educational robot has been in step at home Section, with the rapid construction in various regions robot of middle and primary schools laboratory, it is also more invented as course, some jejune performances It is aobvious, and all various restrictions are encountered, existing robot teaching is much all based on patterned programming mode, but few Hardware, that is, the embedded board of robot are related to, this makes the software and hardware of robot teaching disconnect.A small number of mechanisms It will use embedded hardware development board, but these development boards are not programming that difficulty higher position is to be not suitable for subsequent deep It practises.
Summary of the invention
The present invention in view of the above-mentioned problems of the prior art, provide a kind of couple of teenager student study it is more friendly, on Hand faster, while can also help the easy programming method and apparatus of student's study hardware knowledge.
A kind of easy programming method applied to robot teaching, including the following contents:
S1: it writes language Transformation Program and is arranged in development board;
S2: student writes the primary program of scripting language class according to instructional objective;
S3: primary program is resolved to that the side program of formula equipment can be embedded into through language Transformation Program;
S4: built-in equipment operation side program;
Wherein, primary program and side program use different types of programming language.
Further, language Transformation Program is interpreter.
Further, in S3, interpreter carries out grammer detection to primary program before parsing, syntactically correct when detecting When, interpreter parses primary program.
Further, interpreter parses the code in primary program one by one.
Further, in S3, interpreter is run the following steps are included: morphological analysis, syntactic analysis, semantic analysis, explanation For side program.
Further, in morphological analysis step, process needs the keyword of Division identification logic control sentence.
Further, language opposing primary program used by side program is more advanced.
Further, the language that side program uses for it is below any one: Java, C, C++, Visual Basic, PHP、Perl、Python、C#、JavaScript、Delphi、SAS、Ruby、PL/SQL、D、ABAP、Lisp/Scheme、 COBOL、Ada、Pascal、Visual FoxPro。
A kind of easy programming device applied to robot teaching, comprising:
Primary program input terminal inputs primary program for student;
It is provided with the development board of interpreter, is side program for receiving and parsing through primary program;
Embedded device, for carrying out corresponding actions according to side program.
Further, development board end is communicated to connect by way of wire/wireless with primary program input terminal.
The present invention allows user only to need by the scheme of the interpreter of Run Script formula programming language in embedded device Simple script formula control statement is write, the interpreter built in development board can automatically parse the language that can be performed for embedded device Speech, and then control the control logic that hardware executes user.There is no need to use high-level language to configure embedded device by user in this way. The programming mode of user in this way can quickly be familiar with the logic of programming, learn the thinking of programming, be familiar with hardware, be subsequent Study in depth and lay the foundation.In addition, running interpreter on embedded board, it is flat also to can solve programming to a certain extent The concurrent problem of the compiling of platform.
Detailed description of the invention
In order to more clearly explain the embodiment of the invention or the technical proposal in the existing technology, to embodiment or will show below There is attached drawing needed in technical description to be briefly described, it should be apparent that, the accompanying drawings in the following description is only this Some embodiments of invention for those of ordinary skill in the art without creative efforts, can be with It obtains other drawings based on these drawings.
Fig. 1 is overall flow figure of the invention;
Fig. 2 is interpreter process of analysis figure.
Specific embodiment
To make the object, technical solutions and advantages of the present invention clearer, technical solution of the present invention will be carried out below Detailed description.Obviously, described embodiments are only a part of the embodiments of the present invention, instead of all the embodiments.Base Embodiment in the present invention, those of ordinary skill in the art are obtained all without making creative work Other embodiment belongs to the range that the present invention is protected.
A kind of easy programming method applied to robot teaching, including the following contents:
S1: it writes language Transformation Program and is arranged in development board;
S2: student writes the primary program of scripting language class according to instructional objective;
S3: primary program is resolved to that the side program of formula equipment can be embedded into through language Transformation Program;
S4: built-in equipment operation side program;
Wherein, primary program and side program use different types of programming language.
In some embodiments of the invention, language Transformation Program is interpreter.Interpreter (Interpreter), and translate For Command Interpreter, essence is a kind of program, a kind of program of language can be aimed at according to design requirement as another language.It explains Device once will not translate out entire program, but will first change into another language when each run program and remake operation, Therefore the program operation speed of interpreter is slower.Its every translation a line procedure statement is just run at once, is then translated down again A line is reruned, and is so ceaselessly gone on.In addition, being based on identical purpose, language Transformation Program can also be using compiling Device.
In some embodiments of the invention, for step S3, interpreter carries out grammer inspection to primary program before parsing It surveys, when detecting syntactically correct, interpreter parses primary program, for example, interpreter is parsed for scripting language, So carry out parsing money need to detect whether low-level language is scripting language, be if it is normally carried out in next step;It is no, then it moves back Out without parsing.
In some embodiments of the invention, interpreter parses the code in primary program one by one.Interpreter is one One explanation executes original language.For example php, postscritp, javascript are exactly typical interpreted language.With compiling The similar compiler of device is source code to be entirely compiled into object code, is not needing compiler when execution, is directly supporting mesh It marks and is run on the platform of code, such execution efficiency is than explaining that execution is fast very much.For example C language code is compiled into binary system generation Code executes in specified platform/device.
As shown in Fig. 2, interpreter is run the following steps are included: morphological analysis, syntactic analysis, semantic analysis, solution in S3 It is interpreted as side program.
Further, in morphological analysis step, process needs the keyword of Division identification logic control sentence.
The working principle of interpreter is exemplified below, it is worth mentioning at this point that, application of the invention and implementation are not limited to This.
It is an abstract syntax tree by code conversion when interpreter works.Its first step is exactly to scan, the mistake of scanning Journey, actually interpreter are " reading ", because one section of code is only a string of character strings for interpreter, because This should first read out the type of each word, for example, 100 be a number, var is an identifier (identifier), " foo " is a character string, then they can be saved as corresponding data type by interpreter, what " // " and content behind indicated It is an annotation, interpreter is without processing.The data one by one of these storages, referred to as token.After scanned, interpreter Start to parse work, interpreter would generally be gone to attempt every section of code of matching, different canonical with a string of special regular expressions The result that expression formula is matched to is stored as different data types respectively, and this data type will become the one of abstract syntax tree Part.Interpreter will recognise that " this is an addition expression formula ", " this is a method statement ", " this is a print statement " Etc..In this course, interpreter can help it to carry out the structure of abstract syntax tree using token obtained in scanning process It builds, such as it can be identified: setting a number (token), be followed by a "+" character, followed by still connecing a number (token), that is, an addition expression formula.After parsing, entire abstract syntax tree about this section of code just by It constructs.When obtained abstract syntax tree can perform (task i.e. without optimizing or compiling), interpreter " evaluation " (evaluate) will be carried out in sequence to whole abstract syntax tree, such as 1* (2+3), it can be first to " 2 + 3 " evaluation is carried out, such abstract syntax tree has reformed into 1*5, it can be seen that, abstract syntax tree becomes gradually with the progress of evaluation Small, this process is known as " reduction " (reduce), and when abstract syntax tree narrows down to only one value, this section of code is just It is finished.Based on the above principles, interpreter can will be parsed into using the primary program of scripting language and can be embedded into formula and set The side program of standby identification operation.
Language opposing primary program used by side program is more advanced, and in the present embodiment, primary program uses script language Speech, scripting language are that-operational process and the computer programming language that creates are linked to shorten traditional write-compiling-.It Name originates from a script " screenplay ", and each run can all be such that dialog box word for word repeats.One script is usually to solve It releases and executes and decomplier.Scripting language is usually constructed with simple, easy to learn, easy-to-use characteristic, and the object of the invention is just intended to allow Writing work, preferably grasping programmed logic for program is rapidly completed in member.As long as the language that side program of the invention uses Embedded device can identify the language of operation, common are: Java, C, C++, Visual Basic, PHP, Perl, Python、C#、JavaScript、Delphi、SAS、Ruby、PL/SQL、D、ABAP、Lisp/Scheme、COBOL、Ada、 Pascal、Visual FoxPro。
Based on the above method, the invention also discloses a kind of easy programming devices applied to robot teaching, comprising:
(1) primary program input terminal inputs primary program for student.In robot teaching field, frequently with notebook Computer, tablet computer or the input unit of customization are as primary program input terminal.
(2) it is provided with the development board of interpreter, is side program for receiving and parsing through primary program.
(3) embedded device, for carrying out corresponding actions according to side program.In some embodiments, the exploitation Plate is integrated in embedded device.
In some embodiments of the invention, development board end and primary program input terminal are led to by way of wire/wireless Letter connection.Wired mode can be attached using data line, and the port type of data line is according to the primary journey actually used The corresponding port of sequence input terminal, embedded device determines, such as can use the interfaces such as USB2.0, USB 3.0, HDMI.Wirelessly Mode connect, can according to primary program input terminal, embedded device per se with wireless connectivity devices determine connection side Formula, for example, if being connected with network interface card/network connecting module information can be transmitted by internet;Such as it is connected with far infrared transceiver Then information can be transmitted by infrared mode;It is such as connected with blue-tooth device, then can transmit information by way of bluetooth connection.
The above description is merely a specific embodiment, but scope of protection of the present invention is not limited thereto, any Those familiar with the art in the technical scope disclosed by the present invention, can easily think of the change or the replacement, and should all contain Lid is within protection scope of the present invention.

Claims (10)

1. a kind of easy programming method applied to robot teaching, which is characterized in that including the following contents:
S1: it writes language Transformation Program and is arranged in development board;
S2: student writes the primary program of scripting language class according to instructional objective;
S3: primary program is resolved to that the side program of formula equipment can be embedded into through language Transformation Program;
S4: built-in equipment operation side program;
Wherein, primary program and side program use different types of programming language.
2. a kind of easy programming method applied to robot teaching according to claim 1, which is characterized in that language turns Change program is interpreter.
3. a kind of easy programming method applied to robot teaching according to claim 2, which is characterized in that in S3, Interpreter carries out grammer detection to primary program before parsing, and when detecting syntactically correct, interpreter parses primary program.
4. a kind of easy programming method applied to robot teaching according to claim 3, which is characterized in that interpreter Code in primary program is parsed one by one.
5. a kind of easy programming method applied to robot teaching according to claim 4, which is characterized in that in S3, Interpreter operation is the following steps are included: morphological analysis, syntactic analysis, semantic analysis, be construed to side program.
6. a kind of easy programming method applied to robot teaching according to claim 5, which is characterized in that in morphology In analytical procedure, process needs the keyword of Division identification logic control sentence.
7. a kind of easy programming method applied to robot teaching according to claim 1, which is characterized in that second level journey Language opposing primary program used by sequence is more advanced.
8. a kind of easy programming method applied to robot teaching according to claim 2, which is characterized in that second level journey The language that sequence uses for it is below any one: Java, C, C++, Visual Basic, PHP, Perl, Python, C#, JavaScript、Delphi、SAS、Ruby、PL/SQL、D、ABAP、Lisp/Scheme、COBOL、Ada、Pascal、Visual FoxPro。
9. a kind of easy programming device applied to robot teaching characterized by comprising
Primary program input terminal inputs primary program for student;
It is provided with the development board of interpreter, is side program for receiving and parsing through primary program;
Embedded device, for carrying out corresponding actions according to side program.
10. a kind of easy programming device applied to robot teaching according to claim 9, which is characterized in that exploitation Plate end is communicated to connect by way of wire/wireless with primary program input terminal.
CN201811143880.2A 2018-09-28 2018-09-28 A kind of easy programming method and device applied to robot teaching Pending CN109352645A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811143880.2A CN109352645A (en) 2018-09-28 2018-09-28 A kind of easy programming method and device applied to robot teaching

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811143880.2A CN109352645A (en) 2018-09-28 2018-09-28 A kind of easy programming method and device applied to robot teaching

Publications (1)

Publication Number Publication Date
CN109352645A true CN109352645A (en) 2019-02-19

Family

ID=65347989

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811143880.2A Pending CN109352645A (en) 2018-09-28 2018-09-28 A kind of easy programming method and device applied to robot teaching

Country Status (1)

Country Link
CN (1) CN109352645A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109910006A (en) * 2019-03-06 2019-06-21 深圳信息职业技术学院 A kind of programmable teaching type mechanical arm

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20040025150A1 (en) * 2002-08-02 2004-02-05 Taketo Heishi Compiler, compiler apparatus and compilation method
CN1841328A (en) * 2005-04-02 2006-10-04 华为技术有限公司 Automaton method for script language
CN1900905A (en) * 2005-07-24 2007-01-24 华为技术有限公司 Realizing method and its device for detecting descriptive language
CN102999370A (en) * 2011-09-16 2013-03-27 腾讯科技(深圳)有限公司 Method and system for executing script
CN103744331A (en) * 2014-01-06 2014-04-23 上海未来伙伴机器人有限公司 Education robot, controller thereof and programming method of controller
CN104965750A (en) * 2015-06-05 2015-10-07 浪潮集团有限公司 Python language based Rapidio switcher logic simulation verification platform and method
CN106502640A (en) * 2016-09-19 2017-03-15 芯海科技(深圳)股份有限公司 A kind of method for explaining custom script burning

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20040025150A1 (en) * 2002-08-02 2004-02-05 Taketo Heishi Compiler, compiler apparatus and compilation method
CN1841328A (en) * 2005-04-02 2006-10-04 华为技术有限公司 Automaton method for script language
CN1900905A (en) * 2005-07-24 2007-01-24 华为技术有限公司 Realizing method and its device for detecting descriptive language
CN102999370A (en) * 2011-09-16 2013-03-27 腾讯科技(深圳)有限公司 Method and system for executing script
CN103744331A (en) * 2014-01-06 2014-04-23 上海未来伙伴机器人有限公司 Education robot, controller thereof and programming method of controller
CN104965750A (en) * 2015-06-05 2015-10-07 浪潮集团有限公司 Python language based Rapidio switcher logic simulation verification platform and method
CN106502640A (en) * 2016-09-19 2017-03-15 芯海科技(深圳)股份有限公司 A kind of method for explaining custom script burning

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109910006A (en) * 2019-03-06 2019-06-21 深圳信息职业技术学院 A kind of programmable teaching type mechanical arm

Similar Documents

Publication Publication Date Title
US9043759B1 (en) System and method for generating software unit tests simultaneously with API documentation
CN100451968C (en) Grammer creation system
CN106528399A (en) Test case determination method and apparatus
CN105760206A (en) Smart validated code searching method and system
EP4006909A1 (en) Method, apparatus and device for quality control and storage medium
CN108595171A (en) Model generating method, device, equipment and the storage medium of object
Bäumer et al. Flexible ambiguity resolution and incompleteness detection in requirements descriptions via an indicator-based configuration of text analysis pipelines
CN112416788B (en) Hierarchical standard Web application UI automatic test method
US20220414463A1 (en) Automated troubleshooter
CN116860949A (en) Question-answering processing method, device, system, computing equipment and computer storage medium
CN109352645A (en) A kind of easy programming method and device applied to robot teaching
CN117461023A (en) Generating custom software documents for a number of programming languages from a common specification
CN112749277B (en) Medical data processing method, device and storage medium
CN110442877B (en) Using robotic planning as a parallel language corpus
Guy et al. Math speak & write, a computer program to read and hear mathematical input
Englhardt et al. Exploring and characterizing large language models for embedded system development and debugging
Connolly et al. Developing acceptance tests from existing documentation using annotations: An experiment
EP3121711B1 (en) Action designing device and action designing program
CN110473551A (en) A kind of audio recognition method, device, electronic equipment and storage medium
Madnani Querying and serving n-gram language models with python
CN116910646B (en) Method for classifying internal link objectives of knowledge units in SO website
CN117785654A (en) Intelligent water meter auxiliary debugging device and method, electronic equipment and storage medium
CN117311726B (en) Intelligent legal contract generation method and device, electronic equipment and storage medium
Tantos et al. Classification and identification level ambiguity in error annotation
Dong et al. BioMANIA: Simplifying bioinformatics data analysis through conversation

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
WD01 Invention patent application deemed withdrawn after publication
WD01 Invention patent application deemed withdrawn after publication

Application publication date: 20190219