Disclosure of Invention
In view of this, the invention aims to provide a motion planning method and system for dual-robot cooperation, which have the characteristics of convenience in teaching and good universality.
The invention is realized by adopting the following scheme: a motion planning method for dual-robot collaboration, comprising the steps of:
in an ROS system, establishing a model description file of the double robots and the working environment and a Moveit configuration file of the double robots;
carrying out initialization setting, creating an operation object, creating a double-arm instruction by taking the operation object as a parameter, and arranging actions of the double robots for executing tasks;
analyzing the double-arm instructions one by one, calling a MoveIt function to plan the movement of the instructions, and storing and issuing a planning result; if there is a wrong instruction in the planning, the analysis and planning are stopped.
Further, the initialization setting specifically includes: in the ROS system, displaying models of the double robots and the working environments thereof; and sets the initial point of the dual robot.
Further, the analyzing the two-arm instructions one by one, calling a MoveIt function to plan the movement of the instructions, storing and issuing the planning result, and stopping analyzing and planning if an instruction with a wrong planning exists specifically comprises the following steps:
step S1: judging whether the planning result of the current double-arm instruction exceeds a preset motion range or whether collision occurs, if so, judging that the planning of the instruction is wrong, and ending the analysis and planning, otherwise, entering the step S2;
step S2: and storing and issuing the planning result of the current double-arm command, judging whether all double-arm commands are analyzed, if so, finishing the analysis and planning, and otherwise, returning to the step S1.
Further, the storing and issuing of the planning result of the current dual-arm instruction specifically includes: receiving a motion planning result and issuing pose information of the double robots in real time, and writing the motion planning result into a file for storage; each time the double robots execute a task, a file for storing the motion planning result is generated.
Furthermore, the type of the operation object comprises an object to be operated and a mark point, and the object to be operated is a simple geometric body obtained by simplifying objects including parts, accessories and tools which are taken by the double robots in the process of executing tasks; the marking point is a specific point which must be passed or reached in the process of the movement of the double robots; when an object to be operated is created, the input parameters are the size of a geometric body and the pose of the object; when a mark point is created, the input parameter is the position and posture of the point; and numbering the generated object to be operated and the mark points respectively.
Further, a task is composed of a plurality of double-arm commands, each double-arm command is composed of two single-arm commands, and each robot executes one single-arm command.
Further, the types of single arm instructions include move, insert, rotate, pause, grab, and place; when a moving instruction is used, a marking point is required to be appointed to serve as a target point reached by the end effector; when an insertion instruction is used, a marking point is required to be appointed as an insertion termination point; when a rotation instruction is used, a mark point is required to be appointed as a rotation termination point; when the pause instruction is used, the pause time needs to be specified; when the clamping instruction is used, the clamping object and the extending direction and the taking direction of the end effector need to be specified; when the placement command is used, a marking point is designated as an object placement point and the insertion and removal directions of the end effector.
The invention also provides a system based on the motion planning method for the double-robot cooperation, which comprises an ROS system, wherein the ROS system comprises a Moveit and rviz toolkit, a human-computer interaction unit and a planning result processing unit;
the human-computer interaction unit provides a human-computer interaction interface and is used for inputting task information of the double robots, processing the task information, calling a Moveit function to plan the motion of the double robots and transmitting a planning result of the pose information of the double robots to the planning result processing unit;
the planning result processing unit is used for receiving the motion planning result of the MoveIt function and issuing the motion planning result to the ROS system; and the rviz and man-machine interaction unit acquires a motion planning result and updates the position and posture information of the two robots.
Furthermore, the human-computer interaction unit at least has one ROS node and is responsible for subscribing pose information of the double robots, and by utilizing the pose information, the human-computer interaction unit sets initial pose information of the double robots and updates the pose information of the double robots in the motion process.
The invention also provides a motion planning system for dual-robot collaboration, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, the processor when executing the computer program implementing the method steps as described above.
On one hand, the invention provides a task-level teaching method which focuses on describing tasks but not specific actions, so that a user can finish teaching quickly, and on the other hand, the invention provides a set of system which can intuitively display the specific actions generated by the two robots after teaching, so that the user can conveniently evaluate the teaching quality.
Compared with the prior art, the invention has the following beneficial effects:
1. the invention realizes the programming of the double robots under the ROS platform. The ROS is an open source framework specially used for the robot, tool software provided by the ROS is used for designing, the development period is short, the cost is low, and subsequent functions and maintenance are convenient to add.
2. The invention has good universality and expansibility. The invention can be applied to various robot systems of different models. Through the output planning result file, the user can optimize the planning result and apply the planning result to a real double-robot system.
3. The invention is convenient for teaching. The invention does not need to specify the specific motion track points of the double robots, but utilizes the set operation objects to guide the double robots to execute a series of actions. The user only needs to inform each robot which operation is carried out on the operation object, the motion trail is obtained by the automatic planning of the system, and therefore the teaching workload is greatly reduced.
Detailed Description
The invention is further explained below with reference to the drawings and the embodiments.
It should be noted that the following detailed description is exemplary and is intended to provide further explanation of the disclosure. Unless defined otherwise, all technical and scientific terms used herein have the same meaning as commonly understood by one of ordinary skill in the art to which this application belongs.
It is noted that the terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting of example embodiments according to the present application. As used herein, the singular forms "a", "an" and "the" are intended to include the plural forms as well, and it should be understood that when the terms "comprises" and/or "comprising" are used in this specification, they specify the presence of stated features, steps, operations, devices, components, and/or combinations thereof, unless the context clearly indicates otherwise.
As shown in fig. 1 and 2, the present embodiment provides a motion planning method for two-robot cooperation, including the following steps:
in an ROS system, establishing a model description file of the double robots and the working environment and a Moveit configuration file of the double robots;
carrying out initialization setting, creating an operation object, creating a double-arm instruction by taking the operation object as a parameter, and arranging actions of the double robots for executing tasks;
analyzing the double-arm instructions one by one, calling a MoveIt function to plan the movement of the instructions, and storing and issuing a planning result; if there is a wrong instruction in the planning, the analysis and planning are stopped.
In this embodiment, the initialization setting specifically includes: loading a human-computer interaction unit, a planning result processing unit, an rviz node and a main node move _ group of Moveit in an ROS system, and displaying models of the double robots and the working environment thereof in the rviz node; setting an initial point of the double robots in the man-machine interaction unit.
In this embodiment, the analyzing the two-arm instructions one by one, calling a MoveIt function to plan the movement of the instructions, storing and issuing the plan result, and stopping analyzing and planning if there is an instruction with a wrong plan specifically includes the following steps:
step S1: judging whether the planning result of the current double-arm instruction exceeds a preset motion range or whether collision occurs, if so, judging that the planning of the instruction is wrong, and ending the analysis and planning, otherwise, entering the step S2;
step S2: and storing and issuing the planning result of the current double-arm command, judging whether all double-arm commands are analyzed, if so, finishing the analysis and planning, and otherwise, returning to the step S1.
In this embodiment, the planning result of storing and issuing the current dual-arm command specifically includes: and at least one ROS node is arranged in the planning result processing unit and is responsible for receiving the motion planning result and issuing pose information of the double robots, and meanwhile, the motion planning result is written into a file for storage. Each time the double robots execute a task, a file for storing the motion planning result is generated.
In this embodiment, the type of the operation object includes an object to be operated and a mark point, and the object to be operated is a simplified simple geometric body of an object including parts, accessories and tools, which is taken by a double robot in the process of executing a task; the marking point is a specific point which must be passed or reached in the process of the movement of the double robots; when an object to be operated is created, the input parameters are the size of a geometric body and the pose of the object; when a mark point is created, the input parameter is the position and posture of the point; and the man-machine interaction unit respectively numbers the generated object to be operated and the mark points.
In this embodiment, a task is composed of a plurality of two-arm commands, each two-arm command is composed of two single-arm commands, and each robot executes one single-arm command.
In this embodiment, the types of instructions include move, insert, rotate, stall, grab, and place; when a moving instruction is used, a marking point is required to be appointed to serve as a target point reached by the end effector; when an insertion instruction is used, a marking point is required to be appointed as an insertion termination point; when a rotation instruction is used, a mark point is required to be appointed as a rotation termination point; when the pause instruction is used, the pause time needs to be specified; when the clamping instruction is used, the clamping object and the extending direction and the taking direction of the end effector need to be specified; when the placement command is used, a marking point is designated as an object placement point and the insertion and removal directions of the end effector.
The embodiment also provides a system based on the motion planning method for the double-robot cooperation, which comprises an ROS system, wherein the ROS system comprises a Moveit and rviz toolkit, a human-computer interaction unit and a planning result processing unit;
the human-computer interaction unit provides a human-computer interaction interface and is used for inputting task information of the double robots, processing the task information, calling a Moveit function to plan the motion of the double robots and transmitting a planning result of the pose information of the double robots to the planning result processing unit;
the planning result processing unit is used for receiving the motion planning result of the MoveIt function and issuing the motion planning result to the ROS system; and the rviz and man-machine interaction unit acquires a motion planning result and updates the position and posture information of the two robots.
Preferably, the present embodiment first installs the Ubuntu operating system in the computer, and installs the robot operating system ROS in the Ubuntu operating system. As shown in fig. 2, the ROS includes MoveIt and rviz toolkits, and further includes a human-computer interaction unit and a planning result processing unit.
The human-computer interaction unit comprises a human-computer interaction interface, an operation object manager, a coordinate transformation module, an instruction analysis module and an interaction node. Wherein:
the man-machine interaction interface is compiled by using Qt, and in the interface, a user can input task information (including inputting an operation object, creating and arranging a double-arm instruction sequence) of the double robots, check pose information of the double robots and set the start and stop of tasks;
the operation object manager is used for storing the input operation object, calling an ROS function to display the object to be operated in the rviz, and providing a series of interfaces for other modules to access the operation object, such as creation, deletion, parameter modification, parameter acquisition and the like;
the coordinate transformation module provides a positive and negative kinematics algorithm interface of the robot and also provides an interface for converting points among a tool coordinate system, a tail end shaft coordinate system, a left arm reference coordinate system and a right arm reference coordinate system;
the instruction analysis module is responsible for storing a double-arm instruction sequence arranged by a user, taking out the double-arm instructions one by one after a task is started to be executed, calling the coordinate transformation module to process an operation object contained in the double-arm instruction into an actual target parameter, and calling a MoveIt function to carry out motion planning on the instruction;
the interactive node is a sub-thread in the human-computer interaction unit and is responsible for sending a motion planning request to a move _ group of the Moveit, and a message subscriber is further provided and is used for receiving track point sequence messages of the JointState type from the ROS, wherein the track point sequence messages are processed by the coordinate transformation module and then are changed into pose information of the double robots to be updated in the human-computer interaction interface.
The planning result processing unit comprises a track receiving node, a file management module and a joint message publisher. Wherein:
the track receiving node provides an action server for receiving a message of a FollowJointTracjector type, wherein the message of the FollowJointTracjector type is a motion planning result sent by the move _ group node, and the motion planning result is a track and is represented as a sequence of joint angles and motion time of a group of double robots. After receiving a track, the track receiving node splits the track into the motion tracks of the left arm and the right arm and then transmits the motion tracks to the file management module and the joint message publisher;
the file management module is responsible for creating or opening a text file, reading and writing track information into the file, and sending the read track information to the joint message publisher;
and the joint message publisher is responsible for converting the received track information into a JointState type message and publishing the JointState type message to the ROS.
With the above system, the using method of the embodiment specifically includes the following steps:
step 1: an assembly drawing of the double robots and the working environment thereof is established in the SolidWorks, and the assembly is guided into a urdf file by using a SolidWorks plug-in sw _ urdf _ exporter. In the ROS, the configuration assistant of the Moveit is used for importing the urdf file, and after a series of configuration work, the Moveit configuration file of the two robots is generated.
Step 2: loading the urdf file and the configuration file in the step 1 in the ROS, and then starting sequentially: the system comprises a planning result processing unit, a main node move _ group of MoveIt, an rviz node and a human-computer interaction unit; setting an initial point of the double robots in the man-machine interaction unit.
And step 3: a user creates a plurality of operation objects in the man-machine interaction unit, wherein the operation objects comprise objects to be operated and mark points.
And 4, step 4: and creating a plurality of double-arm commands to form an action process of the double-robot executing the task, and calling an operation object and setting a plurality of other parameters in each double-arm command.
And 5: clicking an 'execution' button on a human-computer interaction interface, analyzing the double-arm operation instructions one by the human-computer interaction unit, and calling a function interface of MoveIt one by one. And Moveit performs motion planning through the move _ group node and packages the motion planning result into a FollowJointTracerory message to be sent to the planning result processing unit. If the motion planning of a certain instruction is wrong, for example, the target point exceeds the motion range or collision is generated in the motion process, the analysis and the planning are stopped, and the mistake is displayed on the human-computer interaction interface, otherwise, the next step is carried out.
Step 6: and the planning result processing unit receives the FollowJointTracory message, splits the FollowJointTracory message into the motion tracks of the left arm and the right arm, writes the motion tracks into a text file for storage, and converts the motion planning result into a JointState type message by using a joint message publisher and publishes the JointState type message on the ROS. After the rviz subscribes to the message, the motion process of the double robots is displayed; after the man-machine interaction unit subscribes the message, the pose information of the double robots is updated in the interface.
And 7: if the double-arm instruction is completely analyzed, the task execution is completed, otherwise, the step 5 is returned to analyze the next instruction.
In this embodiment, the human-computer interaction unit has one ROS node, i.e. the interaction node. Setting initial points of the double robots in the man-machine interaction unit has two methods, namely, directly inputting a group of pose data into the man-machine interaction interface by a user, importing the track point sequence file generated by the planning result processing unit, and taking the information of the last point in the file as the initial point of the double robots at this time.
In this embodiment, each time the two robots execute a task, a text file is generated to store all track point sequences of the task. The planning result processing unit is provided with two ROS nodes, one node is responsible for receiving FollowJointTracory messages from the move _ group node, and the other node is used for converting the FollowJointTracory messages into JointState messages and issuing the JointState messages to the ROS.
In this embodiment, the operation object includes an object to be operated and a mark point, the object to be operated is a simple geometric body obtained by simplifying objects such as various parts, accessories, tools, and the like, which are taken by a double robot in a task execution process, and the types of the simple geometric body include: cuboid, sphere, cylinder, cone. The mark point is a specific point which must be passed or reached in the process of the movement of the double robots. When an object to be operated is created, the input parameters are a geometric size and a geometric pose, wherein the size of a cuboid is represented by three parameters (length, width and height), the size of a sphere is represented by one parameter (sphere radius), a cylinder and a cone are represented by two parameters (height and bottom radius), and the geometric pose is represented by 7 parameters, namely a coordinate X, Y, Z of an object centroid under a base coordinate system and quaternions qx, qy, qz and qw; when the mark point is created, the input parameter is the position and posture of the point, the position and posture of the point are represented by 7 parameters, namely the coordinate X, Y, Z of the point under the base coordinate system and the posture quaternion qx, qy, qz and qw of the tool coordinate system when the robot moves to the point. And the man-machine interaction unit generates an operation object through the operation object manager and numbers the object to be operated and the mark points respectively so as to be called by the double-arm instruction.
In this embodiment, there are six types of the single-arm commands: move (move), insert (insert), rotate (rotate), pause (hold), pick (pick), place (place). When a move (move) instruction is used, 1 marking point is used as a parameter to represent a target point reached by the end effector; when an insert (insert) instruction is used, 1 mark point is used as a parameter to represent an insert termination point; when a rotation (rotate) instruction is used, 1 mark point is used as a parameter to represent a rotation termination point; when a pause (hold) instruction is used, 1 parameter is required to be input, namely pause time; when a clamping (pick) instruction is used, 3 parameters are needed, namely 1 parameter of an object to be operated to specify a clamped object, the extending direction of 1 end effector and the taking direction of 1 end effector; when a place command is used, 3 parameters are needed, namely 1 marker parameter to specify a place point of an object, a placing direction of 1 end effector and a removing direction of 1 end effector. The direction is represented by a vector under the base coordinate system.
The present embodiment also provides a motion planning system for dual-robot collaboration, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, which when executed implements the method steps as described above.
In summary, in the present embodiment, on one hand, a task-level teaching method is provided that focuses on describing tasks rather than specific actions, so that a user can complete teaching faster, and on the other hand, the present invention provides a set of system that intuitively displays specific actions generated by two robots after teaching, so that the user can conveniently evaluate the teaching quality.
As will be appreciated by one skilled in the art, embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the application. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
The foregoing is directed to preferred embodiments of the present invention, other and further embodiments of the invention may be devised without departing from the basic scope thereof, and the scope thereof is determined by the claims that follow. However, any simple modification, equivalent change and modification of the above embodiments according to the technical essence of the present invention are within the protection scope of the technical solution of the present invention.