Trajectory graphical programming method and device, electronic device and storage medium
By dragging and dropping graphical objects within the graphical programming area to generate editing parameters, editing the properties of graphical class objects, and modifying the program text, the problem of unintuitive robot programming is solved, achieving intuitive, simple, and efficient graphical programming.
Patent Information
- Application Number
- CN202211013693.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-08-23
- Publication Date
- 2026-02-13
- Estimated Expiration
- 2042-08-23
AI Technical Summary
Existing robot programming methods lack graphical programming, resulting in unintuitive and cumbersome programming, especially when generating non-model edge trajectories. They also rely on powerful CAD 3D engines and are only used on computers, making it impossible to achieve intuitive spatial target point and trajectory editing.
A graphical programming method for trajectory is provided. By dragging and dropping graphical objects within the graphical programming area, editing parameters are generated, the attribute parameters of the graphical class object are edited, and the code area in the program text is modified to generate the target program text for controlling the robot's movement.
It improves the intuitiveness, simplicity, and efficiency of robot programming, and enhances the fun and efficiency of programming by generating trajectories and program text by dragging and dropping spatial trajectory points or trajectories.
Smart Images

Figure CN115454408B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of programming, and in particular to a trajectory graphical programming method and device, an electronic device and a storage medium. BACKGROUND
[0002] In related technologies, the programming methods of robots include the following: a text programming method, a template programming method, and a method of viewing the positions of spatial points and editing trajectories in the form of 3D. In addition to providing a full-text programming method, the method of viewing the positions of spatial points and editing trajectories in the form of 3D also provides interface programming. However, this method can only generate trajectories by inputting corresponding parameters and display the trajectories in a 3D view or select specific edges on a 3D model to generate trajectories. When a trajectory of a non-edge on a model needs to be generated, it is cumbersome, and a powerful CAD three-dimensional engine is required for modeling. At the same time, the convenience and popularity of the 3D programming method in the method of viewing the positions of spatial points and editing trajectories in the form of 3D in related technologies are still insufficient, and this method is currently only used in computers. Furthermore, the programming methods of industrial robots related to spatial type target points and trajectories in related technologies are generally implemented in a text editing manner, which is not intuitive and not simple enough, and cannot achieve graphical programming.
[0003] There is no effective solution to the problem that graphical programming cannot be achieved when programming a robot in related technologies. SUMMARY
[0004] The present application provides a trajectory graphical programming method, device, electronic device and storage medium to at least solve the problem that graphical programming cannot be achieved when programming a robot in related technologies.
[0005] In a first aspect, the present application provides a trajectory graphical programming method, comprising: determining an edited target trajectory according to an operation of a user on a selected graphical object in a preset graphical programming area, and generating corresponding editing parameters, wherein the editing parameters are used to represent an editing operation performed on the target trajectory; editing attribute parameters of a graphical class object currently corresponding to the target trajectory based on the editing parameters to obtain a target graphical class object corresponding to the edited target trajectory, and determining a target text class object corresponding to the target graphical class object; determining a target code area corresponding to the target text class object in a program text currently corresponding to the target trajectory, and modifying code text of the target code area based on the editing parameters to generate a target program text for controlling a robot to move according to the target trajectory.
[0006] In a second aspect, the present application provides a trajectory graphical programming device, comprising:
[0007] determining module, configured to determine an edited target track according to an operation of a user on a selected graphical object in a preset graphical programming area, and generate a corresponding editing parameter, wherein the editing parameter is used to represent an editing operation performed on the target track;
[0008] processing module, configured to edit an attribute parameter of a graphical class object currently corresponding to the target track based on the editing parameter, to obtain a target graphical class object corresponding to the edited target track, and determine a target text class object corresponding to the target graphical class object;
[0009] a programming module, configured to determine a target code region corresponding to the target text class object in program text currently corresponding to the target track, and modify code text of the target code region based on the editing parameter, to generate target program text for controlling the robot to move according to the target track.
[0010] In a third aspect, the present application provides an electronic device, comprising a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory complete communication with each other through the communication bus;
[0011] the memory is used to store a computer program;
[0012] the processor is used to execute the program stored on the memory, to realize the steps of the graphical programming method of the track according to any one of the embodiments of the first aspect.
[0013] In a fourth aspect, a computer readable storage medium is provided, which stores a computer program, and the computer program is executed by a processor to realize the steps of the graphical programming method of the track according to any one of the embodiments of the first aspect.
[0014] Compared with the related art, the embodiment provides a trajectory graphical programming method, device, electronic device and storage medium, the target trajectory edited is determined according to the operation of the selected graphical object in the preset graphical programming area by the user, and the corresponding editing parameter is generated, wherein the editing parameter is used to represent the editing operation performed on the target trajectory;Based on the editing parameter, the attribute parameter of the graphical class object corresponding to the target trajectory is edited, the target graphical class object corresponding to the edited target trajectory is obtained, and the target text class object corresponding to the target graphical class object is determined;In the program text corresponding to the target trajectory, the target code area corresponding to the target text class object is determined, and the code text of the target code area is modified based on the editing parameter, so as to generate the target program text for controlling the robot to move according to the target trajectory, solve the problem that the robot cannot be programmed in the related art, and the graphical programming is realized by dragging the graphical object representing the space trajectory point or the space trajectory to quickly generate the trajectory and the corresponding target program text, the intuitive, simple, interesting and efficient programming is improved.
[0015] The details of one or more embodiments of the present application are presented in the following drawings and description to make other features, objects and advantages of the present application more apparent. BRIEF DESCRIPTION OF DRAWINGS
[0016] The drawings incorporated in the specification and constituting a part thereof illustrate embodiments consistent with the present application and, together with the specification, serve to explain the principles of the present application.
[0017] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the drawings needed to be used in the embodiments or prior art description will be briefly introduced as follows, and obviously, other drawings can also be obtained by those skilled in the art without creative labor.
[0018] Figure 1 A flowchart of a trajectory graphical programming method provided by the embodiment of the present application is shown in the figure.
[0019] Figure 2 The graphical programming interface of the trajectory graphical programming method of the preferred embodiment of the present application is shown in the figure.
[0020] Figure 3 The expanded view of the style display module, the shortcut operation module and the association relationship module of the graphical programming interface in the preferred embodiment of the present application is shown in the figure.
[0021] Figure 4 The single trajectory speed curve pop-up window figure of the preferred embodiment of the present application is shown in the figure.
[0022] Figure 5 is a full trajectory speed curve pop-up window diagram of a preferred embodiment of the present application;
[0023] Figure 6 is a graphical programming example of a preferred embodiment of the present application Figure 1 ;
[0024] Figure 7 is a graphical programming example of a preferred embodiment of the present application Figure 2 ;
[0025] Figure 8 is a pop-up window diagram of manually setting trajectory line numbers in batches of a preferred embodiment of the present application;
[0026] Figure 9 is a schematic diagram of a graphical class object and a text class object of a preferred embodiment of the present application;
[0027] Figure 10 is a schematic diagram of a text object parameter table of a preferred embodiment of the present application;
[0028] Figure 11 is a structural block diagram of a graphical programming device of a trajectory provided by an embodiment of the present application;
[0029] Figure 12 is a structural schematic diagram of an electronic device of an embodiment of the present application. DETAILED DESCRIPTION
[0030] In order to make the objectives, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only a part of the embodiments of the present application, rather than all the embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by a person of ordinary skill in the art without creative work fall within the protection scope of the present application.
[0031] The various technologies described in the present application can be used for the generation and programming modification of robot trajectories.
[0032] The technical solutions in the embodiments of the present application will be described below with reference to the drawings in the embodiments of the present application.
[0033] Figure 1 is a flow schematic diagram of a graphical programming method of a trajectory provided by an embodiment of the present application. As shown in Figure 1 , the present application provides a graphical programming method of a trajectory, which comprises the following steps:
[0034] In step S101, according to the operation of the user on the selected graphical object in the preset graphical programming area, the edited target trajectory is determined, and the corresponding editing parameter is generated, wherein the editing parameter is used to represent the editing operation performed on the target trajectory.
[0035] In the embodiment, the graphical programming method is implemented on a computer device, a mobile terminal, a teach pendant and an industrial controller device, but the implemented device at least has a graphical editing interface for graphical programming operation, for example, a touch screen.
[0036] In the embodiment, when the user adopts graphical programming, for the user end, only the selection of the option corresponding to the editing operation needs to be performed on the graphical programming interface, for example, dragging a space trajectory point of a certain path of a certain space trajectory, after the space trajectory point is dragged, the graphical editing interface corresponds to the display effect corresponding to the corresponding dragging, and for the device performing the graphical programming, the corresponding target program text needs to be generated based on the operation of the user, so that the robot requiring to perform an action based on the programmed space trajectory can run the target program text, and can run according to the space trajectory formed after the user drags.
[0037] In the embodiment, the graphical object at least includes one of the following: a space trajectory point and a space trajectory; meanwhile, the selection of the graphical object of the user changes according to the corresponding operation, for example, when the start point, the passing point and the end point of the space trajectory are dragged, since the space trajectory changes, the currently selected is the space trajectory rather than a certain space trajectory point; when the space trajectory point is dragged, since the space trajectory point changes, the selected is the space trajectory point; in the embodiment, the operation of the user on the graphical object includes but is not limited to: trajectory addition, trajectory deletion, space trajectory point deletion and space trajectory point movement (dragging).
[0038] In the embodiment, when the operation of the user on the graphical object is determined, the target trajectory corresponding to the operation is determined, for example, when the end point of the space trajectory with the line number parameter of 2 is dragged from P2 to P3, the user operation is to drag P2 to P3, and the execution subject of the implementation method can know that the target trajectory corresponding to the operation is the space trajectory with the line number parameter of 2, meanwhile, it is determined that the editing parameter includes the editing type of MOVEL type, the target point parameter of P3 and the speed parameter of a specific value, for example, V1000, and the corresponding editing parameter is MOVEL (P2, V1000). It needs to be noted that the speed parameter in the application is represented by a dimensionless number, but it does not mean that the speed parameter is dimensionless, and the two are determined according to the corresponding unit speed value of the robot, for example, V1000 in the application can represent 1 dm / s.
[0039] In step S102, based on the editing parameter, the attribute parameter of the graphical object corresponding to the target trajectory is edited to obtain a target graphical object corresponding to the edited target trajectory, and a target text object corresponding to the target graphical object is determined.
[0040] In this embodiment, after the editing parameter corresponding to the target trajectory is determined (for example, MOVEL(P2, V1000)), the attribute parameter of the graphical object corresponding to the target trajectory (for example, for the space trajectory with the configured line number parameter 2, the graphical object corresponding to the target trajectory is represented by the path pointer path_graph_object_2) is edited and modified. In this embodiment, the attribute parameter includes the parameter attribute parameter, the text attribute text, and the relative network attribute relative network, and the corresponding editing and modification are as follows: the attribute values of the parameter attribute parameter, the text attribute text, and the relative network attribute in the graphical object corresponding to the target trajectory are updated. For example, the current parameter P2 and V1000 of path_graph_object_2 are updated to P3 and V1000, the current text MOVEL(P2, V1000) of path_graph_object_2 is updated to MOVEL(P3, V1000), and the current relative network attribute list of path_graph_object_2 is updated from {{p0_graph_object_pointer, beginning_point_type}, {p2_graph_object_pointer, finishing_point_type}} to {{p0_graph_object_pointer, beginning_point_type}, {p3_graph_object_pointer, finishing_point_type}}. In the above, p0_graph_object_pointer represents the pointer of the graphical object p0, beginning_point_type represents that the corresponding point is the starting point of the target trajectory, p2_graph_object_pointer represents the pointer of the graphical object p2, p3_graph_object_pointer represents the pointer of the graphical object p3, and finishing_point_type represents that the corresponding point is the ending point of the target trajectory.
[0041] In the embodiment, after the attribute parameters of the graphical object corresponding to the target trajectory are updated, the target text object corresponding to the graphical object is determined, for example, the target text object text object 2 corresponding to path_graph_object_2 is determined according to the text object pointer text_object_pointer of path_graph_object_2, and the attribute parameters of the target text object are updated, for example, the parameter attribute of the target text object is updated to P3 and V1000, and the text attribute is updated to MOVEL(P3, V1000).
[0042] In the embodiment, the attribute parameters of the graphical object corresponding to the target trajectory are updated, so that the graphical object in which the target trajectory changes (for example, the space trajectory point is deleted, the space trajectory point is moved, and the trajectory is added by connecting a plurality of space trajectory points) can be located, and then the position of the target text object (corresponding to the target text in the currently edited program text) to be modified is determined according to the graphical object corresponding to the target trajectory after the attribute parameters are updated, so that the code text in the program text to be modified is located, and the modified program text is corresponding to the operation of the graphical object in the preset graphical programming area, and the robot is controlled to move according to the operation in the graphical programming area.
[0043] In step S103, in the program text currently corresponding to the target trajectory, the target code area corresponding to the target text object is determined, and the code text of the target code area is modified based on the editing parameters to generate the target program text for controlling the robot to move according to the target trajectory.
[0044] In the embodiment, the program text currently corresponding to the target trajectory refers to the program text that has been edited currently, and the program text used for controlling the robot; in the embodiment, after the corresponding target text object is determined based on the editing parameter, the line number parameter and the first preset cursor range corresponding to the program text can be determined through the text object pointer of the target text object first (for example, the line number parameter corresponding to the text object text object 2 in the program text is 2, and the first preset cursor range is 1-20, the corresponding line number parameter and cursor range are pre-configured to the corresponding text object, that is, when the target text object corresponding to the target trajectory is the text object text object 2, the code text corresponding to the target trajectory in the program text includes the code text in the range of line number 2 and cursor range 1-20), then the target code area corresponding to the target text object is determined through the line rouwnum attribute and the cursor attribute of the target text object (for example, text object 2), for example, the text in the range of line number 2 and cursor range 1-16 in the program text is modified to MOVEL(P3, V1000).
[0045] Through the above steps S101 to S103, the edited target trajectory is determined according to the operation of the user on the selected graphical object in the preset graphical programming area, and the corresponding editing parameter is generated, wherein the editing parameter is used to represent the editing operation performed on the target trajectory; based on the editing parameter, the attribute parameter of the graphical object currently corresponding to the target trajectory is edited to obtain the target graphical object corresponding to the edited target trajectory, and the target text object corresponding to the target graphical object is determined; in the program text currently corresponding to the target trajectory, the target code area corresponding to the target text object is determined, and the code text of the target code area is modified based on the editing parameter to generate the target program text for controlling the robot to move according to the target trajectory, solving the problem that the robot cannot be programmed graphically in the related art, and the graphical object representing the space trajectory point or the space trajectory is dragged to quickly generate the trajectory and the corresponding target program text, realizing the graphical programming, improving the intuitiveness, simplicity, interest and efficiency of the programming.
[0046] In some embodiments, the target text object corresponding to the target graphical object is determined through the following steps:
[0047] Step 21, obtaining a preset object pointer parameter table, wherein the preset object pointer parameter table comprises corresponding relationship information between a graphic object and a text object pointer.
[0048] In the embodiment, the preset object pointer parameter table is configuration information of related parameters corresponding to the graphic object, that is, in the related parameters of the graphic object, one graphic object corresponds to one text object pointer, so that when the corresponding target graphic object is determined, the corresponding text object can be quickly determined. Of course, one graphic object is also configured with a corresponding graphic object pointer, and the corresponding graphic object pointer can be used to quickly find the graphic object corresponding to the graphic object pointer. Meanwhile, in the embodiment, for the text object, the related parameters corresponding to one text object correspond to a corresponding text object pointer and a corresponding graphic object pointer, so that whether the graphic object is edited or the text object is edited, the corresponding text object or graphic object will change accordingly, thereby realizing mutual conversion and insertion of graphic programming and text programming.
[0049] Step 22, querying the text object pointer corresponding to the target graphic object in the preset object pointer parameter table.
[0050] Step 23, finding the target text object corresponding to the text object pointer in the preset text object parameter table, and determining the text attribute parameter corresponding to the target text object, wherein the text attribute parameter comprises a line number parameter and a first preset cursor range. The line number parameter is used to represent the writing position of the target text corresponding to the target text object in the program text, and the first preset cursor range is used to represent the range of the code area configured by the target text. In the embodiment, each target code (corresponding to one instruction text) corresponds to one text object, and the text object can be queried through the corresponding text object pointer. The attribute parameter (corresponding to the attribute list) of the text object records the line number parameter and the cursor range of the target code corresponding to the instruction text in the set program text, so that the position of the instruction text in the set program text can be found through the text object.
[0051] In the embodiment of the present application, the graphical object pointer can also be used to query the graphical class object corresponding to the graphical object pointer; in the embodiment of the present application, each text class object has a corresponding graphical object pointer, and each graphical class object also has a corresponding text object pointer, so that graphical modification of the program text in the graphical programming area can cause corresponding modification of the target code of the corresponding text class, and the response relationship is graphical class object→text class object→target text; when text programming is performed, the program text can also be modified to cause corresponding changes of the graphical class object in the graphical programming area, and the corresponding response relationship is target text→text object parameter table (reference Figure 10 )→text class object→graphical class object→graphical display.
[0052] In the embodiment, when a class object (graphical class object, text class object) is pre-configured, that is, the corresponding position (code area) of the class object in the complete program text is configured, the line number parameter and the cursor range determining the code area range of the class object are written into the corresponding class object attribute parameter, for example, the line number parameter and the cursor range of the text class object are written into the corresponding text attribute parameter; therefore, when graphical programming or text programming is performed, when the corresponding text class object (which can be the text class object corresponding to the text object pointer or the text class object associated with the target graphical class object) is determined, the position of the text class object in the complete program text can be determined, and then corresponding text modification is performed in the position, so that corresponding programming is completed.
[0053] In the embodiment, according to the Figure 10 , the preset text object parameter table is at least a parameter table of the association relationship information of four parameters of a text class object (corresponding to a text object pointer), a text, a line number parameter and a cursor range, for example, text class object 3 corresponds to text 3 in the preset text object parameter table, the line number parameter corresponding to text 3 is line number 3, and the cursor range is 1-15.
[0054] The preset object pointer parameter table includes correspondence information between a graphical object and a text object pointer. In the preset object pointer parameter table, the text object pointer corresponding to the target graphical class object is queried. In the preset text object parameter table, the target text class object corresponding to the text object pointer is found, and a text attribute parameter corresponding to the target text class object is determined, where the text attribute parameter includes a line number parameter and a first preset cursor range. The line number parameter is used to represent the writing position of the target text corresponding to the target text class object in the program text. The first preset cursor range is used to represent the range of the code area configured by the target text. The target text class object corresponding to the graphical class object is quickly found, and then the position of the target text to be edited in the program text is determined, so that the beneficial effect of accelerating graphical programming is achieved.
[0055] In some embodiments, in the program text currently corresponding to the target trajectory, the target code area corresponding to the target text class object is determined, which is achieved by the following steps:
[0056] Step 31, in the text attribute parameter corresponding to the target text class object, the line number parameter and the first preset cursor range are obtained.
[0057] In this embodiment, when the corresponding text class object (which can be the text class object corresponding to the text object pointer or the text class object associated with the target graphical class object) is determined during graphical programming or text programming, the position of the text class object in the complete program text can be determined, and then the corresponding text modification is performed in the position, thereby completing the corresponding programming.
[0058] Step 32, according to the line number parameter and the first preset cursor range, the target text corresponding to the target text class object and the code area configured by the target text in the program text are queried, where the target code area includes the code area configured by the target text.
[0059] In this embodiment, after the line number parameter and the first preset cursor range are obtained, the position of the target text corresponding to the target text class object in the program text is sequentially determined based on the line number parameter and the first preset cursor range, that is, the corresponding target code area in the program target is determined. By performing corresponding code text modification in the target code area, the corresponding programming is completed.
[0060] In the target text class object corresponding text attribute parameter in the above steps, the line number parameter and the first preset cursor range are obtained; the target text corresponding to the target text class object and the code region configured by the target text are queried in the program text according to the line number parameter and the first preset cursor range, wherein the target code region includes the code region configured by the target text, which realizes the determination of the target code region corresponding to the target text class object, and further realizes the fast generation of the program text, so as to improve the efficiency of graphical programming.
[0061] In some embodiments, based on the editing parameter, the code text of the target code region is modified to generate a target program text for controlling the robot to move according to a target trajectory, by the following steps:
[0062] Step 41, in the target code region, a first code region corresponding to the editing parameter is determined.
[0063] Step 42, the code text corresponding to the first code region is updated to obtain the target program text.
[0064] In this embodiment, the target code region corresponding to the target text corresponding to the text class object is determined according to the line number parameter and the first cursor range, and all code texts in the target code region correspond to instructions corresponding to the target text class object; and in the programming process, the editing of the target text class object can be editing all code texts in the target code region, or editing part of the code, therefore, the first code region corresponding to the editing parameter in the target code region needs to be determined first, and then the code region that needs to be edited is determined; for example, the text 2 corresponding to the text class object 2 is edited, according to the line number parameter and the first cursor range of the text 2 in the text object parameter table, it can be determined that the corresponding target code region is composed of the code region corresponding to the line number 2 and the cursor range 1-20, when the text 2 is edited, the first code region corresponding to the editing parameter includes the code region corresponding to the line number 2 and the cursor range 1-16.
[0065] In the embodiment, the first code area can be a code area corresponding to one or more parameters of the target text corresponding to the target text type object, and the modification of the one or more parameters is completed by updating the code in the first code area, and then the corresponding programming is completed to generate the target program text; in the embodiment, the first code area can also be the entire target code area, and at this time, the modification is performed on all code texts of the target text corresponding to the target text type object, for example, new code texts can be filled in the corresponding target code area to generate new target texts and target text type objects. It should be noted that, in the embodiment, the target program text is generated based on the code texts corresponding to the unmodified text type object and the text type object after modification, and therefore, the target program text in the embodiment is generated based on the update operation on the program text before the graphical programming, and the update operation can be from nothing to something, for example, the program text before the graphical programming is empty, and at this time, the target program text corresponds to the newly generated program text, or the target program text is modified and updated by the operations such as trajectory modification, trajectory reversing, spatial trajectory point deletion, spatial trajectory point addition, moving, and dragging.
[0066] In the target code area, the first code area corresponding to the editing parameter is determined, the code text corresponding to the first code area is updated based on the editing parameter as the target code text, and the target program text is obtained, so that the generation of the target program text is realized, and the efficiency of the graphical programming is further improved.
[0067] In some embodiments, based on the editing parameter, the attribute parameter of the graphical type object corresponding to the target trajectory is edited to obtain the target graphical type object corresponding to the edited target trajectory, and the following steps are implemented:
[0068] In step 51, based on the editing parameter, the editing type parameter, the editing object information, and the editing parameter value of the target trajectory editing are determined.
[0069] In the embodiment, the graphical programming can be used for trajectory addition, trajectory deletion, spatial trajectory point addition, spatial trajectory point deletion, spatial trajectory point moving, trajectory type modification, trajectory key point changing, trajectory reversing, and trajectory parameter modification, and the parameter modification includes modifying the speed and acceleration, and therefore, in the embodiment, before the programming, the editing type (for example, spatial trajectory point moving), the editing object (for example, spatial trajectory point P3), and the editing parameter value (for example, the speed from the previous spatial trajectory point to the spatial trajectory point P3 is set to 1000) of the target trajectory editing are determined, and then the target graphical type object is determined based on the editing type, the editing object, and the editing parameter value, and the corresponding attribute parameter modification is performed to obtain the target graphical type object.
[0070] Step 52, in the candidate graphical objects screened out from the graphical objects corresponding to the target trajectory according to the editing type parameter, the target graphical object to be modified is determined based on the object information.
[0071] In the embodiment, the candidate graphical objects are first screened out from the graphical objects corresponding to the target trajectory according to the editing type parameter, for example, when the editing type corresponding to the graphical objects corresponding to the target trajectory includes spatial trajectory point movement and trajectory reversing (corresponding to the start and end positions of two spatial trajectory points of the trajectory), and the corresponding editing type parameter in the editing parameter (for example, the editing parameter is MOVEL (P3, V1000)) is movement (for example, MOVEL), the graphical objects corresponding to the movement type operation (for example, spatial trajectory point P3 and spatial trajectory point Pi) in the graphical objects corresponding to the target trajectory are taken as the candidate graphical objects; then, the target graphical object (for example, spatial trajectory point P3) is selected from the candidate graphical objects according to the determined object information, and then the graphical object to be modified is modified according to the editing parameter value.
[0072] Step 53, the attribute parameters of the target graphical object to be modified are edited by using the editing type parameter, the editing object information and the editing parameter value, and the target graphical object is obtained.
[0073] In the embodiment, the attribute parameters of the corresponding target graphical object include multiple sets of data structure attribute parameters, each set of data structure attribute parameters correspondingly includes the editing type parameter, the object information and the editing parameter value, so that when the target graphical object is edited, the editing of the target graphical object needs to be completed according to the editing type parameter, the editing object information and the editing parameter value.
[0074] Through the above steps, the editing type parameter, the editing object information and the editing parameter value of the target trajectory editing are determined based on the editing parameter; in the candidate graphical objects screened out from the graphical objects corresponding to the target trajectory according to the editing type parameter, the target graphical object to be modified is determined based on the object information; the attribute parameters of the target graphical object to be modified are edited by using the editing type parameter, the editing object information and the editing parameter value, and the target graphical object is obtained, so as to confirm the graphical parameters of the editing operation of the graphical programming, to realize the conversion to the text object, to provide data basis for generating the target program text, to further realize the fast graphical programming trajectory, and to improve the intuitiveness, simplicity, interest and efficiency of the programming.
[0075] In some embodiments, the attribute parameter includes a parameter attribute, a text attribute, and a relationship attribute, and the attribute parameter of the target graphical object to be modified is edited by using the editing type parameter, the editing object information, and the editing parameter value to obtain the target graphical object, including the following steps:
[0076] Step 61, updating the parameter attribute of the target graphical object to be modified based on the editing object information and the editing parameter value.
[0077] Step 62, updating the text attribute of the target graphical object to be modified based on the editing type parameter, the editing object information, and the editing parameter value; and,
[0078] Step 63, updating the relationship attribute of the target graphical object to be modified based on the editing object information.
[0079] In this embodiment, after the corresponding target graphical object is determined, the parameter attribute, the text attribute, and the relationship attribute of the graphical object are updated in sequence. For example, the corresponding editing parameter is MOVEL(P3, V1000), the updated parameter attribute is P3 and V1000, the updated text attribute is MOVEL(P3, V1000), and the updated relationship attribute list is updated from the original {{p0_graph_object_pointer, beginning_point_type}, {p2_graph_object_pointer, finishing_point_type}} to {{p0_graph_object_pointer, beginning_point_type}, {p3_graph_object_pointer, finishing_point_type}}.
[0080] In some embodiments, the type parameter at least includes one of the following: track addition, track deletion, track type modification, track parameter modification, track direction change, track corresponding key space track point change, space track point deletion, and space track point movement; and / or, the editing parameter at least includes a speed parameter.
[0081] It should be noted that in this embodiment, the editing parameter includes but is not limited to the speed parameter, and the speed parameter includes but is not limited to the speed and the acceleration. Meanwhile, in this embodiment, different acceleration values are used to represent different acceleration and deceleration states. For example, when the acceleration is positive, it represents acceleration operation, and when the acceleration is negative, it represents deceleration operation.
[0082] In some embodiments, the graphical objects include at least one of the following: space trajectory points, space trajectories, and the user selects the graphical objects in the preset graphical programming area, including: the user selects target space trajectory points or target space trajectories from a plurality of styles of space trajectory points or space trajectories displayed in the graphical programming area, wherein the styles are determined based on at least one of the following characteristics of the graphical objects: shape, label, color.
[0083] In the present embodiment, by using different styles to represent space trajectory points and space trajectories in different cases in the graphical programming area (three-dimensional view), the user can clearly distinguish space trajectory points and space trajectories of different types and in different cases; in the present embodiment, the styles consist of shape, label, and color, and different graphical objects have corresponding style representations in the graphical programming area in different states.
[0084] In the present embodiment, the operations corresponding to the selection of space trajectory points or space trajectories include, but are not limited to, the following operations: dragging space trajectory points in the graphical programming area, connecting a plurality of space trajectory points, reversing trajectories, adding trajectories, deleting trajectories, modifying trajectory types, modifying trajectory parameters, and changing corresponding key space trajectory points of trajectories.
[0085] In the present embodiment, different color patterns and text labels are used to represent space trajectory points and space trajectories in different cases, so that the user can intuitively see the positions, accessibility, use of empty points, acceleration and deceleration stages, etc. of space trajectory points and space trajectories, and perform graphical programming by dragging space trajectory points, connecting space trajectory points with lines, etc., greatly improving the intuitiveness, simplicity, interest, and efficiency of programming.
[0086] In the present embodiment, the position of space trajectory points, the state of space trajectory points, the position of trajectories, the shape of trajectories, the state of trajectories, the speed transition stage of trajectories, etc. are displayed graphically; in some optional embodiments, the running speed, acceleration stage, deceleration stage, and running time, etc. of trajectories are displayed graphically by using speed curves.
[0087] Further, by assigning a special color or style to space trajectory points that are not used in the program, the user can clearly distinguish this type of space trajectory points from other space trajectory points and delete them as desired.
[0088] It should be noted that the space trajectory points and the space trajectory corresponding to the robot have different cases, for example: the robot arm has a certain length, and the space trajectory points beyond the length range are not reachable by the robot, and using these space trajectory points beyond the reachable range in programming will cause the running to be interrupted / error, and in the existing programming mode, these states cannot be simply judged, and the robot program may be continuously calculated and tried to run to completely run down, the programming process is not friendly, the embodiments of the application can make the user see the state of each space trajectory point and space trajectory at a glance, facilitate the user to modify and correct, and greatly improve the programming efficiency and the friendliness of programming; for example: the robot needs to run from a specified speed to another specified speed, and there will be an acceleration or deceleration stage, and the acceleration and deceleration stages will be more concerned by the user, because the two stages are the transition stages of the two speeds, for example, in the spraying process, the speed is not uniform, and the thickness of the sprayed coating is not uniform, and the existing text programming mode cannot see the two transitions, the two processes are displayed in different styles, and the user can obviously see where the trajectory performs the speed transition, how long the transition process lasts, and how long the time lasts, and the existing mode cannot observe these, and often detects that a place is unqualified in production to check the problem and avoid, which greatly affects the product quality and production time.
[0089] In some embodiments, after the target trajectory is generated, the following step is further implemented: the target trajectory is displayed in a set display mode, wherein each display mode corresponds to at least one running parameter, and the running parameter at least includes one of the following: speed, acceleration, and running time.
[0090] In the embodiment, the speed of each segment of the trajectory is represented by a curve, and the acceleration stage, the deceleration stage, and the uniform speed stage of the trajectory are represented in the graphical object and the speed curve of the graphical programming area by color, and the running time of each segment of the trajectory is marked, so that the user can correct and evaluate.
[0091] In the embodiment, each display mode corresponds to at least one running parameter, and the corresponding running parameter is represented by the size of the running speed, the size of the acceleration, and the running time; of course, each display mode corresponds to one type of running parameter, and in the embodiment, the running speed, the acceleration stage, the deceleration stage, and the running time of the trajectory are displayed graphically by the speed curve.
[0092] The following is based on Figures 2 to 10 The process of the graphical programming of the trajectory of the application is specifically described as follows:
[0093] The application provides a graphical programming method for separating the spatial part (robot motion related) and the non-spatial part in the robot code, displaying the code with spatiality together in the form of graphics, color, curve, etc., and editing in the graphical form of dragging and connecting, so as to simplify the programming difficulty.
[0094] In the embodiment, the corresponding graphical programming interface of the corresponding compiling system or control system can refer to Figures 2 to 3 The graphical editing interface displays the following eight modules: menu bar, style display module, shortcut operation module, association relationship module, graphical programming area view switching module, graphical programming area, speed and time estimation module, and pop-up window module, wherein the functions of the modules are as follows:
[0095] The menu bar provides various operations on data and trajectories; the style display module lists the display styles of objects such as spatial points and trajectories in the graphical programming area under different conditions, and the styles are composed of shapes, labels and colors. The example styles listed in the module can provide a reference for users to distinguish (as shown in Figure 3 ) different states and different types of objects in the graphical programming area; the shortcut operation module provides some commonly used shortcut settings and operations in graphical programming; the association relationship module is responsible for providing hints and highlighting operations on the objects selected by the user in the graphical programming area and the objects associated with the objects, so as to obviously distinguish other irrelevant objects, which helps users to observe and edit these related objects. A spatial point is often the starting point, passing point or terminal point of one or multiple trajectories, and a trajectory is often connected to one or more spatial points. When a user selects a spatial point or a trajectory, the association relationship module can mark these objects; the graphical programming area displays the spatial points and trajectories in the current program through a three-dimensional view, and the user can select, drag, connect, edit and delete the spatial points and trajectories in the graphical programming area; the graphical programming area view switching module can zoom in, zoom out and switch the view of the graphical programming area; the speed and time estimation module displays the speed and time consumption of each trajectory; and the pop-up window is used for the interaction between the user and the system, for example, the batch setting of the row number parameters of the spatial trajectories as shown in Figure 8 .
[0096] The graphical programming process of the trajectory of the application specifically includes:
[0097] 1. Selection of spatial points and trajectories
[0098] When the user clicks a space track point or the style of a space track in the graphical programming area, the space track point or the space track is selected. In particular, when the start point, the passing point, or the end point of a space track is dragged, the space track is changed, so the selected object is the space track rather than a space track point. When a space track point is dragged, the space track point is changed, so the selected object is the space track point.
[0099] 2. Viewing of the association relationship
[0100] When the user selects a space track point or a space track in the graphical programming area, the selected object and the objects associated with the selected object can be viewed in the association relationship module. Taking the space track points and space tracks in the graphical programming area as an example, if the user currently selects the space track point J1, which is the end point of the space track LJ / 1 / 20 and the start point of the space track LL / 2 / 21 (see Figure 7 ), the information of the point J1 is displayed in the "current selection" table in the association relationship expansion area, and the information of the space tracks LJ / 1 / 20 and LL / 2 / 21 associated with the point is displayed in the "associated objects" table. The highlight display option in the upper part of the association relationship module or the highlight display option of an object in the two tables can be used to control the highlight display of the specified object.
[0101] It needs to be explained that the association relationship lists a space trajectory point or a space trajectory and its related space trajectory points or space trajectories; whether a space trajectory point or a space trajectory appears in the association relationship list of another object (space trajectory point or space trajectory) depends on whether there is a relationship between the space trajectory point or the space trajectory and the object. For example, a circular arc instruction is determined by a starting point, an ending point and a passing point, so these points will be listed in the association relationship. The ending point of a space trajectory connects the starting point of another space trajectory in the form of "hand in hand", which can form a complex large space trajectory, so the association objects of a space trajectory include not only the special points of the space trajectory but also the space trajectories connected at the beginning and the end of the space trajectory, which are all listed in the association relationship list of the space trajectory. A space trajectory point may be the starting point, the ending point or the passing point of one or more space trajectories, so all the space trajectories that have the space trajectory point as the starting point, the ending point or the passing point are associated with the space trajectory point, and the association relationship list of the point will list these space trajectories. As can be seen, the association relationship of a space trajectory point only includes space trajectories, and the association relationship of a space trajectory includes not only space trajectories but also space trajectory points. If only data (a space trajectory point) is added without setting the data as the starting point, the ending point or the passing point of any space trajectory, the data will not be associated with any data or trajectory, and will not affect the existing data or space trajectory.
[0102] 3. Data addition
[0103] Specifically, it includes selecting the type of space trajectory point to be added, filling in the corresponding parameters, and clicking the confirmation button / add button; the space point is displayed on the corresponding space position in the graphical editing interface.
[0104] 4. Trajectory addition
[0105] Specifically, it includes selecting the type of trajectory to be added, filling in the corresponding parameters, and connecting the starting point, passing point, ending point and other space points required by the trajectory in the graphical programming area; the generated space trajectory is displayed on the corresponding space position in the graphical programming interface.
[0106] 5. Deletion of space trajectory point or space trajectory
[0107] Specifically, it includes clicking to select the space trajectory point or space trajectory to be deleted in the image editing interface, clicking the "delete" button / option, and the space trajectory point or image editing interface disappears.
[0108] 6. Dragging of space trajectory point
[0109] Specifically including: click the "drag space point" button in the shortcut operation area, and drag the corresponding space trajectory point to the desired position in the graphical programming area and release it. The space trajectory point will follow the movement to the position.
[0110] 7、Drag the start and end points of the space trajectory
[0111] Specifically including: click the "drag start point" button in the shortcut operation area, and drag the start point of the corresponding space trajectory to the new target point in the graphical programming area. The start point of the space trajectory will automatically attract the space trajectory point. If the finger leaves the screen to release the dragging process at this time, the start point of the current space trajectory will be modified to the new space trajectory point, for example: Figure 6 The space trajectory LL / 8 / 27 is an illegal path due to a logic problem. Specifically, when the space trajectory is to be started, the end point of the robot is located at DR-P8 (the end point of trajectory No. 7), which is inconsistent with the specified start point of the space trajectory. After the start point of the space trajectory is dragged, the start point of the space trajectory is dragged to DR-P8, as shown in Figure 7 , the space trajectory changes from an illegal state to a normal state.
[0112] 8、Change the direction of the trajectory
[0113] Specifically including: click the "change direction" button in the shortcut operation area or click the "change direction" option in the "trajectory" menu bar after selecting the trajectory to be operated in the graphical programming area.
[0114] It should be noted that the space trajectory has a direction, such as straight-line motion, which is different from a to b or b to a. There is a small arrow in each space trajectory in the graphical programming area indicating the direction of the trajectory. After the change direction operation is performed, the trajectory changes from a to b to b to a.
[0115] 9、Modify the definition or parameters of data or trajectory
[0116] Specifically including: select the corresponding option in the menu or select the corresponding graphical object in the graphical programming area; modify the information of the object in the pop-up window or in the shortcut operation area; click the confirmation button in the pop-up window or the corresponding button in the shortcut operation area; complete the modification of the definition or parameters.
[0117] 10、View the trajectory speed curve.
[0118] Specifically including: click the selected space trajectory in the graphical editing interface; click the "evaluate speed and time" option; view the speed curve and time estimate of the selected trajectory in the pop-up window, as shown in Figure 4In another embodiment, the operation is performed as follows: select the "Evaluate Speed and Time" option in the menu bar; view the speed curve and time estimate for all trajectories in the pop-up window, refer to Figure 5 Fig. 2.
[0119] 11. Text editor modification instruction
[0120] The implementation is as follows:
[0121] Step 1: The user modifies the program text, which in this example is:
[0122] First line: MOVEL (P0, V1000);
[0123] Second line: MOVEL (P1, V1000);
[0124] and modifies the text of the second line, 1-16 cursor range of the program text code, which specifically corresponds to modifying the text of the second line, 1-16 cursor range of the program text code from MOVEL (P1, V1000) to MOVEL (P2, V1000).
[0125] Step 2: Through instruction analysis, it is analyzed that the type of instruction MOVEL (P2, V1000) is MOVEL (move), the target point parameter is P2, and the speed parameter is V1000 (the specific dimension corresponds to the running speed of the robot, which is represented by a number in this paper, but does not represent dimensionless).
[0126] Step 3: According to line number 2, cursor range 1-16, find the corresponding text object pointer in the Figure 10 table shown in the figure, for example: text object pointer text_object_2;
[0127] Step 4: Update the parameter paramete attribute of the text object pointer ttext_object_2 to P2, V1000, and update the text attribute to MOVEL (P2, V1000).
[0128] Step 5: According to the attribute graph_pointer (graph pointer) of text_object_2, find its corresponding graph object, then update the parameter attribute of the graph object to P2, V1000, and update the text attribute to MOVEL (P2, V1000); update the relative_network attribute list from the original:
[0129] {
[0130] {p0_graph_object_pointer, beginning_point_type},
[0131] {p1_graph_object_pointer, finishing_point_type}
[0132] }
[0133] Change to:
[0134] {
[0135] {p0_graph_object_pointer, beginning_point_type},
[0136] {p2_graph_object_pointer, finishing_point_type}
[0137] }
[0138] Wherein p0_graph_object_pointer means the pointer of the p0 graph class object, beginning_point_type means that the point is the starting point of the track object, p1_graph_object_pointer means the pointer of the p1 graph class object, finishing_point_type means that the point is the ending point of the track object, and p2_graph_object_pointer means the pointer of the p2 graph class object.
[0139] In this embodiment, the related parameters of the class objects involved can refer to the description of the class objects in the above-mentioned embodiment. Figure 9 The class objects involved in the embodiment of the present application include but are not limited to: a class object of spatial point graphing, a class object of track graphing, a class object of spatial point text, and a class object of track text.
[0140] Step 6: updating the connection of the ending point of the path to p2 in the graphical interface according to the relative_network attribute.
[0141] Step 7: the program text modified by the user is:
[0142] The first line: MOVEL (P0, V1000);
[0143] The second line: MOVEL (P2, V1000);
[0144] The instruction parsing module is parsed into content that can be recognized by the robot.
[0145] Step 8: the robot performs corresponding operations according to the parsed result, first moving to the p0 point at a speed of 1000, and then moving to the p2 point at a speed of 1000.
[0146] 12. Graphical programming area modification instruction flow
[0147] The implementation is as follows:
[0148] Step 1, modify the space point or trajectory in the graphical programming area, in this example, drag the end point of the trajectory with row number 2 from p2 to p3.
[0149] Step 2, update the parameter attribute of the graphical object path (path)_graph_object_2 corresponding to the trajectory to P3, V1000, update the text attribute to MOVEL (P3, V1000), and update the relative network attribute list to {
[0150] {p0_graph_object_pointer, beginning_point_type},
[0151] {p2_graph_object_pointer, finishing_point_type}
[0152] }
[0153] to:
[0154] {
[0155] {p0_graph_object_pointer, beginning_point_type},
[0156] {p3_graph_object_pointer, finishing_point_type}
[0157] }.
[0158] Step 3, find the text object text_object_2 corresponding to path_graph_object_2 according to the attribute text_object_pointer of path_graph_object_2, then update the parameter attribute of the text object to P3, V1000, and update the text attribute to MOVEL (P3, V1000).
[0159] Step 4, modify the text in row number 2 and cursor range 1-16 to MOVEL (P3, V1000) according to the row attribute and cursor attribute of text_object_2.
[0160] Step 5, update the text and text object table (reference Figure 10 The object's line number and cursor range are unchanged, so they remain the same.
[0161] Step 6, the user modified program text:
[0162] First line: MOVEL (P0, V1000);
[0163] Second line: MOVEL (P3, V1000);
[0164] The instruction parsing module is parsed into content that the robot can recognize.
[0165] Step 7, the robot performs corresponding operations according to the parsed results, first moving at a speed of 1000 to the p0 point, and then moving at a speed of 1000 to the p3 point.
[0166] In this embodiment, a graphical programming device for trajectory is also provided, which is used to implement the above-mentioned embodiments and preferred embodiments, and has been described above. The terms "module", "unit", "sub-unit" and the like used below can be a combination of software and / or hardware that can implement a predetermined function. Although the device described in the following embodiments is preferably implemented in software, hardware, or a combination of software and hardware is also possible and is contemplated.
[0167] Figure 11 is a structural block diagram of a trajectory graphical programming device provided by the embodiment of the present application, as Figure 11 The device comprises:
[0168] The determining module 111 is configured to determine the edited target trajectory according to the operation of the user on the selected graphical object in the preset graphical programming area, and generate corresponding editing parameters, wherein the editing parameters are used to represent the editing operation performed on the target trajectory.
[0169] The processing module 112 is coupled to the determining module 111, and is configured to edit the attribute parameters of the graphical object corresponding to the target trajectory based on the editing parameters, to obtain a target graphical object corresponding to the edited target trajectory, and to determine a target text object corresponding to the target graphical object.
[0170] The programming module 113 is coupled to the processing module 112, and is configured to determine a target code area corresponding to the target text object in the program text corresponding to the target trajectory, and to modify the code text of the target code area based on the editing parameters, to generate a target program text for controlling the robot to move according to the target trajectory.
[0171] By the graphical programming device of the trajectory according to the embodiments of the present application, the edited target trajectory is determined and the corresponding editing parameter is generated according to the operation of the user on the selected graphical object in the preset graphical programming area, wherein the editing parameter is used to represent the editing operation performed on the target trajectory; based on the editing parameter, the attribute parameter of the graphical class object currently corresponding to the target trajectory is edited to obtain the target graphical class object corresponding to the edited target trajectory, and the target text class object corresponding to the target graphical class object is determined; in the program text currently corresponding to the target trajectory, the target code area corresponding to the target text class object is determined, and based on the editing parameter, the code text of the target code area is modified to generate the target program text for controlling the robot to move according to the target trajectory, solving the problem that the robot cannot be programmed graphically in the related art, and by dragging the graphical object representing the space trajectory point or the space trajectory, the trajectory and the corresponding target program text are quickly generated, the graphical programming is realized, and the intuitiveness, simplicity, interest and efficiency of programming are improved.
[0172] In some embodiments, the processing module 112 further includes:
[0173] The first obtaining unit is configured to obtain a preset object pointer parameter table, wherein the preset object pointer parameter table includes correspondence information between a graphical object and a text object pointer;
[0174] The first querying unit is coupled to the first obtaining unit and is configured to query, in the preset object pointer parameter table, a text object pointer corresponding to the target graphical class object;
[0175] The first determining unit is coupled to the first querying unit and is configured to find, in the preset text object parameter table, a target text class object corresponding to the text object pointer and determine a text attribute parameter corresponding to the target text class object, wherein the text attribute parameter includes a line number parameter and a first preset cursor range, the line number parameter is used to represent a writing position of the target text corresponding to the target text class object in the program text, and the first preset cursor range is used to represent a range of a code area configured by the target text.
[0176] In some embodiments, the programming module 113 further includes:
[0177] The second obtaining unit is configured to obtain, in the text attribute parameter corresponding to the target text class object, a line number parameter and a first preset cursor range.
[0178] The second querying unit is coupled to the second obtaining unit and is configured to query, in the program text, a target text corresponding to the target text class object and a code area configured by the target text according to the line number parameter and the first preset cursor range, wherein the target code area includes the code area configured by the target text.
[0179] In some embodiments, the programming module 113 is further configured to: in the target code area, determine a first code area corresponding to the editing parameter; and update the code text corresponding to the first code area to obtain the target program text, with the editing parameter as the target code text.
[0180] In some embodiments, the processing module 112 further includes:
[0181] The second determining unit is configured to determine, based on the editing parameter, an editing type parameter, editing object information, and an editing parameter value for editing the target track.
[0182] The first detecting unit is coupled to the second determining unit and is configured to determine, based on the object information, a target graphical object to be modified from candidate graphical objects that are filtered from the graphical object currently corresponding to the target track according to the editing type parameter.
[0183] The first modifying unit is coupled to the first detecting unit and is configured to edit, using the editing type parameter, the editing object information, and the editing parameter value, an attribute parameter of the target graphical object to be modified to obtain the target graphical object.
[0184] In some embodiments, the attribute parameter includes a parameter attribute, a text attribute, and a correlation attribute, and the first modifying unit is further configured to update the parameter attribute of the target graphical object to be modified based on the editing object information and the editing parameter value; update the text attribute of the target graphical object to be modified based on the editing type parameter, the editing object information, and the editing parameter value; and update the correlation attribute of the target graphical object to be modified based on the editing object information.
[0185] In some embodiments, after the target track is generated by editing, the device is further configured to display the target track in a graphical manner according to a set display mode, wherein each display mode corresponds to at least one running parameter, and the running parameter includes at least one of the following: speed, acceleration, and running time.
[0186] Figure 12 is a structural schematic diagram of an electronic device of an embodiment of the present application, as Figure 12 The present application provides an electronic device, which includes a processor 121, a communication interface 122, a memory 123, and a communication bus 124, wherein the processor 121, the communication interface 122, and the memory 123 complete mutual communication through the communication bus 124,
[0187] The memory 123 is configured to store a computer program.
[0188] The processor 121 is configured to implement the method steps in the method when executing the program stored in the memory 123. Figure 1
[0189] The processor in the electronic device is configured to implement the method steps in the method, and the technical effects brought by the method steps are the same as those of the method steps in the trajectory graphical programming method in the above embodiment, which will not be repeated here. Figure 1 Figure 1 The technical effects brought by the method steps in the trajectory graphical programming method in the above embodiment, which will not be repeated here.
[0190] The communication bus mentioned in the above electronic device can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The communication bus can be divided into an address bus, a data bus, a control bus, etc. For the convenience of representation, Figure 12 In the above embodiment, only one thick line is used to represent the communication bus, but it does not mean that there is only one bus or only one type of bus.
[0191] The communication interface is used for communication between the above electronic device and other devices.
[0192] The memory can include a Random Access Memory (RAM) and can also include a non-volatile memory, such as at least one disk memory. Optionally, the memory can also be at least one storage device located away from the above processor.
[0193] The above processor can be a general-purpose processor, including a Central Processing Unit (CPU), a Network Processor (NP), etc.; can also be a Digital Signal Processing (DSP), an Application Specific Integrated Circuit (ASIC), a Field-Programmable Gate Array (FPGA) or other programmable logic device, a discrete gate or transistor logic device, a discrete hardware component.
[0194] The embodiment of the present application further provides a computer readable storage medium, which stores a computer program, and the computer program is executed by a processor to implement the steps of the trajectory graphical programming method provided by any one of the above method embodiments.
[0195] In a further embodiment provided in the present application, a computer program product containing instructions, which when executed on a computer, causes the computer to perform the steps of the trajectory graphical programming method of any of the above-mentioned embodiments.
[0196] It should be noted that, in the present document, relational terms such as "first" and "second", and the like can be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Moreover, the terms "comprises", "comprising", or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but can include other elements not expressly listed or inherent to such process, method, article, or apparatus. Additionally, unless otherwise stated, the term "about" preceding a value or description denotes that the value or description is within 10%, preferably within 1%, and more preferably within 0.1% of the stated value or description.
[0197] The foregoing is considered as illustrative only of the principles of the application. Numerous modifications and changes will readily occur to those skilled in the art, which modifications and changes are to be understood as intended to be embraced by the principles described herein above and set forth in the following claims. Nothing is intended to be dependent on the application illustrated in the foregoing examples but intended to cover in the broadest sense possible to the principles and novel features disclosed herein.
Claims
1. A graphical programming method for trajectories, characterized in that, include: Based on the user's operation on the selected graphic object within the preset graphical programming area, the target trajectory to be edited is determined, and corresponding editing parameters are generated. The editing parameters are used to characterize the editing operation performed on the target trajectory. Based on the editing parameters, the attribute parameters of the graphical class object corresponding to the target trajectory are edited to obtain the target graphical class object corresponding to the edited target trajectory, and the target text class object corresponding to the target graphical class object is determined; In the program text corresponding to the target trajectory, the target code area corresponding to the target text class object is determined, and the code text of the target code area is modified based on the editing parameters to generate the target program text that controls the robot to move according to the target trajectory; Among these steps, determining the target text class object corresponding to the target graphical class object includes: Obtain a preset object pointer parameter table, wherein the preset object pointer parameter table includes the correspondence information between pointers to graphic objects and pointers to text objects; In the preset object pointer parameter table, query the text object pointer corresponding to the target graphical class object; In the preset text object parameter table, the target text class object corresponding to the text object pointer is found, and the text attribute parameters corresponding to the target text class object are determined. The text attribute parameters include line number parameters and a first preset cursor range. The line number parameters are used to characterize the writing position of the target text corresponding to the target text class object in the program text, and the first preset cursor range is used to characterize the range of the code area configured for the target text. Specifically, determining the target code area corresponding to the target text class object within the program text currently corresponding to the target trajectory includes: In the text attribute parameters corresponding to the target text class object, obtain the line number parameter and the first preset cursor range; according to the line number parameter and the first preset cursor range, query the target text corresponding to the target text class object and the code area configured for the target text in the program text, wherein the target code area includes the code area configured for the target text; Specifically, based on the editing parameters, the code text of the target code area is modified to generate target program text for controlling the robot to move along the target trajectory, including: Within the target code area, a first code area corresponding to the editing parameters is determined; Using the editing parameters as the target code text, the code text corresponding to the first code area is updated to obtain the target program text.
2. The method according to claim 1, characterized in that, Based on the editing parameters, the attribute parameters of the graphical class object corresponding to the current target trajectory are edited to obtain the target graphical class object corresponding to the edited target trajectory, including: Based on the editing parameters, determine the editing type parameters, editing object information, and editing parameter values for editing the target trajectory; Based on the object information, the target graphical object to be modified is determined from the candidate graphical objects selected from the graphical objects currently corresponding to the target trajectory according to the edit type parameter. Using the edit type parameter, the edit object information, and the edit parameter value, the attribute parameters of the target graphical class object to be modified are edited to obtain the target graphical class object.
3. The method according to claim 2, characterized in that, The attribute parameters include parameter attributes, text attributes, and association attributes. Using the edit type parameter, the edit object information, and the edit parameter value, the attribute parameters of the target graphical class object to be modified are edited to obtain the target graphical class object, including: Based on the edit object information and the edit parameter values, the parameter attributes of the target graphical class object to be modified are updated; Based on the edit type parameter, the edit object information, and the edit parameter value, the text attribute of the target graphical class object to be modified is updated; and, Based on the information of the edited object, the association attribute of the target graphical class object to be modified is updated.
4. The method according to claim 2, characterized in that, The type parameter includes at least one of the following: trajectory addition, trajectory deletion, trajectory type modification, trajectory parameter modification, trajectory reversal, change of key spatial trajectory points corresponding to the trajectory, deletion of spatial trajectory points, and movement of spatial trajectory points; And / or, the editing parameters include at least: speed parameters.
5. The method according to claim 1, characterized in that, The graphical object includes at least one of the following: spatial trajectory point, spatial trajectory. The user selects the graphical object in a preset graphical programming area, including: the user selects a target spatial trajectory point or target spatial trajectory from a variety of styles of spatial trajectory points or spatial trajectories displayed in the graphical programming area, wherein the style is determined based on at least one of the following features of the graphical object: shape, label, color.
6. The method according to claim 1, characterized in that, After editing and generating the target trajectory, the method further includes: displaying the target trajectory graphically according to a set display mode, wherein each display mode corresponds to at least one running parameter, and the running parameter includes at least one of the following: speed, acceleration, and running time.
7. A graphical programming device for trajectories, characterized in that, include: The determination module is used to determine the target trajectory to be edited based on the user's operation on the selected graphic object in the preset graphical programming area, and generate corresponding editing parameters, wherein the editing parameters are used to characterize the editing operation performed on the target trajectory; The processing module is used to edit the attribute parameters of the graphical class object corresponding to the target trajectory based on the editing parameters, to obtain the target graphical class object corresponding to the edited target trajectory, and to determine the target text class object corresponding to the target graphical class object; The programming module is used to determine the target code area corresponding to the target text class object in the program text currently corresponding to the target trajectory, and modify the code text of the target code area based on the editing parameters to generate the target program text that controls the robot to move according to the target trajectory; The processing module is further configured to: Obtain a preset object pointer parameter table, wherein the preset object pointer parameter table includes the correspondence information between pointers to graphic objects and pointers to text objects; In the preset object pointer parameter table, query the text object pointer corresponding to the target graphical class object; In the preset text object parameter table, the target text class object corresponding to the text object pointer is found, and the text attribute parameters corresponding to the target text class object are determined. The text attribute parameters include line number parameters and a first preset cursor range. The line number parameters are used to characterize the writing position of the target text corresponding to the target text class object in the program text, and the first preset cursor range is used to characterize the range of the code area configured for the target text. The programming module is also used for: In the text attribute parameters corresponding to the target text class object, obtain the line number parameter and the first preset cursor range; according to the line number parameter and the first preset cursor range, query the target text corresponding to the target text class object and the code area configured for the target text in the program text, wherein the target code area includes the code area configured for the target text; The programming module is also used for: Within the target code area, a first code area corresponding to the editing parameters is determined; Using the editing parameters as the target code text, the code text corresponding to the first code area is updated to obtain the target program text.
8. An electronic device, characterized in that, It includes a processor, a communication interface, a memory, and a communication bus, wherein the processor, the communication interface, and the memory communicate with each other through the communication bus; Memory, used to store computer programs; A processor, when executing a program stored in memory, implements the steps of the graphical programming method for the trajectory as described in any one of claims 1-6.
9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by a processor, it implements the steps of the graphical programming method for trajectories as described in any one of claims 1-6.
Citation Information
Patent Citations
Human-computer interface system for controlling mechanical arm
CN110977983A
Graphical robot programming interaction system and method thereof
CN112698823A