CN113805532B - Method and terminal for manufacturing physical robot actions - Google Patents

Method and terminal for manufacturing physical robot actions Download PDF

Info

Publication number
CN113805532B
CN113805532B CN202110987342.7A CN202110987342A CN113805532B CN 113805532 B CN113805532 B CN 113805532B CN 202110987342 A CN202110987342 A CN 202110987342A CN 113805532 B CN113805532 B CN 113805532B
Authority
CN
China
Prior art keywords
rotation
model
robot
angle
file
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.)
Active
Application number
CN202110987342.7A
Other languages
Chinese (zh)
Other versions
CN113805532A (en
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.)
Fujian Tianquan Educational Technology Ltd
Original Assignee
Fujian Tianquan Educational Technology 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 Fujian Tianquan Educational Technology Ltd filed Critical Fujian Tianquan Educational Technology Ltd
Priority to CN202110987342.7A priority Critical patent/CN113805532B/en
Publication of CN113805532A publication Critical patent/CN113805532A/en
Application granted granted Critical
Publication of CN113805532B publication Critical patent/CN113805532B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G05CONTROLLING; REGULATING
    • G05BCONTROL OR REGULATING SYSTEMS IN GENERAL; FUNCTIONAL ELEMENTS OF SUCH SYSTEMS; MONITORING OR TESTING ARRANGEMENTS FOR SUCH SYSTEMS OR ELEMENTS
    • G05B19/00Programme-control systems
    • G05B19/02Programme-control systems electric
    • G05B19/18Numerical control [NC], i.e. automatically operating machines, in particular machine tools, e.g. in a manufacturing environment, so as to execute positioning, movement or co-ordinated operations by means of programme data in numerical form
    • G05B19/408Numerical control [NC], i.e. automatically operating machines, in particular machine tools, e.g. in a manufacturing environment, so as to execute positioning, movement or co-ordinated operations by means of programme data in numerical form characterised by data handling or data format, e.g. reading, buffering or conversion of data
    • G05B19/4083Adapting programme, configuration
    • GPHYSICS
    • G05CONTROLLING; REGULATING
    • G05BCONTROL OR REGULATING SYSTEMS IN GENERAL; FUNCTIONAL ELEMENTS OF SUCH SYSTEMS; MONITORING OR TESTING ARRANGEMENTS FOR SUCH SYSTEMS OR ELEMENTS
    • G05B2219/00Program-control systems
    • G05B2219/30Nc systems
    • G05B2219/35Nc in input of data, input till input file format
    • G05B2219/35356Data handling
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02PCLIMATE CHANGE MITIGATION TECHNOLOGIES IN THE PRODUCTION OR PROCESSING OF GOODS
    • Y02P90/00Enabling technologies with a potential contribution to greenhouse gas [GHG] emissions mitigation
    • Y02P90/02Total factory control, e.g. smart factories, flexible manufacturing systems [FMS] or integrated manufacturing systems [IMS]

