1. Technical Field
The present invention relates to a collision detection system, a collision detection data generator, a robot, or the like.
2. Related Art
Determinations as to whether or not there is a collision between objects or proximity to each other are required in many fields. For example, in a field of robots or the like, occurrence of collisions is an enormous problem. Accordingly, in related art, techniques of determining whether or not a collision or proximity beyond an acceptable level is to occur by calculation using a computer before the collision actually occurs have been studied and developed. As a related art of the collision determination technique, for example, a technology disclosed in Patent Document 1 (JP-A-11-250122) or the like has been known.
In the technique of Patent Document 1, an object is represented by polygon data, the respective polygons of the polygon data are covered by spheres having predetermined radii, those spheres are integrated into spheres having the larger radii, and the data of the spheres is configured as data having a binary tree structure representing the integration relations among the spheres. Further, collision determinations are sequentially performed on the data having the binary tree structure with respect to each layer, and thereby, a collision determination between objects is performed.
In the technique of performing collision detection using polygon data like Patent Document 1, CAD (Computer Aided Design) data of the objects to be detected is necessary. However, in practice, a lot of objects without CAD data and objects without available CAD data exist, and there is a problem that it is difficult to apply the technique to the objects.
An advantage of some aspects of the invention is to provide a collision detection system that can perform collision detection even in the case where polygon data of objects are not available or the like, a collision detection data generator, a robot system, a robot, a method of generating collision detection data, a program, or the like.
An aspect of the invention relates to a collision detection system including a memory unit that stores first collision detection data corresponding to a first object and second collision detection data corresponding to a second object as collision detection data of the objects, and a processing unit that performs a collision determination between the first object and the second object in the world coordinate system based on the first collision detection data and the second collision detection data, wherein the memory unit stores representative point data obtained by discretization of depth map data of the objects as seen from a predetermined viewpoint in model coordinate systems of the objects using cubic areas set in the model coordinate systems as the collision detection data.
According to the configuration, the representative point data obtained by discretization of the depth map data of the objects using the cubic areas set in the model coordinate systems is stored as the collision detection data in the memory unit, and the collision detection between the first object and the second object is performed based on the collision detection data. Thereby, even in the case where polygon data of the objects is unavailable or the like, collision detection may be performed.
In the aspect of the invention, the memory unit may store the representative point data of bounding boxes including the objects and divisional representative point data as the representative point data obtained by discretization of the depth map data using cubic areas formed by division of the bounding boxes as the collision detection data, and if determining a collision between the first bounding box including the first object and the second bounding box including the second object, the processing unit may perform the collision determination between the first object and the second object based on the divisional representative point data of the first object and the divisional representative point data of the second object.
According to the configuration, non-collision between the first object and the second object may be definitively determined at the stage of determination of non-collision between the bounding boxes, and thus, the collision determination in the smaller cubic areas may be omitted and the processing may be simplified.
In the aspect of the invention, the memory unit may store data having a tree structure as the collision detection data, and the data having the tree structure may have the representative point data corresponding to a plurality of cubic areas formed by division of a cubic area of a parent node as the representative point data of child nodes branching from the parent node.
According to the configuration, the collision detection may be sequentially performed with respect to each layer from the nodes of the upper layers to the nodes of the lower layers of the tree structure. By the recursive processing, the collision detection may be parallelized.
In the aspect of the invention, the plurality of cubic areas of the child nodes formed by division of the cubic area of the parent node may be 2×2×2 cubic areas obtained by division of the cubic area of the parent node as seen from the predetermined viewpoint into 2×2 areas and division of the respective areas of the 2×2 areas into two in a depth direction of the predetermined viewpoint, the data having the tree structure may be data having a quadtree structure in which the child nodes are set in correspondence with respective areas of the 2×2 areas as seen from the predetermined viewpoint, and the data of the child nodes in the quadtree structure may be the representative point data existing in at least one of the two cubic areas in the depth direction in the respective areas of the 2×2 areas.
The collision detection is performed based on the data having the quadtree structure, and thereby, the number of combinations of node pairs in the respective layers may be 4×4=16, and, for example, the collision detection system may be realized using a CPU (Central Processing Unit) for about several tens of threads or the like.
In the aspect of the invention, if the parent node determined to collide exists in the collision determination based on the data of the parent node, the processing unit may perform the collision determination based on the data of the child nodes branching from the parent node determined to collide, and if the parent node determined to collide does not exist in the collision determination based on the data of the parent node, the processing unit may definitively determine non-collision between the first object and the second object.
According to the configuration, recursive collision detection processing of sequentially performing collision detection with respect to each layer from the nodes of the upper layers to the nodes of the lower layers of the tree structure may be realized. Further, if there is a layer in which non-collision has been determined with respect to all combinations of node pairs, non-collision between the first object and the second object may be definitively determined at the stage of processing of the layer, and the processing may be simplified.
In the aspect of the invention, the depth map data may be depth map data generated by three-dimensional information measurement equipment that measures three-dimensional information of the objects.
Another aspect of the invention relates to a collision detection data generator including a depth map data acquisition unit that acquires depth map data of an object as seen from a predetermined viewpoint in a model coordinate system of the object, and a collision detection data generation unit that generates representative point data in the model coordinate system of the object as collision detection data, wherein the collision detection data generation unit generates the representative point data by discretization of the depth map data using cubic areas set in the model coordinate system of the object.
According to the aspect of the invention, the depth map data of the object is discretized using the cubic areas set in the model coordinate system and the representative point data is generated as the collision detection data by the discretization. The collision detection data is generated in this manner, and thereby, even when polygon data of the object is unavailable, collision detection may be performed.
In the aspect of the invention, the collision detection data generation unit may generate data having a tree structure as the collision detection data by connecting nodes corresponding to a plurality of cubic areas formed by division of a cubic area of a parent node as child nodes to the parent node.
In this manner, the data having the tree structure may be formed from the representative point data obtained by discretization of the depth map data. Further, the data having the tree structure is generated, and thereby, recursive parallel processing may be performed in the collision detection.
In the aspect of the invention, the plurality of cubic areas of the child nodes formed by division of the cubic area of the parent node may be 2×2×2 cubic areas obtained by division of the cubic area of the parent node as seen from the predetermined viewpoint into 2×2 areas and division of the respective areas of the 2×2 areas into two areas in a depth direction of the predetermined viewpoint, the collision detection data generation unit may generate data having a quadtree structure in which the child nodes are set in correspondence with the respective areas of the 2×2 areas as seen from the predetermined viewpoint as the data having the tree structure, and the data of the child nodes in the data having the quadtree structure may be the representative point data existing in at least one of the two cubic areas in the depth direction in the respective areas of the 2×2 areas.
According to the configuration, the child nodes are set in correspondence with the respective areas of the 2×2 areas as seen from the predetermined viewpoint, and thereby, the data having the quadtree structure may be formed from the representative point data obtained by discretization of the depth map data using the cubic areas.
In the aspect of the invention, if judging that there is a cubic area without representative point data between a representative point as a target of processing and representative points existing outside of the surrounding 26 adjacent cubic areas of the representative point as the target of processing, the collision detection data generation unit may complement the cubic area without the representative point data with the representative point data.
The collision detection data is generated in this manner, and thereby, erroneous detection such that non-collision is determined despite of a collision probability in the cubic areas without the representative point data may be suppressed.
In the aspect of the invention, when a depth value is larger as farther in the depth direction of the predetermined viewpoint, if determining that a difference value obtained by subtraction of a representative depth value of the representative points existing around the representative point as the target of processing from a representative depth value of the representative point as the target of processing is negative, the collision detection data generation unit complements the cubic area at the depth direction side with respect to the representative point as the target of processing with the representative point data.
According to the configuration, if the difference value is negative, the representative point exists at the deeper direction side than the representative point as the target of processing, and thus, the cubic area at the depth direction side with respect to the representative point data as the target of processing may be complemented with the representative point data.
In the aspect of the invention, the depth map data may be depth map data generated by three-dimensional information measurement equipment that measures three-dimensional information of the objects.
Still another aspect of the invention relates to a robot system including a robot having a movable unit, a memory unit that stores first collision detection data corresponding to a first object and second collision detection data corresponding to a second object as collision detection data of the objects, a processing unit that performs a collision determination between the first object and the second object in the world coordinate system based on the first collision detection data and the second collision detection data, and a control unit that controls a movement of the movable unit based on a result of the collision determination performed by the processing unit, wherein the memory unit stores representative point data obtained by discretization of depth map data of the objects as seen from a predetermined viewpoint in model coordinate systems of the objects using cubic areas set in the model coordinate systems as the collision detection data.
Yet another aspect of the invention relates to a robot including a movable unit, a memory unit that stores first collision detection data corresponding to a first object and second collision detection data corresponding to a second object as collision detection data of the objects, a processing unit that performs a collision determination between the first object and the second object in the world coordinate system based on the first collision detection data and the second collision detection data, and a control unit that controls a movement of the movable unit based on a result of the collision determination performed by the processing unit, wherein the memory unit stores representative point data obtained by discretization of depth map data of the objects as seen from a predetermined viewpoint in model coordinate systems of the objects using cubic areas set in the model coordinate systems as the collision detection data.
Still yet another aspect of the invention relates to a method of generating collision detection data including acquiring depth map data of an object as seen from a predetermined viewpoint in a model coordinate system of the object, discretizing the depth map data using cubic areas set in the model coordinate system of the object, and generating representative point data obtained by the discretization as the collision detection data.
Further another aspect of the invention relates to a program allowing a computer to function as a depth map data acquisition unit that acquires depth map data of an object as seen from a predetermined viewpoint in a model coordinate system of the object, and a collision detection data generation unit that generates representative point data in the model coordinate system of the object as collision detection data, wherein the collision detection data generation unit generates the representative point data by discretization of the depth map data using cubic areas set in the model coordinate system of the object.
The invention will be described with reference to the accompanying drawings, wherein like numbers reference like elements.
As below, embodiments of the invention will be explained. Note that the embodiments to be explained do not unduly limit the invention described in the appended claims, and all of the configurations to be explained in the embodiments are not necessarily essential as solving means of the invention.
In movements of a robot (manipulator), collisions with peripheral structures and peripheral devices, self-collisions, and collisions with other robots are enormously problematic. In a collision detection technique of the embodiment, the collisions are detected in advance by simulations.
As modes in which the collision detection technique of the embodiment is used, roughly, off-line use (prior confirmation) and run-time use (prediction, anticipation) are considered. In the off-line use, if the surrounding environment or the like is known and statistic and the movement of the robot is known, the collision is verified at creation of a system. On the other hand, in the run-time use, if the surrounding environment or the like dynamically changes (for example, if robots exist or a worker exists around), a collision is detected by a simulation prior to the actual movement of the robot.
In related art, as the collision detection technique in the robot, an algorithm on the assumption that polygon data of an object is available has been often used. The polygon data is CAD data representing the shape of the object by a combination of many polygons at design of the structure of the object or the like. However, there has been a problem that collision detection is performed on a wide variety of objects and, in practice, it is difficult to obtain CAD data with respect to all of them.
Further, the collision detection technique using polygon data in related art includes a technique of generating spherical data having a binary tree structure with respect to each polygon and performing collision detection using the data like the above described Patent Document 1. However, according to the technique, it is difficult to perform efficient collision detection because large volumes of unwanted collision detection data and unwanted collision detection processing are generated.
Specifically, the polygon data describing a real object does not necessarily include only the polygon data of the surface of the important object in the collision detection. The polygon data includes large volumes of polygon data representing the object interior, polygon data representing parts unseen from the outside of the object, or the like as the unimportant polygon data in the collision detection. If spherical data is generated in units of polygons from the polygon data, the data having the binary tree structure includes a large volume of spherical data irrelevant to the collision detection. Patent Document 1 does not refer to how to handle the unimportant polygon data in the collision detection, and the collision detection processing is also performed on the spherical data irrelevant to the collision detection and leads to inefficient processing.
Furthermore, the polygon data describing the real object includes polygons in a wide variety of sizes, and it is not efficient to handle them with the same algorithm. For example, many of the parts of the robot and the tools handled by the robot are thin rod-like objects, and the objects are represented by micro polygons. Further, many micro polygons are used for the complex shapes of the objects or the like. It is considered that the necessary size of the sphere covering the polygon is the size of about the acceptable range of proximity, and, if the structure represented by the smaller polygons is represented by data having a tree structure, the data becomes very redundant. Accordingly, though the micro structures are less important in collision detection, a large volume of unwanted collision detection processing is generated due to the micro structures.
The collision detection data generator includes a processing unit 110 and a memory unit 150. Further, the collision detection data generator may include an operation unit 170, an external I/F (interface) unit 180, an information storage medium 190. The collision detection data generator includes information processing equipment, for example, and the collision detection data generator is realized by hardware and programs of the information processing equipment.
The processing unit 110 performs various data generation processing, control processing, etc., and may be realized by various processors of CPU or the like, hardware such as a dedicated circuit (ASIC), and programs executed on the processors. The processing unit 110 includes a depth map data acquisition part 112, and a collision detection data generation part 114.
The depth map data acquisition part 112 performs processing of acquiring depth map data for generating collision detection data. Here, the depth map is a map represented by depth values of an object as seen from a predetermined viewpoint (for example, an infinite viewpoint) in which depth values in units of pixels are arranged in a matrix. To the depth map data acquisition part 112, for example, CAD data previously saved in the information storage medium 190 is input or measurement information from three-dimensional information measurement equipment (not shown, for example, a 3D scanner) is input via the external I/F unit 180. Then, the depth map data acquisition part 112 generates depth map data from the input CAD data and measurement information.
The collision detection data generation part 114 performs processing of generating data for use in collision detection processing from the depth map data. Specifically, as will be described with
The memory unit 150 serves as a work area for the processing unit 110 or the like, and may be realized by a memory such as RAN (SRAM, DRAM, or the like). The operation unit 170 is provided for a user to input various operation information. The external I/F unit 180 performs wired or wireless external communication processing of information or the like. The information storage medium 190 (computer-readable medium) stores programs and data and its function may be realized by an optical disk, an HDD, a memory, or the like. The processing unit 110 performs various processing of the embodiment based on the programs (data) stored in the information storage medium 190. That is, in the information storage medium 190, programs for allowing a computer (equipment including an operation unit, a processing unit, a memory unit, and an output unit) to function as the respective units of the embodiment (programs allowing the computer to execute processing of the respective units) are stored.
The collision detection system includes a processing unit 10 and a memory unit 50. Further, the collision detection system may include an operation unit 70, an external I/F (interface) unit 80, an information storage medium 90.
The memory unit 50 serves as a work area for the processing unit 10 or the like, and may be realized by a memory such as RAN (SRAM, DRAM, or the like). The memory unit 50 includes a representative point data memory part 52.
The representative point data memory part 52 stores the collision detection data generated by the collision detection data generator. For example, the collision detection data generator is formed separately from the collision detection system, and the collision detection data is stored in the information storage medium 90 via the external I/F unit 80. Further, when the collision detection processing is executed, the processing unit 10 develops the collision detection data of the information storage medium 90 in the RAM of the memory unit 50, and performs collision detection processing with reference to the data on the RAM. Note that the collision detection data generator may be integrally formed with the collision detection system. In this case, the processing unit 10 contains the depth map data acquisition part 112 and the collision detection data generation part 114, and the collision detection data generated by the processing unit 10 is stored in the information storage medium 90.
The processing unit 10 performs various determination processing, control processing, etc., and may be realized by various processors of CPU or the like, hardware such as a dedicated circuit (ASIC), and programs executed on the processors. The processing unit 10 includes an object space setting part 12 and a collision determination part 14.
The object space setting part 12 performs processing of arranging and setting a plurality of objects in an object space or the like. Specifically, locations and rotation angles of the objects in the world coordinate system are determined and the objects are arranged in the locations at the rotation angles. Here, the world coordinate system is a coordinate system set in the space in which the collision detection processing is performed, and set with respect to the objects as targets of collision detection in common. Further, the object refers to one formed by modeling of a collision detection target object such as a robot or a collision detected target object such as a peripheral structure or peripheral device. In the embodiment, model coordinate systems are respectively set for the respective objects, and the objects are represented by representative point data in the model coordinate systems. The object space setting part 12 arranges the objects in the world coordinate system by conversion of the coordinates of the representative point data in the model coordinate systems into the coordinates in the world coordinate system.
The collision determination part 14 performs collision determination processing between an object as a collision detection target (first object) and an object as a collision detected target (second object). Specifically, as will be described later with
The operation unit 70 is provided for a user to input various operation information. The external I/F unit 80 performs wired or wireless external communication processing of information or the like. The information storage medium 90 (computer-readable medium) stores programs and data and its function may be realized by an optical disk, an HDD, a memory, or the like. The processing unit 10 performs various processing of the embodiment based on the programs (data) stored in the information storage medium 90. That is, in the information storage medium 90, programs for allowing a computer (equipment including an operation unit, a processing unit, a memory unit, and an output unit) to function as the respective units of the embodiment (programs allowing the computer to execute processing of the respective units) are stored.
As described above, the collision detection data is generated by discretization of the depth map data using the cubic areas, and thereby, collision detection may be performed even for an object without available CAD data. Further, the representative point data includes only data representing important object surfaces for collision detection, and efficient collision detection processing may be performed. Furthermore, the representative point data is non-redundant data independent of the size of the polygons, and unwanted collision detection processing may be suppressed.
Here, the movable parts change (translate) the relative distance and position between objects by movements of the movable parts. For example, the robot 310 of the embodiment has the robot arm 320 and the hand 330 and, when work is performed by moving the robot arm 320 and the hand 330, the respective parts forming the robot arm 320 and the hand 330 and joints that joint the parts correspond to the movable parts. In this example, the hand 330 holds (or grasps, suctions) the object and the robot arm 320 and the hand 330 move, and thereby, the object held by the hand 330 and the object around the robot 310 (for example, structures, installed objects, parts, or the like) relatively translate. Or, the robot arm 320 and the hand 330 move, and thereby, the parts forming the robot arm 320 and the hand 330 and the objects around the robot 310 relatively translate or the parts and parts jointed by the joints of the robot arm 320 and the hand 330 relatively translate. In the embodiment, collision between objects translated by the movable parts is detected.
The collision detection system of the embodiment is provided in the controller 300 in
Note that, although
A technique of generating collision detection data in the embodiment will be explained. Note that, in
As shown in
The collision detection data generation part 114 discretizes the X-coordinates, the Y-coordinates, and the Z-coordinates at predetermined intervals, and discretizes the space in which the model coordinate system is set (hereinafter, appropriately referred to as “model space”) in cubic areas CA. The cubic areas CA are areas fixed with respect to the model space and the object OB, and set in the same location as seen from any of the six viewpoints.
The collision detection data generation part 114 scans the discretized model space along the direction DS (for example, +X-direction), and sets representative points PA in cubic areas CAH corresponding to the surface (outline) of the object OB. Specifically, when attention is focused on a column DIR of the cubic areas having the same XY-coordinates, as shown by A1, the representative point is set in the cubic area first intersecting with the object OB when the column DIR is seen from the viewpoints. Then, the processing is sequentially performed along the direction DS, and the representative points PA are set on the surface of the object OB as seen from the view points. The representative point is set to the center of gravity of the cubic area, for example, and expressed by the XYZ-coordinates of the center of gravity. The representative points PA is not set in the area corresponding to the rearmost surface in the depth map data. The rearmost surface is a surface at the depth farthest from the viewpoints in the depth range that may be represented by the depth value.
Here, the discretization in the model space corresponds to discretization of the depth values and their locations in the depth map data, and the representative depth values and the representative locations in the depth map data are determined in correspondence with the representative points in the model space. In the example of
As shown in
As shown by B1 in
Accordingly, as shown by E1 in
The collision detection data generation part 114 performs the complementary processing while performing scanning in the direction DS (for example, +X-direction), and complements the cubic areas without representative points as shown by B5, B6 in
In this manner, the representative point data by which the surface of the object OB is continuously covered is finally generated, and thereby, the collision probability with the object OB may be correctly detected. Note that the farther side (B1) of the representative point (B2 in
Here, in
As shown in
As shown in
In the processing with respect to each layer as has been explained, processing for one layer corresponds to three-dimensional vector quantization of the depth map. Further, the collision detection data corresponds to data with different quantization steps of the three-dimensional vector quantization integrated into the quadtree structure. The quantization step in the three-dimensional vector quantization corresponds to the size of the cubic area, and the data having the same quantization step is integrated as data of the same layer into the quadtree structure.
Note that the size ratio between the cubic areas CA, CB is not limited to twice, but may be three times, four times, or the like, for example. Further, in the above description, the case where the data is generated while the size of the cubic area is sequentially increased has been explained as an example, and the embodiment is not limited thereto, but data may be generated while the size of the cubic area is sequentially reduced (for example, to a half).
As shown in
Here, in the above described tree structure in which a plurality of child nodes are connected to a parent node, the generation in the parent-child relationship of the nodes is referred to as a layer of data. That is, in the parent-child relationship of the nodes, the nodes in the same generation are the nodes in the same layer. For example, in the example of
Specifically, as shown in
In this case, as shown in
Next, a technique of the collision detection performed by the collision detection system explained with reference to
As shown in
Specifically, as shown in
On the other hand, as shown in
As described above, the intersection determination of the spheres and the intersection determination of the cubic areas are combined, and thereby, the processing may be simplified. That is, when the spheres do not intersect, the process may be ended only with the intersection determination of the spheres as simpler processing than the intersection determination of the cubic areas. Note that, as above, whether or not the cubic areas intersect is determined if the determination that the spheres intersect has been made, however, in the embodiment, a collision between the cubic areas may be definitively determined when the determination that the spheres intersect is made. In this case, the processing may be further simplified.
If the determination that the cubic areas BA1, BA2 intersect is made in the intersection determination, the collision determination part 14 performs a collision determination in the cubic areas having the smaller size than those of the cubic areas BA1, BA2. That is, as shown in
Specifically, if determining non-intersection between cubic areas BH1, BH2 having the representative points closest to each other within the cubic areas BB1, BB2 and non-intersection between cubic areas BI1, BI2 having the representative points closest to each other within the cubic areas BB1, BC2, the collision determination part 14 definitively determines non-collision between the objects OB1, OB2. On the other hand, if cubic areas determined to intersect exist and the layer for determination is the lowermost layer of the quadtree structure, the part definitively determines a collision probability between the objects OB1, OB2.
Note that, in
That is, as shown in
In the collision determinations of the nodes NS1 to NV1, NJ2 to NM2, for example, suppose that the determination that the cubic areas of the nodes NT1, NK2 intersect is made. In the example of
As described above, in the collision detection technique using polygon data of related art, there has been a problem that many objects without available CAD data exist in practice, and the technique is difficult to be applied to the objects. Further, there have been problems that processing becomes redundant depending on the size of the polygons and unwanted processing is performed because many pieces of polygon data not important for the collision detection is contained.
In this regard, in the embodiment, as explained with reference to in
In addition, in the embodiment, the memory unit 50 stores the data of the representative points PA as the collision detection data, and the processing unit 10 performs the collision determination of the first object and the second object in the world coordinate system based on the first collision detection data corresponding to the first object and the second collision detection data corresponding to the second object. Here, the world coordinate system corresponds to a workspace of the robot or the like, for example, and the object as the target of collision detection is placed in the world coordinate system by coordinate conversion from the model coordinate system.
As described above, in the embodiment, the collision detection data may be generated from the depth map data, and thus, collision detection may be performed without CAD data. For example, if an object without CAD data exists among the objects as the targets of collision detection, the depth map data of the object is acquired using a 3D scanner or the like, and thereby, collision detection data may be created.
Further, the model space is discretized using the cubic areas, and thus, representative point data does not vary in size unlike the polygons, or redundant overlapping is not generated unlike the case where the polygons are covered by spheres. The processing load of the collision detection may be reduced using the non-redundant data. Furthermore, the representative points may be set only on the outer surface of the object using the depth map data, and thus, data of the interior of the object is not generated unlike the case of using the polygons, and unwanted processing not important for collision detection may be eliminated. In addition, the number of node pairs for collision detection is proportional to the square of the number of nodes, and thus, in the embodiment in which no redundant data or unwanted data is generated, speeding up of the processing may be expected.
Here, the node pair is a pair of nodes selected as a determination target of collision determination. When a collision determination between the first object OB1 and the second object OB2 explained with reference to
Further, in the embodiment, the memory unit 50 stores representative point data (node A in
In this manner, non-collision between the first object and the second object is definitively determined without processing of the divisional representative point data at the stage of determination of non-collision between the bounding boxes, and thereby, the processing may be simplified.
More specifically, the collision detection data generation part 114 connects the nodes (nodes F to I) corresponding to a plurality of cubic areas (areas F to I) formed by division of the cubic area (area B in
Using the data having the tree structure, recursive collision detection of node pairs becomes possible and, for example, parallel processing using a CPU or the like may be easily realized. Specifically, in the embodiment, the data having the quadtree structure is generated, and, using the data having the quadtree structure, collision detection of 4×4=16 node pairs is performed in each layer of the recursive collision detection. Accordingly, without using a GPU (Graphics Processing Unit) capable of performing several tens to hundreds of thousands parallel processing, the collision detection system may be realized using a CPU that performs parallel processing of about several tens of threads and the cost reduction by omission of the GPU may be realized.
Note that the data having the tree structure in the embodiment is not limited to the data having the quadtree structure, but may be data in which nodes of the minimum cubic areas are directly connected to the nodes of the bounding boxes (without intermediate layers), for example. In this case, the number of combinations of node pairs of the minimum cubic areas is larger, and formation of the collision detection system using the GPU is assumed.
The representative point setting part 200 performs processing of discretizing a model space and setting representative points, and includes a space discretization part 202, a representative point selection part 204, a representative point complementation part 206, and a representative point overlapping deletion part 208. Note that the representative point setting part 200 and the quadtree structure generation part 220 correspond to the collision detection data generation part 114 in
Next, a detailed processing example of the collision detection data generator will be explained using flowcharts in
As shown in
Then, the space discretization part 202 sets the length of one side of the cubic area of the root node (the maximum discretized value) as a discretized value S1 (step S2). Then, the space discretization part 202 determines whether or not the discretized value SI is smaller than a preset predetermined minimum value (step S3). The predetermined minimum value is set to a value smaller than a tolerance, for example, in consideration of the location grasp accuracy of the robot or the like. If the discretized value SI is smaller than the predetermined minimum value, data is stored in the corresponding memory part of the representative point data memory parts MA1 to MAN, and the data generation processing is ended. If the discretized value SI is equal to or larger than the predetermined minimum value, data generation processing for one layer of the quadtree structure is performed (step S4). The detail of the data generation processing for one layer will be described later.
Then, the quadtree structure generation part 220 determines whether or not an upper layer than the layer for which the data is generated at step S4 exists (step S5). If the upper layer exists, the quadtree structure generation part 220 performs processing of forming the data generated at step S4 in a quadtree structure (step S6), and the space discretization part 202 executes step S7. The detail of quadtree structure generation processing will be described later. If the upper layer does not exist, the space discretization part 202 updates the discretized value SI to a half value (step S7), and executes step S3 again.
When the processing is started, the space discretization part 202 sets the discretized value SI of the model space (step S20). Then, the space discretization part 202 determines whether or not setting processing of the representative points has been performed with respect to all of the viewpoints (step S21). If unprocessed viewpoints exist, the part selects one viewpoint from the unprocessed viewpoints (step S22). Then, the space discretization part 202 discretizes the depth map data using the cubic areas with one side having the length of the discretized value SI (step S23).
Then, the representative point selection part 204 scans the discretized depth map data and sets the representative points (step S24). Then, the representative point selection part 204 deletes the representative point data on the rearmost surface in the depth map (step S25). The representative point data on the rearmost surface includes representative points having the maximum depth values (or around the values) in the depth value range that can be taken.
Then, the representative point complementation part 206 scans the set representative points and, if the representative points are not continuously set between the representative points and representative points outside of 26 adjacent areas of the representative points, complements the rear surface side (the side with the larger depth values, for example, the −Z-direction side in
At step S21, if the representative points have been set with respect to all of the viewpoints, the representative point overlapping deletion part 208 determines whether or not processing of deleting the overlapping representative points among the representative points of the viewpoints has been performed on all representative points (step S27). If unprocessed representative points exist, the representative point overlapping deletion part 208 selects one representative point from the unprocessed representative points (step S28). The representative point overlapping deletion part 208 compares the selected representative point with all other representative points and, if the same representative point exists, deletes the same representative point (step S29), and executes step S27. At step S27, if the processing has been finished with respect to all representative points, the part ends the data generation processing for one layer.
Then, the quadtree structure generation part 220 determines whether or not the processing has been performed with respect to all representative points of the upper layers (step S43). For example, when the nodes F to V in
Then, the quadtree structure generation part 220 determines whether or not setting processing of the representative point data has been performed with respect to all of the four child nodes (step S46). If the processing has been finished with respect to all of the four child nodes, the part executes step S43. If unprocessed child nodes exist, the quadtree structure generation part 220 selects one child node from the unprocessed child nodes (step S47). Then, the quadtree structure generation part 220 detects the representative point existing in the representative location of the selected child node (step S48).
Then, the part determines whether or not the representative point has been detected in the representative location of the selected child node (step S49). If the representative point has been detected, the quadtree structure generation part 220 connects all of the detected representative points to the child nodes (step S50). For example, when the node Fxy in
Note that the representative point data selection part 250, the recursive node-pair collision detection part 260, and the collision determination output part 270 correspond to the collision determination part 14 and the object space setting part 12 in
Then, the detailed processing example of the collision detection system will be explained using flowcharts in
As shown in
Then, the recursive node-pair collision detection part 260 sets the uppermost node of the first object to a node N1 and sets the uppermost node of the second object to a node N2 (step S62). Then, the recursive node-pair collision detection part 260 performs recursive node-pair collision detection processing on the nodes N1, N2 (step S63). The details of the recursive node-pair collision detection processing will be described later. Then, the collision determination output part 270 outputs a collision determination result, and the processing unit 10 performs various processing in response to the collision determination result (step S64). For example, if a collision is determined, the processing unit 10 performs processing of correcting the trajectory of the object, processing of stopping the movement, or the like for prevention of the collision. If step S64 is finished, the part executes step S60. At step S60, if the processing has been finished with respect to all combinations of objects, the part ends the collision detection processing.
If the child node of the node N1 exists, the recursive node-pair collision detection part 260 determines whether or not a child node of the node N2 exists (step S83). If the child node of the node N2 exists, the part recursively performs collision detection of the node pairs with respect to all combinations of the child nodes of the nodes N1, N2 (step S84). That is, if a combination in which the cubic areas overlap (for example, nodes NE1, NC1 in
If no child node of the node N1 exists at step S82, the recursive node-pair collision detection part 260 determines whether or not a child node of the node N2 exists (step S86). If the child node of the node N2 exists, the part recursively performs collision detection of the node pairs with respect to all combinations of the node N1 and the child nodes of the node N2 (step S87). If no child node of the node N2 exists, the part determines a collision probability between the nodes N1, N2, and ends the processing.
If steps S84, S85, S87 are executed, the recursive node-pair collision detection part 260 determines whether or not a collision has been detected for the node pair of the lowermost layer in the recursive node-pair collision detection (step S88), and outputs the determination result and ends the processing.
Note that the embodiment has been explained in detail as described above, and a person who skilled in the art could easily understand that many modifications without substantially departing from the new matter and the advantages of the invention may be made. Accordingly, the modifications may be within the scope of the invention. For example, in the specification or the drawings, the terms described with different broader or synonymous terms at least once may be replaced by the different terms in any part of the specification or the drawings. Further, all combinations of the embodiment and the modified examples may be within the scope of the invention. Furthermore, the configuration and the operation of the collision detection data generator and the collision detection system, the technique of generating the collision detection data, the technique of collision detection, etc. are not limited those explained in the embodiment, but various modifications may be implemented.
The entire disclosure of Japanese Patent Application No. 2012-161281, filed Jul. 20, 2012 is expressly incorporated by reference herein.
Number | Date | Country | Kind |
---|---|---|---|
2012-161281 | Jul 2012 | JP | national |