Background
The existing robot chassis is mostly subjected to environment sensing, such as positioning and composition, by laser sensors, and therefore in order to guarantee a laser detection range, a laser installation area is emptied of shielding parts as far as possible.
However, due to the fact that the upper layer of the chassis needs to be supported and special marks are made for the purpose of being convenient to identify between the robots, certain shielding is caused to the laser, and the part of data influences both composition and robot positioning.
Disclosure of Invention
According to an embodiment of the present disclosure, a robot structure detection scheme based on a laser sensor is provided.
In a first aspect of the present disclosure, a method for detecting a robot structure based on a laser sensor is provided. The method comprises the following steps: receiving a laser data frame;
comparing the currently received laser data frame with the last stored available laser data frame, and if the changed numerical value is greater than a preset moving threshold value, taking the currently received laser data frame as an available laser frame;
acquiring a preset acquisition number of available laser frames, and screening out robot body structure data according to the variance of the preset acquisition number of available laser frames;
and carrying out segmentation processing on the robot body structure data to determine the robot body structure.
Optionally, the comparing the currently received laser data frame with the last stored available laser data frame, and if the changed value is greater than the preset moving threshold, taking the currently received laser data frame as the available laser frame includes:
respectively storing the acquired first frame of laser data into an available laser frame container and a structural body of reference laser data;
continuously acquiring a laser data frame, comparing the currently acquired laser data frame with a laser data frame stored in the structural body of the reference laser data, and if the changed numerical value is greater than a moving threshold, taking the currently acquired laser data frame as an available laser frame;
storing the currently-acquired laser data frame as an available laser frame into the available laser frame container, and replacing laser frame data in the structure of reference laser data with the currently-acquired laser data frame as an available laser frame.
Optionally, if the changed number is smaller than the moving threshold, moving the robot and reacquiring the laser data frame.
Optionally, the comparing the currently acquired laser data frame with the laser data frame stored in the structural body of the reference laser data includes:
comparing the currently acquired laser data frame with the laser data frame stored in the structural body of the reference laser data;
and if the distance difference in the same direction exceeds the dynamic distance threshold, judging that the currently acquired laser data frame is a changed frame, and acquiring the number of changed values of the changed frame.
Optionally, the acquiring of the available laser frames with the preset acquisition number, and screening out the robot body structure data according to the variance of the available laser frames with the preset acquisition number includes:
extracting available laser frames with the same measurement direction and preset collection number from the available laser frame container;
calculating the variance of the available laser frames with the same measurement direction of the preset collection number;
screening the value of the variance, wherein if the value of the variance is smaller than a variance threshold value, the value of the variance corresponds to the structural data of the robot body;
comparing the robot ontology structure data with a robot ontology structure limit threshold;
if the robot body structure data is smaller than the robot body structure limit threshold, setting the value of the variance corresponding to the robot body structure data to be 1, and storing the value into a structural body of the robot body structure data;
and if the robot body structure data is larger than or equal to the robot body structure limit threshold, setting the value of the variance corresponding to the robot body structure data to be 0, and storing the value into a structural body of the robot body structure data.
Optionally, the segmenting the robot ontology structure data, and determining the robot ontology structure includes:
carrying out sectional processing on data in the structural body of the preset robot body structural data, and dividing the structural body which is continuously 1 into one section;
expanding the two ends of each section outwards by a number with a preset expansion threshold value of 1;
and merging the expanded data segments to determine the robot body structure.
There is further provided an implementation of the above-described aspects and any possible implementations.
In a second aspect of the present disclosure, a laser sensor based robotic structure detecting device is provided. The device includes:
the receiving module is used for receiving the laser data frame;
the comparison module is used for comparing the currently received laser data frame with the last stored available laser data frame, and if the changed numerical value is greater than a preset moving threshold value, the currently received laser data frame is used as the available laser frame;
the screening module is used for acquiring the available laser frames with the preset acquisition number and screening out the structural data of the robot body according to the variance of the available laser frames with the preset acquisition number;
and the determining module is used for carrying out segmentation processing on the robot body structure data to determine the robot body structure.
In a third aspect of the disclosure, an electronic device is provided. The electronic device includes: a memory having a computer program stored thereon and a processor implementing the method as described above when executing the program.
In a fourth aspect of the present disclosure, a computer readable storage medium is provided, having stored thereon a computer program, which when executed by a processor, implements a method as in accordance with the first aspect of the present disclosure.
According to the robot structure detection method based on the laser sensor, provided by the embodiment of the application, the laser data frame is received; comparing the currently received laser data frame with the last stored available laser data frame, and if the changed numerical value is greater than a preset moving threshold value, taking the currently received laser data frame as an available laser frame; acquiring a preset acquisition number of available laser frames, and screening out robot body structure data according to the variance of the preset acquisition number of available laser frames; and carrying out segmentation processing on the robot body structure data to determine the robot body structure. Invalid data returned by the structure can be filtered, effective sensing of the laser sensor to the environment is guaranteed, and detection accuracy of the robot is improved.
It should be understood that the statements herein reciting aspects are not intended to limit the critical or essential features of the embodiments of the present disclosure, nor are they intended to limit the scope of the present disclosure. Other features of the present disclosure will become apparent from the following description.
Detailed Description
To make the objects, technical solutions and advantages of the embodiments of the present disclosure more clear, the technical solutions of the embodiments of the present disclosure will be described clearly and completely with reference to the drawings in the embodiments of the present disclosure, and it is obvious that the described embodiments are some, but not all embodiments of the present disclosure. All other embodiments, which can be derived by a person skilled in the art from the embodiments disclosed herein without making any creative effort, shall fall within the protection scope of the present disclosure.
In addition, the term "and/or" herein is only one kind of association relationship describing an associated object, and means that there may be three kinds of relationships, for example, a and/or B, which may mean: a exists alone, A and B exist simultaneously, and B exists alone. In addition, the character "/" herein generally indicates that the former and latter related objects are in an "or" relationship.
In this disclosure, (this embodiment and its advantages may be summarized simply by one paragraph, possibly not simply repeated with the claims).
Fig. 1 shows a flow diagram of laser sensor based robotic structure detection according to an embodiment of the present disclosure.
S110, receiving the laser data frame.
The robot is provided with a laser sensor.
Optionally, the laser sensor includes a rotatable transmitting device, the transmitting device emits a laser beam after rotating a certain angle, the emitted laser beam is reflected after encountering an object, and the reflected light is received by the optical receiving system, so that the distance from the laser scanner to the object can be measured.
The laser data frame is received when the robot starts to perform a task (start), i.e., performs a rotation, displacement operation (move).
Optionally, the laser data frame includes a first frame of laser data received after the robot is started and laser data received after the robot moves.
And S120, comparing the currently received laser data frame with the last stored available laser data frame, and if the changed value is greater than a preset moving threshold value, taking the currently received laser data frame as the available laser frame.
Optionally, setting an available laser frame container valid _ vecPnt for accessing laser frame data when the robot changes;
setting a structure refer _ Stru of reference laser data for comparison between laser frame data;
setting a dynamic distance threshold value P0 for defining whether the current laser data is a variation value or not, and avoiding position variation caused by the self-bounce of the laser data, wherein the value range of P0 is generally 10-30cm, for example 15 cm;
setting a movement threshold P1 for judging whether the current laser data meets the large-amplitude movement condition, wherein the value range of P1 is generally 1/3-1/2 of the currently used laser sensor for collecting points, for example, when the laser sensor collects the points as 3000, the value of P1 can be 1000 or 1500;
optionally, storing the received first frame of laser data into the valid _ vecPnt and the refer _ Stru, respectively;
continuously receiving laser data frames, comparing the currently received laser data frames with the laser data frames stored in the refer _ Stru, if the distance difference in the same direction exceeds P0, judging the currently obtained laser data frames as changed frames, and obtaining the number of changed values of the changed frames; that is, the positions of the light spots in the currently acquired laser data frame (in this embodiment, one frame of laser data has about 3000 light spots) and the positions of the light spots in the laser data frame stored in the refer _ Stru are compared one by one, and if the offset difference (misalignment) of the light spot positions in the same direction exceeds P0, it is determined that the currently acquired laser data frame is a changed frame (displacement change occurs), and the number of changed values, that is, the number of misaligned light spots, is acquired;
if the changed number (number of misaligned spots) is greater than P1, the currently-acquired laser data frame is used as an available laser frame, the currently-acquired laser data frame as an available laser frame is stored in the valid _ vecPnt, and the currently-acquired laser data frame as an available laser frame is substituted for the laser frame data in the defer _ Stru.
And if the changed numerical value is less than or equal to the P1, moving the robot, and acquiring the laser data frame again, wherein the valid _ vecPnt and the defer _ Stru do not change any value.
S130, acquiring the available laser frames with the preset acquisition number, and screening out the structural data of the robot body according to the variance of the available laser frames with the preset acquisition number.
And receiving available laser frames and judging the chassis structure.
An acquisition available laser frame threshold P2 is set for defining the number of laser data acquisitions. The value range of P2 is generally a positive integer greater than or equal to 50, for example, 50, that is, usually 50 frames are selected to meet the requirement of structure detection.
A structural body robstru _ Stru for storing the structural data of the robot body is arranged and used for representing the structure of the robot body.
And setting a structural body var _ Stru for storing laser data variance data, wherein the structural body var _ Stru is used for storing the variance data calculated by the available laser frame calculation.
A variance threshold P3 is set for defining whether the numerical representation is a robot body structure. The value range of the P3 is generally 5-20 cm. For example 10 cm.
And setting a robot body structure limit threshold P4 for filtering data exceeding the threshold. Generally, the radius of the robot body is not too large, so that one piece of data is set to restrict the detected structure value. The value range of the P4 is generally 1-3 m.
Optionally, step S120 is repeated until the number of available laser data frames acquired reaches said P2. That is, step 120 is repeated, and when the number of available laser frames stored in the valid _ vecPnt reaches P2, data acquisition is stopped, and most of the laser frames (available laser frames) in the container are key frames with large changes, which have satisfied the data demand for laser structure determination.
Optionally, all available laser frames with the same measurement direction are extracted from the valid _ vecPnt respectively;
calculating the variance of all available laser frames with the same measurement direction, and storing the value of the variance into the var _ Stru;
extracting variance data from the var _ Stru, screening the variance value, and if the variance value is smaller than the P3, the variance value corresponds to the robot body structure data;
comparing the robot ontology structural data with the P4;
if the robot body structure data is smaller than the P4, setting the value of the variance corresponding to the robot body structure data to be 1, and storing the variance into the robstru _ Stru;
and if the robot body structure data is greater than or equal to the P4, setting the value of the variance corresponding to the robot body structure data to be 0, and storing the variance into the robstru _ Stru.
Optionally, in the robstru _ Stru, 1 represents a robot body structure, and 0 represents no structural occlusion in this direction.
And S140, carrying out segmentation processing on the robot body structure data to determine the robot body structure.
When the laser spot hits an edge object, the laser data is unstable and the variance is too large, that is, the detection is not accurate.
Therefore, in this embodiment, the robot body structure data obtained in step S130 is segmented, and both ends of the segmented data are expanded by a certain area, so as to solve this problem.
Specifically, a structural body final _ robstru _ Stru for storing the structural data of the robot body is arranged and used for representing the structure of the robot body;
setting an expansion threshold P5 for filling the structural edge of the robot body; the P5 is determined according to the angular resolution of the laser sensor of the robot arrangement, typically extended by 3-5 °, e.g. 4 °. That is, the number of points that can be extended according to the angular resolution (P5);
and carrying out segmentation processing on the data in the robstru _ Stru, and dividing the data which is continuously 1 into one segment. And expands the P5 numbers with a value of 1 outwards for both ends of each segment. And finally, merging the expanded data segments together and saving the merged data segments into the final _ robstru _ Stru (a final robot body structure table), and determining the robot body structure.
It should be noted that the range and/or number of the threshold values (parameters) set in the present embodiment may be set according to the actual application scenario and/or the type of the robot.
According to the robot structure detection method based on the laser sensor, whether the robot moves in a large direction or not is detected through the laser, if the robot moves in the large direction, the currently received laser frame is judged to be an available laser frame, a certain threshold number of available laser frames are received, variance is calculated, robot body structure data are screened out, the robot body structure data are subjected to segmentation processing, and a final robot structure is determined. Invalid data returned by the structure can be filtered, effective sensing of the laser sensor to the environment is guaranteed, and detection accuracy of the robot is improved.
It is noted that while for simplicity of explanation, the foregoing method embodiments have been described as a series of acts or combination of acts, it will be appreciated by those skilled in the art that the present disclosure is not limited by the order of acts, as some steps may, in accordance with the present disclosure, occur in other orders and concurrently. Further, those skilled in the art should also appreciate that the embodiments described in the specification are exemplary embodiments and that acts and modules referred to are not necessarily required by the disclosure.
The above is a description of embodiments of the method, and the embodiments of the apparatus are further described below.
Fig. 2 illustrates a block diagram of a laser sensor based robotic structure detecting device 200 according to an embodiment of the present disclosure. As shown in fig. 2, the apparatus 200 includes:
a receiving module 210, configured to receive a laser data frame;
a comparison module 220, configured to compare a currently received laser data frame with an available laser data frame stored last time, and if a changed value is greater than a preset movement threshold, take the currently received laser data frame as an available laser frame;
the screening module 230 is configured to acquire a preset number of available laser frames, and screen out robot body structure data according to a variance of the preset number of available laser frames;
and the determining module 240 is configured to perform segmentation processing on the robot ontology structure data to determine a robot ontology structure.
It can be clearly understood by those skilled in the art that, for convenience and brevity of description, the specific working process of the described module may refer to the corresponding process in the foregoing method embodiment, and is not described herein again.
Reference is now made to fig. 3, which illustrates a schematic block diagram of a computer system suitable for implementing a terminal device or server of an embodiment of the present application. The terminal device shown in fig. 3 is only an example, and should not bring any limitation to the functions and the scope of use of the embodiments of the present application.
As shown in fig. 3, the computer system includes a Central Processing Unit (CPU)301 that can perform various appropriate actions and processes based on a program stored in a Read Only Memory (ROM)302 or a program loaded from a storage section 308 into a Random Access Memory (RAM) 303. In the RAM 303, various programs and data necessary for system operation are also stored. The CPU 301, ROM 302, and RAM 303 are connected to each other via a bus 304. An input/output (I/O) interface 305 is also connected to bus 304.
The following components are connected to the I/O interface 305: an input portion 306 including a keyboard, a mouse, and the like; an output section 307 including a display such as a Cathode Ray Tube (CRT), a Liquid Crystal Display (LCD), and the like, and a speaker; a storage section 308 including a hard disk and the like; and a communication section 309 including a network interface card such as a LAN card, a modem, or the like. The communication section 309 performs communication processing via a network such as the internet. The driver 310 is also connected to the I/O interface 305 on an as needed basis. A removable medium 311 such as a magnetic disk, an optical disk, a magneto-optical disk, a semiconductor memory, or the like is mounted on the drive 310 on an as-needed basis, so that a computer program read out therefrom is mounted on the storage section 308 on an as-needed basis.
In particular, based on the embodiments of the present disclosure, the processes described above with reference to the flowcharts may be implemented as computer software programs. For example, embodiments of the present disclosure include a computer program product comprising a computer program embodied on a computer readable medium, the computer program comprising program code for performing the method illustrated in the flow chart. In such an embodiment, the computer program may be downloaded and installed from a network through the communication section 309, and/or installed from the removable medium 311. The computer program performs the above-described functions defined in the method of the present application when executed by the Central Processing Unit (CPU) 301.
It should be noted that the computer readable medium described herein can be a computer readable signal medium or a computer readable storage medium or any combination of the two. A computer readable storage medium may be, but is not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples of the computer readable storage medium may include, but are not limited to: an electrical connection having one or more wires, a portable computer diskette, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing. In the present application, a computer readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device. In this application, however, a computer readable signal medium may include a propagated data signal with computer readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take many forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A computer readable signal medium may also be any computer readable medium that is not a computer readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device. Program code embodied on a computer readable medium may be transmitted using any appropriate medium, including but not limited to: wireless, wire, fiber optic cable, RF, etc., or any suitable combination of the foregoing.
The flowchart and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of systems, methods and computer program products according to various embodiments of the present application. In this regard, each block in the flowchart or block diagrams may represent a unit, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that, in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
The units described in the embodiments of the present application may be implemented by software or hardware. The described units may also be provided in a processor, and may be described as: a processor includes an information measuring unit, a travel track determining unit, a mapping relation determining unit, and a driving strategy generating unit. Here, the names of these units do not constitute a limitation on the unit itself in some cases, and for example, the information measuring unit may also be described as a "unit that measures the state information of the own vehicle and the surrounding scene information".
As another aspect, the present application also provides a non-volatile computer storage medium, which may be the non-volatile computer storage medium included in the apparatus in the above-described embodiments; or it may be a non-volatile computer storage medium that exists separately and is not incorporated into the terminal. The non-transitory computer storage medium stores one or more programs that, when executed by a device, cause the device to: receiving a laser data frame; comparing the currently received laser data frame with the last stored available laser data frame, and if the changed numerical value is greater than a preset moving threshold value, taking the currently received laser data frame as an available laser frame; acquiring a preset acquisition number of available laser frames, and screening out robot body structure data according to the variance of the preset acquisition number of available laser frames; and carrying out segmentation processing on the robot body structure data to determine the robot body structure.
The above description is only a preferred embodiment of the application and is illustrative of the principles of the technology employed. It will be appreciated by those skilled in the art that the scope of the invention herein disclosed is not limited to the particular combination of features described above, but also encompasses other arrangements formed by any combination of the above features or their equivalents without departing from the spirit of the invention. For example, the above features may be replaced with (but not limited to) features having similar functions disclosed in the present application.