Landscapes

  • Engineering & Computer Science (AREA)
  • Human Computer Interaction (AREA)
  • Manufacturing & Machinery (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Automation & Control Theory (AREA)
  • Manipulator (AREA)

Abstract

The invention provides a method and a terminal for manufacturing physical robot actions, wherein the method comprises the following steps: the method comprises the steps of (1) deriving an url description file of the entity robot from SolidWorks; importing a url description file into Unity, creating a 3D entity robot initial model according to the url description file, and exporting a first 3D model with skeleton information; importing the first 3D model into a 3DMax, reconstructing bones for the first 3D model according to bone information, and performing skin to generate a second 3D model; manufacturing robot actions on the second 3D model based on the skeleton rotation limiting plug-in to perform rotation limiting, and then generating action files; and exporting the action file into a motor data file to the entity robot. According to the invention, the action of the robot is manufactured in 3DMax and is exported as the motor data to be executed by the entity robot, so that the action production period is saved, and a more convenient and rapid entity robot action manufacturing mode is realized.

Description

Method and terminal for manufacturing physical robot actions
Technical Field
The invention relates to the technical field of robot application, in particular to a method and a terminal for manufacturing physical robot actions.
Background
When the physical robot performs behavior expression, a plurality of motors in the robot are required to be controlled to execute according to a designated speed, however, data for controlling the motor speed is required to be prepared in advance, so that a tool is required to generate motor data corresponding to different actions, and various human actions can be customized for the physical robot.
In the prior art, a method for placing a robot structure by adopting a manual means is generally adopted to record motor data and export an action file, and the following defects exist:
1. the action is unnatural: because the method of directly placing each structure of the physical robot is adopted, the physical robot has complex structure, and the continuity of multiple structures can not be ensured when expressing complex behaviors, so that the actions are unnatural.
2. The manufacturing difficulty is high: when the physical robot structure is manually placed, the whole action cannot be previewed, so that the difficulty is great when the action is manufactured, the whole set of action can be previewed only after the recording is completed, if the previewing effect is not as good as that of the manual recording, the repeated time consumption can be caused, and the manufacturing difficulty and the manufacturing cost are greatly improved.
3. The mass production cannot be realized: each customization action needs to be operated and recorded on the physical robot body, so that the requirements on personnel for manufacturing the action are high, and when a large number of actions need to be customized, the efficiency is low.
Disclosure of Invention
The technical problems to be solved by the invention are as follows: the method and the terminal for manufacturing the physical robot action are provided, and the robot action manufacturing is realized more conveniently and rapidly.
In order to solve the technical problems, the invention adopts the following technical scheme:
a method and a terminal for making physical robot actions comprise the following steps:
s1, a profile of the urdf of the physical robot is derived from SolidWorks;
s2, importing the url description file into Unity, creating a 3D entity robot initial model according to the url description file, and exporting a first 3D model with skeleton information;
s3, importing the first 3D model into a 3DMax, reconstructing bones for the first 3D model according to the bone information, and performing skin covering to generate a second 3D model;
s4, manufacturing a robot action on the second 3D model based on a skeleton rotation limiting plug-in to perform rotation limitation, and then generating an action file;
s5, exporting the action file into a motor data file to the entity robot.
In order to solve the technical problems, the invention adopts another technical scheme that:
a terminal for making physical robot actions comprising a memory, a processor and a computer program stored on the memory and executable on the processor, the processor implementing the following steps when executing the computer program:
s1, a profile of the urdf of the physical robot is derived from SolidWorks;
s2, importing the url description file into Unity, creating a 3D entity robot initial model according to the url description file, and exporting a first 3D model with skeleton information;
s3, importing the first 3D model into a 3DMax, reconstructing bones for the first 3D model according to the bone information, and performing skin covering to generate a second 3D model;
s4, manufacturing a robot action on the second 3D model based on a skeleton rotation limiting plug-in to perform rotation limitation, and then generating an action file;
s5, exporting the action file into a motor data file to the entity robot.
The invention has the beneficial effects that: the invention provides a method and a terminal for manufacturing an action of a physical robot, which are characterized in that a fidwork is used for importing a url description file of the physical robot into Unity to create a corresponding 3D model, a 3DMax is used for carrying out skeleton covering on the 3D model, so that the robot action is manufactured in the 3DMax, a manufactured action file is exported to be a motor data file which can be provided for the physical robot end to execute the expression, if the action is expressed on the physical robot, the action file can be directly modified quickly in the 3DMax, the motor data file is exported again, the action production period is saved, the more convenient and quick manufacturing mode of the action of the physical robot is realized, and meanwhile, the simulation function can be realized due to the corresponding 3D model in the Unity.
Drawings
FIG. 1 is a flow chart of a method for making physical robot actions according to an embodiment of the present invention;
fig. 2 is a schematic structural diagram of a terminal for making an action of a physical robot according to an embodiment of the present invention.
Description of the reference numerals:
1. a terminal for making physical robot actions; 2. a memory; 3. a processor.
Detailed Description
In order to describe the technical contents, the achieved objects and effects of the present invention in detail, the following description will be made with reference to the embodiments in conjunction with the accompanying drawings.
Before this, in order to facilitate understanding of the technical solution of the present invention, some english abbreviations, specific nouns, etc. related to the present invention are described as follows:
solidworks: the software can be used for three-dimensional modeling, and can support the export of engineering files in various formats.
3DMax: three-dimensional animation rendering and making software based on PC system.
Unity: the Unity 3D is a real-time 3D interactive content creation and operation platform which can be used for creating, operating and rendering any real-time interactive 2D and 3D content, and the support platform comprises a mobile phone, a tablet computer, a PC, a game host, augmented reality and virtual reality equipment.
The urdf description file: all called Unified Robot Description Format, chinese paraphrasing is a unified robot description format, is a special xml file format, is used for describing the structure of the robot, and can be used for creating a simulation model of the robot.
fbx file: a cross-platform free three-dimensional authoring and exchange format supports all major three-dimensional data elements as well as two-dimensional, audio and video media elements.
Ros-Sharp: the open source engineering on Github can be used for importing the function of Unity and 3D model assembly into the pdf engineering file.
Import Robot From Urdf: tools in Ros-Sharp for assembling the pdf engineering files into a 3D model.
FBX Exporter: a plug-in provided by the Unity authority for exporting 3D model files in fbx format with skeletal information.
Referring to fig. 1, a method for making an action of a physical robot includes the steps of:
s1, a profile of the urdf of the physical robot is derived from SolidWorks;
s2, importing the url description file into Unity, creating a 3D entity robot initial model according to the url description file, and exporting a first 3D model with skeleton information;
s3, importing the first 3D model into a 3DMax, reconstructing bones for the first 3D model according to the bone information, and performing skin covering to generate a second 3D model;
s4, manufacturing a robot action on the second 3D model based on a skeleton rotation limiting plug-in to perform rotation limitation, and then generating an action file;
s5, exporting the action file into a motor data file to the entity robot.
From the above description, the beneficial effects of the invention are as follows: the method comprises the steps of importing the url description file of the entity robot into Unity through Solidworks to create a corresponding 3D model, adopting 3DMax to perform skeleton covering on the 3D model, manufacturing robot actions in the 3DMax, exporting the manufactured action file into a motor data file which can be provided for the entity robot end to execute expression, and if the actions are expressed on the entity robot, directly modifying the action file in the 3DMax to re-export the motor data file, thereby saving the action production period, realizing a more convenient and quick manufacturing mode of the entity robot actions, and simultaneously realizing the simulation function due to the corresponding 3D model in the Unity.
Further, the step of importing the pdf description file into Unity in S2 specifically includes:
creating a Unity project, importing a Ros-Sharp project code, and importing the urdf description file into the Unity project by using a Import Robot From Urdf tool;
the step of deriving the first 3D model with skeleton information in S2 specifically includes:
using the Unity FBX Exporter plug-in, the first 3D model with skeletal information and file format FBX is exported.
From the description, the function of importing the url description file into Unity is realized by using the Ros-Sharp open source engineering, and the url description file is imported through a Import Robot From Urdf tool of the Ros-Sharp and assembled into a 3D entity robot initial model so as to realize the subsequent simulation function; meanwhile, a 3D model in the FBX format for 3DMax to further perform skin development can be derived through an FBX Exporter plug-in.
Further, the step S3 further includes:
and importing the second 3D model into Unity, comparing the initial model of the 3D physical robot with the second 3D model according to the configuration of the urdf description file, and covering the skin information in the second 3D model on the initial model of the 3D physical robot to generate a final model of the 3D physical robot with skeleton information, skin information and joint information.
From the above description, it can be seen that the skin information of the second 3D model after skin is covered on the skeleton corresponding to the initial model of the 3D physical robot in Unity, so that the 3D model in Unity has skeleton information, skin information and joint information, and after the motion is completed in 3DMax, the motion can be restored to a more realistic simulation motion on Unity, and compared with the physical robot to realize visual comparison effect and detail fine adjustment.
Further, the step S4 specifically includes the following steps:
s41, reading standard bone data in the url description file, and converting the standard bone data into an original rotation amount, namely an initial rotation position of the bone, a limiting rotation shaft and limiting upper and lower limits in 3DMax, wherein the limiting rotation shaft is used for prescribing that the rotation can only rotate around a preset shaft, other shafts are locked, and the limiting upper and lower limits are used for prescribing a relative maximum angle and a relative minimum angle of rotation around the shaft;
s42, creating a rotation controller for each bone node in the second 3D model, and binding the original rotation amount, the limiting rotation shaft and the limiting upper and lower limits corresponding to the bone node;
s43, presetting a limiting algorithm in the rotation controller to form the bone rotation limiting plug-in, wherein the limiting algorithm is used for automatically correcting the bone rotation quantity of each bone node corresponding to the motion produced in real time to enable the bone rotation quantity to conform to the range of the upper limit and the lower limit of the limitation so as to limit the effect of bone rotation;
s44, performing rotation limitation on all actions through the skeleton rotation limitation plug-in, and finally generating a complete set of action files.
As can be seen from the above description, by binding a bone rotation controller to each bone node in 3DMax, the method can be used for controlling the behavior of the node, and the effect of limiting the rotation of the bone can be achieved through a certain preset limiting algorithm, for example, after the user modifies the rotation amount of the bone, the rotation amount of the bone can be automatically determined and modified to be in line with the rotation limitation, the upper and lower limits of the limitation are prevented from being exceeded, each action is ensured to be in line with the limitation, and the subsequent actions are performed more smoothly, naturally and aesthetically.
Further, the step S5 specifically includes the following steps:
s51, reading limit information of each motor in the url description file, wherein the limit information comprises an initial position, an initial angle, a rotating shaft, a maximum rotating speed, a minimum rotating speed, a maximum rotating angle and a minimum rotating angle of the motors, and each motor corresponds to bones in the second 3D model one by one;
s52, grouping the motors according to the purposes and the types of the motors, and presetting a frame rate for each group of motors;
s53, acquiring the rotation angles of all bones under each frame of the generated action file, and converting the rotation angles into four-element objects;
s53, calculating the difference value between each frame of a single skeleton and the four-element object of the first frame according to the preset frame rate by groups by adopting a four-element difference algorithm, and converting the difference value into an axis angle form to obtain a difference angle and a rotation axis;
s54, calculating whether the directions of the rotating shaft and the preset shaft specified in the skeleton rotation limiting plug-in are consistent, if so, the difference angle is positive, otherwise, the difference angle is negative, and repeating the calculation of each frame to obtain the angle difference value of all skeletons in each frame;
s55, calculating whether the rotation angle is between the maximum rotation angle and the minimum rotation angle and whether the angular speed is between the maximum rotation speed and the minimum rotation speed according to the angle difference value, if yes, storing the rotation angle as the motor data file, otherwise, printing a limit prompt exceeding the rotation range;
s56, exporting the motor data file to the entity robot, and executing corresponding actions by the entity robot according to the motor data in the motor data file.
It can be seen from the above description that, by deriving the motion file as motor data, reading rotation angle information of each frame of all bones in the 3DMax project according to a preset frame rate to obtain a four-element object, comparing the four-element object at an initial position, calculating a four-element object of a difference value between each frame and a first frame by adopting a four-element difference algorithm, converting the four-element object into a form of an axis angle to obtain a difference angle and a rotation axis, and comparing the calculated rotation axis with the direction of the preset axis and the range of the difference angle to calculate angle difference value data of each frame of each bone.
Referring to fig. 2, a terminal for making physical robot actions includes a memory, a processor, and a computer program stored on the memory and executable on the processor, wherein the processor implements the following steps when executing the computer program:
s1, a profile of the urdf of the physical robot is derived from SolidWorks;
s2, importing the url description file into Unity, creating a 3D entity robot initial model according to the url description file, and exporting a first 3D model with skeleton information;
s3, importing the first 3D model into a 3DMax, reconstructing bones for the first 3D model according to the bone information, and performing skin covering to generate a second 3D model;
s4, manufacturing a robot action on the second 3D model based on a skeleton rotation limiting plug-in to perform rotation limitation, and then generating an action file;
s5, exporting the action file into a motor data file to the entity robot.
From the above description, the beneficial effects of the invention are as follows: based on the same technical conception, the method for producing the physical robot action is matched with the method for producing the physical robot action, the terminal for producing the physical robot action is provided, the fidworks are used for importing the url description file of the physical robot into the Unity to create a corresponding 3D model, the 3D model is subjected to skeleton skin by adopting 3DMax, so that the robot action is produced in the 3DMax, the produced action file is exported as a motor data file which can be provided for the physical robot end to execute the expression, if the action is expressed on the physical robot, the action file can be directly and rapidly modified in the 3DMax, the motor data file is exported again, the action production period is saved, the more convenient and rapid physical robot action production mode is realized, and meanwhile, the simulation function can be realized due to the corresponding 3D model in the Unity.
Further, the step of importing the pdf description file into Unity in S2 specifically includes:
creating a Unity project, importing a Ros-Sharp project code, and importing the urdf description file into the Unity project by using a Import Robot From Urdf tool;
the step of deriving the first 3D model with skeleton information in S2 specifically includes:
using the Unity FBX Exporter plug-in, the first 3D model with skeletal information and file format FBX is exported.
From the description, the function of importing the url description file into Unity is realized by using the Ros-Sharp open source engineering, and the url description file is imported through a Import Robot From Urdf tool of the Ros-Sharp and assembled into a 3D entity robot initial model so as to realize the subsequent simulation function; meanwhile, a 3D model in the FBX format for 3DMax to further perform skin development can be derived through an FBX Exporter plug-in.
Further, the step S3 further includes:
and importing the second 3D model into Unity, comparing the initial model of the 3D physical robot with the second 3D model according to the configuration of the urdf description file, and covering the skin information in the second 3D model on the initial model of the 3D physical robot to generate a final model of the 3D physical robot with skeleton information, skin information and joint information.
From the above description, it can be seen that the skin information of the second 3D model after skin is covered on the skeleton corresponding to the initial model of the 3D physical robot in Unity, so that the 3D model in Unity has skeleton information, skin information and joint information, and after the motion is completed in 3DMax, the motion can be restored to a more realistic simulation motion on Unity, and compared with the physical robot to realize visual comparison effect and detail fine adjustment.
Further, the step S4 specifically includes the following steps:
s41, reading standard bone data in the url description file, and converting the standard bone data into an original rotation amount, namely an initial rotation position of the bone, a limiting rotation shaft and limiting upper and lower limits in 3DMax, wherein the limiting rotation shaft is used for prescribing that the rotation can only rotate around a preset shaft, other shafts are locked, and the limiting upper and lower limits are used for prescribing a relative maximum angle and a relative minimum angle of rotation around the shaft;
s42, creating a rotation controller for each bone node in the second 3D model, and binding the original rotation amount, the limiting rotation shaft and the limiting upper and lower limits corresponding to the bone node;
s43, presetting a limiting algorithm in the rotation controller to form the bone rotation limiting plug-in, wherein the limiting algorithm is used for automatically correcting the bone rotation quantity of each bone node corresponding to the motion produced in real time to enable the bone rotation quantity to conform to the range of the upper limit and the lower limit of the limitation so as to limit the effect of bone rotation;
s44, performing rotation limitation on all actions through the skeleton rotation limitation plug-in, and finally generating a complete set of action files.
As can be seen from the above description, by binding a bone rotation controller to each bone node in 3DMax, the method can be used for controlling the behavior of the node, and the effect of limiting the rotation of the bone can be achieved through a certain preset limiting algorithm, for example, after the user modifies the rotation amount of the bone, the rotation amount of the bone can be automatically determined and modified to be in line with the rotation limitation, the upper and lower limits of the limitation are prevented from being exceeded, each action is ensured to be in line with the limitation, and the subsequent actions are performed more smoothly, naturally and aesthetically.
Further, the step S5 specifically includes the following steps:
s51, reading limit information of each motor in the url description file, wherein the limit information comprises an initial position, an initial angle, a rotating shaft, a maximum rotating speed, a minimum rotating speed, a maximum rotating angle and a minimum rotating angle of the motors, and each motor corresponds to bones in the second 3D model one by one;
s52, grouping the motors according to the purposes and the types of the motors, and presetting a frame rate for each group of motors;
s53, acquiring the rotation angles of all bones under each frame of the generated action file, and converting the rotation angles into four-element objects;
s53, calculating the difference value between each frame of a single skeleton and the four-element object of the first frame according to the preset frame rate by groups by adopting a four-element difference algorithm, and converting the difference value into an axis angle form to obtain a difference angle and a rotation axis;
s54, calculating whether the directions of the rotating shaft and the preset shaft specified in the skeleton rotation limiting plug-in are consistent, if so, the difference angle is positive, otherwise, the difference angle is negative, and repeating the calculation of each frame to obtain the angle difference value of all skeletons in each frame;
s55, calculating whether the rotation angle is between the maximum rotation angle and the minimum rotation angle and whether the angular speed is between the maximum rotation speed and the minimum rotation speed according to the angle difference value, if yes, storing the rotation angle as the motor data file, otherwise, printing a limit prompt exceeding the rotation range;
s56, exporting the motor data file to the entity robot, and executing corresponding actions by the entity robot according to the motor data in the motor data file.
It can be seen from the above description that, by deriving the motion file as motor data, reading rotation angle information of each frame of all bones in the 3DMax project according to a preset frame rate to obtain a four-element object, comparing the four-element object at an initial position, calculating a four-element object of a difference value between each frame and a first frame by adopting a four-element difference algorithm, converting the four-element object into a form of an axis angle to obtain a difference angle and a rotation axis, and comparing the calculated rotation axis with the direction of the preset axis and the range of the difference angle to calculate angle difference value data of each frame of each bone.
Referring to fig. 1, a first embodiment of the present invention is as follows:
a method of making physical robotic actions, comprising the steps of:
s1, a profile of the urdf of the physical robot is derived from SolidWorks;
s2, importing the url description file into Unity, creating a 3D entity robot initial model according to the url description file, and exporting a first 3D model with skeleton information;
s3, importing the first 3D model into a 3DMax, reconstructing bones for the first 3D model according to bone information, and performing skin covering to generate a second 3D model;
s4, manufacturing a robot action on the second 3D model based on the skeleton rotation limiting plug-in to perform rotation limiting, and then generating an action file;
s5, exporting the action file into a motor data file to the entity robot.
That is, in this embodiment, if the action is expressed on the physical robot and there is a problem, the physical robot performs the action corresponding to the motor data file, and if the action is expressed on the physical robot, the action file can be directly and quickly modified in 3DMax, so as to re-derive the motor data file, thereby saving the production cycle of the action, realizing a more convenient and quick action making mode of the physical robot, and meanwhile, because there is a corresponding 3D model in Unity, the simulation function can be realized.
Referring to fig. 1, a second embodiment of the present invention is as follows:
in the first embodiment, in the present embodiment, the step S2 of importing the url description file into Unity specifically includes:
creating a Unity engineering, importing an engineering code of Ros-Sharp, and importing an url description file into the Unity engineering by using a Import Robot From Urdf tool.
In this embodiment, the function of importing the url description file into Unity is realized by using the Ros-Sharp open source engineering, and the url description file is imported by using a Import Robot From Urdf tool of the Ros-Sharp and assembled into the initial model of the 3D physical robot so as to realize the subsequent simulation function.
The step S2 of deriving the first 3D model with bone information specifically includes:
using the Unity FBX Exporter plug-in, a first 3D model with skeletal information and file format FBX is exported.
Namely, the embodiment derives the 3D model in the FBX format for further skin development of the 3DMax through the FBX Exporter plug-in.
Wherein, step S3 further comprises:
and importing the second 3D model into Unity, comparing the initial model of the 3D physical robot with the second 3D model according to the configuration of the url description file, and covering the skin information in the second 3D model on the initial model of the 3D physical robot to generate a final model of the 3D physical robot with skeleton information, skin information and joint information.
In this embodiment, the skin information in 3DMax is covered in Unity to make the 3D model in Unity have skeleton information, skin information and joint information, so that after the motion is made in 3DMax, more realistic simulation motion can be restored on Unity, and visual comparison effect and detail fine adjustment can be realized by comparing the simulation motion with the physical robot.
The step S4 specifically includes the following steps:
s41, reading standard bone data in the url description file, and converting the standard bone data into an original rotation amount, namely an initial rotation position of the bone, a limiting rotation shaft and limiting upper and lower limits in 3DMax, wherein the limiting rotation shaft is used for limiting rotation around a preset shaft only, other shafts are locked, and the limiting upper and lower limits are used for limiting a relative maximum angle and a relative minimum angle of rotation around the shaft.
Since the standard bone data is stored in the url description file, the position, rotation and restriction information, etc. are marked by the right-hand coordinate system, and the coordinate system standard of 3DMax is the same as the url description file, but the rotation axis sequence is different, and the two are not directly compatible, in this embodiment, the standard bone data in the url description file needs to be converted into the three groups of data through an algorithm: the original rotation amount, the rotation limiting shaft, and the limiting upper and lower limits.
S42, creating a rotation controller for each skeleton node in the second 3D model, and binding the original rotation quantity, the limited rotation shaft and the limited upper and lower limits corresponding to the skeleton node;
s43, presetting a limiting algorithm in the rotation controller to form a bone rotation limiting plug-in, wherein the limiting algorithm is used for automatically correcting the bone rotation quantity of each bone node corresponding to the motion produced in real time to ensure that the bone rotation quantity meets the range of the upper limit and the lower limit of the limitation so as to limit the effect of bone rotation;
s44, performing rotation limitation on all actions through the skeleton rotation limitation plug-in, and finally generating a complete set of action files.
Because the behavior of the user to modify the rotation amount is unpredictable, either dragging the trackball (a way of interaction provided by 3 DMax), directly editing the rotation value, or modifying the keyframe will have an impact on the bone rotation amount. Therefore, in this embodiment, a bone rotation controller is bound to each bone node in 3DMax, which can be used to control the behavior of the node, and the effect of limiting the rotation of the bone is achieved through a certain preset limiting algorithm, for example, after the user modifies the rotation amount of the bone, the rotation amount of the bone can be automatically determined and modified to conform to the rotation limitation, so that the upper and lower limits of the limitation are prevented from being exceeded, each action is ensured to conform to the limitation, and the subsequent actions are performed more smoothly, naturally and aesthetically.
The step S5 specifically includes the following steps:
s51, reading limiting information of each motor in the url description file, wherein the limiting information comprises an initial position, an initial angle, a rotating shaft, a maximum rotating speed, a minimum rotating speed, a maximum rotating angle and a minimum rotating angle of the motors, and each motor corresponds to bones in the second 3D model one by one.
Because the skeleton of the physical robot model in 3DMax engineering and the joint in the url description file are in one-to-one correspondence, that is, one joint corresponds to one motor, in order to obtain the constraint information of the skeleton, in this embodiment, the initial position, the initial angle, the rotation axis, the maximum rotation speed, the minimum rotation speed, the maximum rotation angle and the minimum rotation angle of each motor in the corresponding url description file need to be read, so that each motor corresponds to the skeleton in the second 3D model one by one.
S52, grouping the motors according to the purposes and the types of the motors, and presetting a frame rate for each group of motors.
Since the execution frame rates of the different sets of motors are different, in this embodiment, the frame rate is preset for each set of motors, so that the bone data of each bone in the corresponding 3DMax project is read according to the preset frame rate when the subsequent action is made.
S53, acquiring the rotation angles of all bones under each frame of the generated action file, and converting the rotation angles into four-element objects;
s53, adopting a four-element difference algorithm, calculating the difference between four-element objects of each frame and the first frame of a single skeleton according to a preset frame rate in groups, and converting the difference into an axis angle form to obtain a difference angle and a rotation axis;
s54, calculating whether the directions of the rotation shaft and a preset shaft specified in the skeleton rotation limiting plug-in are consistent, if so, the difference angle is positive, otherwise, the difference angle is negative, and repeating the calculation of each frame to obtain the angle difference value of all skeletons in each frame;
s55, calculating whether the rotation angle is between the maximum rotation angle and the minimum rotation angle and whether the angular speed is between the maximum rotation speed and the minimum rotation speed according to the angle difference value, if so, saving the rotation angle as a motor data file, otherwise, printing a limit prompt beyond the rotation range;
s56, exporting the motor data file to the entity robot, and executing corresponding actions by the entity robot according to the motor data in the motor data file.
Meanwhile, as a plurality of key frames are added on a time axis to control the rotation angles and positions of different bones at different times when the 3DMax performs manufacturing actions, and when previewing is performed after the plurality of key frames are added, the 3DMax plug-in performs interpolation processing on action transition between the two key frames, so that complete action data is a data set containing all the rotation angles and position information of bones of each frame; the operation of the physical robot model is the same as that described above except that no position change data is generated. Therefore, in this embodiment, when the motion file is derived as the motor data, it is required to read rotation angle information of each frame of all bones in the 3DMax project according to a preset frame rate to obtain a four-element object, compare the four-element object at the initial position, calculate a difference four-element object between each frame and the first frame by adopting a four-element difference algorithm, convert the difference four-element object into an axis angle form to obtain a difference angle and a rotation axis, calculate angle difference data of each bone in each frame by comparing the calculated rotation axis with the direction of the preset axis and the range of the difference angle, and because the bones of the 3DMax project and the motors of the entity robot are in one-to-one correspondence, calculate each frame difference of the bones, that is, calculate the motion data of each frame of the motors, that is, finally, can obtain a motor data file corresponding to the motion file one-to-one, and the entity robot can execute corresponding motion according to the motor data file.
Referring to fig. 2, a third embodiment of the present invention is as follows:
a terminal 1 for producing physical robot actions, comprising a memory 2, a processor 3 and a computer program stored on the memory 2 and executable on the processor 3, the processor 3 implementing the steps of any of the above-described embodiments one or two when executing the computer program.
In summary, according to the method and terminal for manufacturing the physical robot action provided by the invention, the fidworks are used for importing the url description file of the physical robot into the Unity to create the corresponding 3D model, and the 3D model is subjected to skeleton skin by adopting the 3DMax, so that the robot action is manufactured in the 3DMax, and the manufactured action file is exported to be a motor data file which can be provided for the physical robot to execute expression, so that the method and terminal have the following advantages:
1. the flow of customizing the action of the entity robot is specified, and a large amount of manpower and material resources can be saved by adopting the whole set of complete flow from the initial establishment of Solidworks engineering to the final export of the motor data file;
2. the action is manufactured in 3DMax, the effect of the action is limited by the rotation limiting plug-in, so that the action is smoother, natural and attractive, and the manufactured action can be produced in batch;
3. if the motor data file derived from the action file is executed on the entity robot and has a problem, the corresponding action file on the 3DMaz engineering can be directly modified, the motor data file can be re-derived for quick test, the action production period is saved, and more convenient and quick entity robot action production is realized;
4. each action has 3DMax project file records, so that action tracing and problem positioning can be more easily carried out;
5. the method can restore the manufactured actions on the Unity, and compare the effects with the execution effects of the entity robot through the Unity simulation effects, so that the effects and the fine-tuning of the details can be more intuitively compared.
The foregoing description is only illustrative of the present invention and is not intended to limit the scope of the invention, and all equivalent changes made by the specification and drawings of the present invention, or direct or indirect application in the relevant art, are included in the scope of the present invention.

Claims (8)

1. A method of making physical robotic actions, comprising the steps of:
s1, a profile of the urdf of the physical robot is derived from SolidWorks;
s2, importing the url description file into Unity, creating a 3D entity robot initial model according to the url description file, and exporting a first 3D model with skeleton information;
s3, importing the first 3D model into a 3DMax, reconstructing bones for the first 3D model according to the bone information, and performing skin covering to generate a second 3D model;
s4, manufacturing a robot action on the second 3D model based on a skeleton rotation limiting plug-in to perform rotation limitation, and then generating an action file;
s5, exporting the action file into a motor data file to the entity robot;
the step S5 specifically comprises the following steps:
s51, reading limit information of each motor in the url description file, wherein the limit information comprises an initial position, an initial angle, a rotating shaft, a maximum rotating speed, a minimum rotating speed, a maximum rotating angle and a minimum rotating angle of the motors, and each motor corresponds to bones in the second 3D model one by one;
s52, grouping the motors according to the purposes and the types of the motors, and presetting a frame rate for each group of motors;
s53, acquiring the rotation angles of all bones under each frame of the generated action file, and converting the rotation angles into four-element objects;
s53, calculating the difference value between each frame of a single skeleton and the four-element object of the first frame according to the preset frame rate by groups by adopting a four-element difference algorithm, and converting the difference value into an axis angle form to obtain a difference angle and a rotation axis;
s54, calculating whether the directions of the rotating shaft and a preset shaft specified in the skeleton rotation limiting plug-in are consistent, if so, the difference angle is positive, otherwise, the difference angle is negative, and repeating the calculation of each frame to obtain the angle difference value of all skeletons in each frame;
s55, calculating whether the rotation angle is between the maximum rotation angle and the minimum rotation angle and whether the angular speed is between the maximum rotation speed and the minimum rotation speed according to the angle difference value, if yes, storing the rotation angle as the motor data file, otherwise, printing a limit prompt exceeding the rotation range;
s56, exporting the motor data file to the entity robot, and executing corresponding actions by the entity robot according to the motor data in the motor data file.
2. The method for producing physical robot actions according to claim 1, wherein the importing the url description file into Unity in S2 is specifically:
creating a Unity project, importing a Ros-Sharp project code, and importing the urdf description file into the Unity project by using a Import Robot From Urdf tool;
the step of deriving the first 3D model with skeleton information in S2 specifically includes:
using the Unity FBX Exporter plug-in, the first 3D model with skeletal information and file format FBX is exported.
3. The method for producing physical robot actions according to claim 1, wherein S3 further comprises:
and importing the second 3D model into Unity, comparing the initial model of the 3D physical robot with the second 3D model according to the configuration of the urdf description file, and covering the skin information in the second 3D model on the initial model of the 3D physical robot to generate a final model of the 3D physical robot with skeleton information, skin information and joint information.
4. The method for making physical robot actions according to claim 1, wherein the step S4 specifically comprises the following steps:
s41, reading standard bone data in the url description file, and converting the standard bone data into an original rotation amount, namely an initial rotation position of the bone, a limiting rotation shaft and limiting upper and lower limits in 3DMax, wherein the limiting rotation shaft is used for prescribing that the rotation can only rotate around a preset shaft, other shafts are locked, and the limiting upper and lower limits are used for prescribing a relative maximum angle and a relative minimum angle of rotation around the shaft;
s42, creating a rotation controller for each bone node in the second 3D model, and binding the original rotation amount, the limiting rotation shaft and the limiting upper and lower limits corresponding to the bone node;
s43, presetting a limiting algorithm in the rotation controller to form the bone rotation limiting plug-in, wherein the limiting algorithm is used for automatically correcting the bone rotation quantity of each bone node corresponding to the motion produced in real time to enable the bone rotation quantity to conform to the range of the upper limit and the lower limit of the limitation so as to limit the effect of bone rotation;
s44, performing rotation limitation on all actions through the skeleton rotation limitation plug-in, and finally generating a complete set of action files.
5. A terminal for making physical robot actions, comprising a memory, a processor and a computer program stored on the memory and executable on the processor, said processor implementing the following steps when executing said computer program:
s1, a profile of the urdf of the physical robot is derived from SolidWorks;
s2, importing the url description file into Unity, creating a 3D entity robot initial model according to the url description file, and exporting a first 3D model with skeleton information;
s3, importing the first 3D model into a 3DMax, reconstructing bones for the first 3D model according to the bone information, and performing skin covering to generate a second 3D model;
s4, manufacturing a robot action on the second 3D model based on a skeleton rotation limiting plug-in to perform rotation limitation, and then generating an action file;
s5, exporting the action file into a motor data file to the entity robot;
the step S5 specifically comprises the following steps:
s51, reading limit information of each motor in the url description file, wherein the limit information comprises an initial position, an initial angle, a rotating shaft, a maximum rotating speed, a minimum rotating speed, a maximum rotating angle and a minimum rotating angle of the motors, and each motor corresponds to bones in the second 3D model one by one;
s52, grouping the motors according to the purposes and the types of the motors, and presetting a frame rate for each group of motors;
s53, acquiring the rotation angles of all bones under each frame of the generated action file, and converting the rotation angles into four-element objects;
s53, calculating the difference value between each frame of a single skeleton and the four-element object of the first frame according to the preset frame rate by groups by adopting a four-element difference algorithm, and converting the difference value into an axis angle form to obtain a difference angle and a rotation axis;
s54, calculating whether the directions of the rotating shaft and a preset shaft specified in the skeleton rotation limiting plug-in are consistent, if so, the difference angle is positive, otherwise, the difference angle is negative, and repeating the calculation of each frame to obtain the angle difference value of all skeletons in each frame;
s55, calculating whether the rotation angle is between the maximum rotation angle and the minimum rotation angle and whether the angular speed is between the maximum rotation speed and the minimum rotation speed according to the angle difference value, if yes, storing the rotation angle as the motor data file, otherwise, printing a limit prompt exceeding the rotation range;
s56, exporting the motor data file to the entity robot, and executing corresponding actions by the entity robot according to the motor data in the motor data file.
6. The terminal for producing physical robot actions according to claim 5, wherein the importing the url description file into Unity in S2 is specifically:
creating a Unity project, importing a Ros-Sharp project code, and importing the urdf description file into the Unity project by using a Import Robot From Urdf tool;
the step of deriving the first 3D model with skeleton information in S2 specifically includes:
using the Unity FBX Exporter plug-in, the first 3D model with skeletal information and file format FBX is exported.
7. The terminal for making physical robot actions according to claim 5, wherein said S3 further comprises:
and importing the second 3D model into Unity, comparing the initial model of the 3D physical robot with the second 3D model according to the configuration of the urdf description file, and covering the skin information in the second 3D model on the initial model of the 3D physical robot to generate a final model of the 3D physical robot with skeleton information, skin information and joint information.
8. The terminal for making physical robot actions according to claim 5, wherein the step S4 specifically comprises the steps of:
s41, reading standard bone data in the url description file, and converting the standard bone data into an original rotation amount, namely an initial rotation position of the bone, a limiting rotation shaft and limiting upper and lower limits in 3DMax, wherein the limiting rotation shaft is used for prescribing that the rotation can only rotate around a preset shaft, other shafts are locked, and the limiting upper and lower limits are used for prescribing a relative maximum angle and a relative minimum angle of rotation around the shaft;
s42, creating a rotation controller for each bone node in the second 3D model, and binding the original rotation amount, the limiting rotation shaft and the limiting upper and lower limits corresponding to the bone node;
s43, presetting a limiting algorithm in the rotation controller to form the bone rotation limiting plug-in, wherein the limiting algorithm is used for automatically correcting the bone rotation quantity of each bone node corresponding to the motion produced in real time to enable the bone rotation quantity to conform to the range of the upper limit and the lower limit of the limitation so as to limit the effect of bone rotation;
s44, performing rotation limitation on all actions through the skeleton rotation limitation plug-in, and finally generating a complete set of action files.
CN202110987342.7A 2021-08-26 2021-08-26 Method and terminal for manufacturing physical robot actions Active CN113805532B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110987342.7A CN113805532B (en) 2021-08-26 2021-08-26 Method and terminal for manufacturing physical robot actions

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110987342.7A CN113805532B (en) 2021-08-26 2021-08-26 Method and terminal for manufacturing physical robot actions

Publications (2)

Publication Number Publication Date
CN113805532A CN113805532A (en) 2021-12-17
CN113805532B true CN113805532B (en) 2023-05-23

Family

ID=78894151

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110987342.7A Active CN113805532B (en) 2021-08-26 2021-08-26 Method and terminal for manufacturing physical robot actions

Country Status (1)

Country Link
CN (1) CN113805532B (en)

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113160360A (en) * 2021-05-07 2021-07-23 深圳市灼华互娱科技有限公司 Animation data production method, device, equipment and storage medium

Family Cites Families (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7872653B2 (en) * 2007-06-18 2011-01-18 Microsoft Corporation Mesh puppetry
CN104021584B (en) * 2014-06-25 2017-06-06 无锡梵天信息技术股份有限公司 A kind of implementation method of Skeletal Skinned Animation
CN104391683B (en) * 2014-08-28 2018-04-06 无锡梵天信息技术股份有限公司 A kind of method and device that model animation in three-dimensional software is exported based on 3Dmax scripts
CN107213638B (en) * 2017-04-06 2020-12-08 珠海金山网络游戏科技有限公司 3D game skeleton processing system and processing method thereof
CN108597015A (en) * 2018-01-08 2018-09-28 江苏辰锐网络科技有限公司 The automatic binding system of three dimensional biological model bone, method, equipment and computer program product
CN109658484A (en) * 2018-12-21 2019-04-19 上海哔哩哔哩科技有限公司 A kind of Automatic Generation of Computer Animation method and Automatic Generation of Computer Animation system
CN110531640A (en) * 2019-09-11 2019-12-03 北京云迹科技有限公司 A kind of comprehensive simulating method and system of robot
CN112184863B (en) * 2020-10-21 2024-03-15 网易(杭州)网络有限公司 Animation data processing method and device
CN112419454B (en) * 2020-11-25 2023-11-28 北京市商汤科技开发有限公司 Face reconstruction method, device, computer equipment and storage medium
CN112873166A (en) * 2021-01-25 2021-06-01 之江实验室 Method, device, electronic equipment and medium for generating robot limb actions
CN112927331B (en) * 2021-03-31 2023-09-22 腾讯科技(深圳)有限公司 Character model animation generation method and device, storage medium and electronic equipment

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113160360A (en) * 2021-05-07 2021-07-23 深圳市灼华互娱科技有限公司 Animation data production method, device, equipment and storage medium

Also Published As

Publication number Publication date
CN113805532A (en) 2021-12-17

Similar Documents

Publication Publication Date Title
US12017145B2 (en) Method and system of automatic animation generation
CN106200983B (en) A kind of system of combination virtual reality and BIM realization virtual reality scenario architectural design
Igarashi et al. Spatial keyframing for performance-driven animation
US20030184544A1 (en) Modeling human beings by symbol manipulation
JP2009070380A (en) Facial animation using motion capture data
KR100503789B1 (en) A rendering system, rendering method, and recording medium therefor
CN102629388B (en) Mechanical equipment simulation system generating method
CN112927331B (en) Character model animation generation method and device, storage medium and electronic equipment
EP2587456A2 (en) Method and systems for generating a dynamic multimodal and multidimensional presentation
CN111292402B (en) Data processing method, device, equipment and computer readable storage medium
Miranda et al. Sketch express: A sketching interface for facial animation
CN111179391A (en) Three-dimensional animation production method, system and storage medium
JP4719155B2 (en) Rig baking
CN115908664B (en) Animation generation method and device for man-machine interaction, computer equipment and storage medium
CN113805532B (en) Method and terminal for manufacturing physical robot actions
KR102026857B1 (en) 3D printing system using 3D modeling authoring tool based on VR technology
CN111640170B (en) Bone animation generation method, device, computer equipment and storage medium
Tejera et al. Space-time editing of 3d video sequences
JP2023540434A (en) System and method for computer animation using operation order transformation engine
CN111862276A (en) Automatic skeleton animation production method based on formalized action description text
TWI819989B (en) Modeling device and modeling method for 3d object
Fukusato et al. View-dependent formulation of 2.5 d cartoon models
WO2024027285A1 (en) Facial expression processing method and apparatus, computer device and storage medium
WO2023184357A1 (en) Expression model making method and apparatus, and electronic device
CN118015155A (en) Animation production method and device and electronic equipment

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
GR01 Patent grant
GR01 Patent grant