CN114637698B - Map memory allocation method and device for robot, robot and storage medium - Google Patents

Map memory allocation method and device for robot, robot and storage medium Download PDF

Info

Publication number
CN114637698B
CN114637698B CN202210536965.7A CN202210536965A CN114637698B CN 114637698 B CN114637698 B CN 114637698B CN 202210536965 A CN202210536965 A CN 202210536965A CN 114637698 B CN114637698 B CN 114637698B
Authority
CN
China
Prior art keywords
map
robot
memory
current space
size
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202210536965.7A
Other languages
Chinese (zh)
Other versions
CN114637698A (en
Inventor
何世友
李田田
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen Baseus Technology Co Ltd
Original Assignee
Shenzhen Baseus Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shenzhen Baseus Technology Co Ltd filed Critical Shenzhen Baseus Technology Co Ltd
Priority to CN202210536965.7A priority Critical patent/CN114637698B/en
Publication of CN114637698A publication Critical patent/CN114637698A/en
Application granted granted Critical
Publication of CN114637698B publication Critical patent/CN114637698B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F12/00Accessing, addressing or allocating within memory systems or architectures
    • G06F12/02Addressing or allocation; Relocation
    • G06F12/0223User address space allocation, e.g. contiguous or non contiguous base addressing
    • G06F12/023Free address space management
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2212/00Indexing scheme relating to accessing, addressing or allocation within memory systems or architectures
    • G06F2212/10Providing a specific technical effect
    • G06F2212/1032Reliability improvement, data loss prevention, degraded operation etc
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2212/00Indexing scheme relating to accessing, addressing or allocation within memory systems or architectures
    • G06F2212/10Providing a specific technical effect
    • G06F2212/1041Resource optimization
    • G06F2212/1044Space efficiency improvement
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F2212/00Indexing scheme relating to accessing, addressing or allocation within memory systems or architectures
    • G06F2212/17Embedded application
    • G06F2212/173Vehicle or other transportation

Abstract

The invention belongs to the technical field of data processing, and discloses a map memory allocation method and device for a robot, the robot and a storage medium. The method comprises the following steps: acquiring the actual size of the current space; obtaining map parameter information; determining the size of a target memory according to the actual size and the map parameter information; and defining a memory area according to the size of the target memory, wherein the memory area is used for storing the map corresponding to the current space. By the scheme, the memory is pre-estimated by combining the actual size of the map and the map precision, so that the accurate memory size is obtained, the utilization rate of the memory is improved, and the map is prevented from being lost.

Description

Map memory allocation method and device for robot, robot and storage medium
Technical Field
The invention relates to the technical field of data processing, in particular to a map memory allocation method and device for a robot, the robot and a storage medium.
Background
The robot becomes an indispensable part in life, for example, equipment such as a sweeping robot, an AGV dolly, an unmanned aerial vehicle have related to the life aspect, and the robot realizes the important ring of space perception ability when the work of drawing is accomplished to the space scanning.
After the existing robot builds a map, the built environment map is stored in a reserved memory with a reserved size, if the size of the reserved memory is too large, the map actually built is far smaller than the area defined in the memory, which easily causes memory waste, and if the size of the reserved memory is too small, the map exceeds the defined area and cannot be stored in the memory completely, which causes map loss and abnormity.
The above is only for the purpose of assisting understanding of the technical solution of the present invention, and does not represent an admission that the above is the prior art.
Disclosure of Invention
The invention mainly aims to provide a map memory allocation method and device for a robot, the robot and a storage medium, and aims to solve the technical problem of how to reasonably define the size of a memory in the process of building a map in the prior art.
In order to achieve the above object, the present invention provides a map memory allocation method for a robot, the method comprising the following steps:
acquiring the actual size of the current space;
obtaining map parameter information;
determining the size of a target memory according to the actual size and the map parameter information;
and defining a memory area according to the size of the target memory, wherein the memory area is used for storing the map corresponding to the current space.
Optionally, the movement process of the robot when acquiring the actual size of the current space is to drive along the edge of the current space until the driving track is closed, where the acquiring the actual size of the current space includes:
recording the motion parameters of the robot in the motion process;
and calculating the actual size of the current space according to the motion parameters.
Optionally, the motion parameters include N azimuth angle parameters and N driving distance parameters, and the calculating the actual size of the current space according to the motion parameters includes:
mapping the N azimuth angle parameters and the N driving distance parameters to a preset coordinate system to obtain a contour coordinate set of the current space;
and calculating the actual size of the current space according to the contour coordinate set.
Optionally, the calculating the actual size of the current space according to the set of contour coordinates includes:
determining a target rectangle according to the outline coordinate set, wherein the target rectangle is the smallest rectangle in a rectangle set which encloses all coordinates in the outline coordinate set;
and determining the actual size of the current space according to the target rectangle.
Optionally, the step of mapping the N azimuth angle parameters and the N driving distance parameters to a preset coordinate system to obtain the contour coordinate set of the current space includes:
determining a first two-dimensional coordinate point based on the first azimuth parameter and the first distance-traveled parameter;
and determining an mth two-dimensional coordinate point based on the (m-1) th driving distance parameter, the mth azimuth angle parameter and the mth driving distance parameter, wherein m is greater than or equal to 2 and less than or equal to N.
Optionally, the determining the size of the target memory according to the actual size and the map parameter information includes:
determining the length and the width of the current space according to the actual size;
respectively carrying out redundancy processing on the length and the width to obtain an estimated length and an estimated width;
and determining the size of a target memory according to the estimated length, the estimated width and the map parameter information.
Optionally, the determining the size of the target memory according to the actual size and the map parameter information includes:
acquiring a map storage type;
determining the number of image channels according to the map storage type;
and determining the size of a target memory according to the actual size, the map parameter information and the number of image channels.
In addition, in order to achieve the above object, the present invention further provides a map memory allocation device for a robot, including:
the acquisition module is used for acquiring the actual size of the current space;
the acquisition module is also used for acquiring map parameter information;
the processing module is used for determining the size of a target memory according to the actual size and the map parameter information;
the processing module is further configured to define a memory area according to the size of the target memory, where the memory area is used to store a map corresponding to the current space.
In addition, to achieve the above object, the present invention further provides a map memory allocation apparatus for a robot, including: the map memory allocation program of the robot is configured to implement the steps of the map memory allocation method of the robot.
In addition, in order to achieve the above object, the present invention further provides a storage medium, in which a map memory allocation program of a robot is stored, and the map memory allocation program of the robot, when executed by a processor, implements the steps of the map memory allocation method of the robot described above.
The method comprises the steps of obtaining the actual size of the current space; obtaining map parameter information; determining the size of a target memory according to the actual size and the map parameter information; and defining a memory area according to the size of the target memory, wherein the memory area is used for storing the map corresponding to the current space. By the scheme, the memory is pre-estimated by combining the actual size of the map and the map precision, so that the accurate memory size is obtained, the utilization rate of the memory is improved, and the map is prevented from being lost.
Drawings
Fig. 1 is a schematic structural diagram of a map memory allocation device of a robot in a hardware operating environment according to an embodiment of the present invention;
fig. 2 is a flowchart illustrating a map memory allocation method of a robot according to a first embodiment of the present invention;
fig. 3 is a schematic diagram illustrating an actual size of a current space according to an embodiment of a map memory allocation method for a robot according to the present invention;
fig. 4 is a schematic diagram illustrating an actual size of a current space according to an embodiment of a map memory allocation method for a robot of the present invention;
fig. 5 is a flowchart illustrating a second embodiment of a map memory allocation method for a robot according to the present invention;
fig. 6 is a block diagram illustrating a first embodiment of a map memory allocation apparatus of a robot according to the present invention.
The implementation, functional features and advantages of the objects of the present invention will be further explained with reference to the accompanying drawings.
Detailed Description
It should be understood that the specific embodiments described herein are merely illustrative of the invention and are not intended to limit the invention.
Referring to fig. 1, fig. 1 is a schematic structural diagram of a map memory allocation device of a robot in a hardware operating environment according to an embodiment of the present invention.
As shown in fig. 1, the map memory allocation apparatus of the robot may include: a processor 1001, such as a Central Processing Unit (CPU), a communication bus 1002, a user interface 1003, a network interface 1004, and a memory 1005. Wherein a communication bus 1002 is used to enable connective communication between these components. The user interface 1003 may include a Display screen (Display), an input unit such as a Keyboard (Keyboard), and the optional user interface 1003 may also include a standard wired interface, a wireless interface. The network interface 1004 may optionally include a standard wired interface, a Wireless interface (e.g., a Wireless-Fidelity (Wi-Fi) interface). The Memory 1005 may be a Random Access Memory (RAM) Memory, or may be a Non-Volatile Memory (NVM), such as a disk Memory. The memory 1005 may alternatively be a storage device separate from the processor 1001.
Those skilled in the art will appreciate that the configuration shown in fig. 1 does not constitute a limitation of the map memory allocation arrangement of the robot, and may include more or fewer components than those shown, or some components in combination, or a different arrangement of components.
As shown in fig. 1, a storage 1005, which is a storage medium, may include an operating system, a network communication module, a user interface module, and a map memory allocation program of the robot.
In the map memory allocation apparatus of the robot shown in fig. 1, the network interface 1004 is mainly used for data communication with a network server; the user interface 1003 is mainly used for data interaction with a user; the processor 1001 and the memory 1005 of the map memory allocation device of the robot according to the present invention may be provided in the map memory allocation device of the robot, and the map memory allocation device of the robot calls the map memory allocation program of the robot stored in the memory 1005 through the processor 1001 and executes the map memory allocation method of the robot according to the embodiment of the present invention.
An embodiment of the present invention provides a method for allocating a robot map memory, and referring to fig. 2, fig. 2 is a flowchart illustrating a first embodiment of a method for allocating a robot map memory according to the present invention.
In this embodiment, the map memory allocation method for the robot includes the following steps:
step S10: and acquiring the actual size of the current space.
It should be noted that, the execution main body of the embodiment is a robot, and the robot may be a floor sweeping robot, an AGV cart, a cleaning robot, or other devices having the same or similar functions as the cleaning robot.
It should be noted that, in the robot mapping process of the present embodiment, as shown in fig. 3, a general mapping process directly defines an area S1 with a fixed size in a memory for mapping and storing, because a fixed area is generally easy to waste a small memory in an area S2 where the mapping is actually used, or a part of the area S2 exceeds the area S1, which results in a map loss. Therefore, the embodiment is mainly applied to how to reasonably define the memory space, and the actual size of the map is acquired in the early stage, and the memory area S1 is precisely defined according to the actual size, so as to avoid the waste of the memory.
It should be noted that obtaining the actual size of the current space is the two-dimensional physical size of the space where the robot needs to create the image, and the actual size may be obtained through a space sensing device carried by the robot, for example: the method is fast in acquisition speed and high in automation degree, but a series of high-precision sensors and a complex fusion algorithm need to be deployed on the robot for measurement and calculation, and the cost is high. The actual size of the current space can be directly obtained from the external device by manually inputting the size information of the space, the mode depends on the input of external information, and when no information source of the actual size of the current space exists, the robot cannot continue to work.
Step S20: and obtaining map parameter information.
It can be understood that the map precision corresponds to the robot storage policy, where the map precision is how much storage space is needed for each map unit, for example: taking a grid map as an example, for example: the 800 × 1000 grid map comprises 800000 pixels, each pixel occupies 1 byte, and if the 800 × 1000 grid map is to be stored, the required memory size is 800000 bytes; a typical 800 x 1000 grid map may be represented by an 800 x 1000 matrix, where the values in the matrix are pixel values. The 800 × 1000 grid map is the actual map size, that is, the actual size of the current space. The present embodiment is described by way of example, and is not limited to the above correspondence relationship.
Step S30: and determining the size of a target memory according to the actual size and the map parameter information.
It should be noted that, it can be determined that the mapping in the current space needs to occupy several times of pixel matrices according to the actual size and the map parameter information, and then the corresponding memory size is defined in the memory space. To ensure that the map can be stored completely.
In the embodiment, the length and the width of the current space are determined according to the actual size; respectively carrying out redundancy processing on the length and the width to obtain an estimated length and an estimated width; and determining the size of a target memory according to the estimated length, the estimated width and the map parameter information.
It can be understood that, during the actual mapping process, an error may exist between the actual size of the map and the actual size of the current space to be measured, and if the memory space is completely defined according to the actual size of the current space, it is likely that the map exceeds the target memory size during the mapping process, so that a redundancy value may be determined according to the actual size, and the integrity of the mapping process is ensured.
In the embodiment, a map storage type is acquired; determining the number of image channels according to the map storage type; and determining the size of a target memory according to the actual size, the map parameter information and the number of image channels.
It should be noted that, in the case of different types of map storage, the actual size of the same size may occupy different memory sizes, for example: when the map storage type is color map storage, the content stored by 1 pixel point not only records information in the map or outside the map, but also needs to record color information in the position, so that the memory occupied by one pixel point is larger at this time, the 800 × 1000 grid map includes 800000 pixel points, and the corresponding color map can be 800 × 1000 × 3 bytes.
In a specific implementation, the embodiment proposes a preferred scheme for calculating the size of the target memory, and determines the size N × M of the actual size, i.e., the length and width of the actual size, according to the actual size of the current space; and calculating the minimum memory C = (N/S) × (M/S) required by the space environment according to N, M, S, and dividing the memory for the environment map from the total memory space according to C, wherein S is the map precision. The formula: further explanation of C = (N/S) × (M/S) is as follows: for example, if the size of each pixel point corresponding to the real world is 5cm × 5cm, then the environment of 30m × 40m needs to occupy robot (30m/0.05) × (40m/0.05) = =480000 bytes, and if the size of the reserved memory is 2000000 bytes, then 152w bytes of storage space are wasted. Similarly, if the size of the reserved memory is 500000 bytes, the memory shortage problem and error report will occur when the spatial environment is 40m × 40 m.
Step S40: and defining a memory area according to the size of the target memory, wherein the memory area is used for storing the map corresponding to the current space.
It should be noted that after the target memory size is determined, a memory area needs to be further defined, as shown in fig. 3, a data matrix formed by the memory area is an area S1 on a two-dimensional coordinate. The memory area is used for storing the map corresponding to the current space, and the map information of each position in the actual map building process is stored in the corresponding coordinates in the area S1.
The embodiment acquires the actual size of the current space; obtaining map parameter information; determining the size of a target memory according to the actual size and the map parameter information; and defining a memory area according to the size of the target memory, wherein the memory area is used for storing the map corresponding to the current space. Through the scheme, the memory is estimated by combining the actual size of the map and the map precision, so that the accurate memory size is obtained, the utilization rate of the memory is improved, and the map is prevented from being lost.
Referring to fig. 5, fig. 5 is a flowchart illustrating a second embodiment of a map memory allocation method for a robot according to the present invention.
Based on the first embodiment, in the step S10, the method for allocating map memory of the robot in this embodiment further includes:
step S11: and recording the motion parameters of the robot in the motion process.
It should be noted that the motion parameters of the robot are the operation parameters of the robot during the actual size detection operation in the current space, because a series of high-precision sensors and a complex fusion algorithm need to be deployed on the robot to measure and calculate the actual size by calculating the actual size through the space sensing equipment carried by the robot, the cost is high. The actual size of the current space is directly obtained from the external connection through artificially inputting the size information of the space, the mode depends on the input of external information, and when no information source of the actual size of the current space exists, the robot cannot continue to work.
The embodiment provides a preferable scheme that the robot is controlled to run for one circle along the edge of the current space, and then the actual size of the current space can be calculated according to a simpler algorithm through recorded running data. In this embodiment, the robot obtains the actual size of the current space by traveling along the edge of the current space until the travel track is closed. For example: and recording the motion parameters of the robot, wherein the motion parameters can be the driving track of the robot, and mapping the driving track in a coordinate system which is drawn well in advance to outline a space. And then selecting the rectangle with the smallest area from all the rectangles capable of covering the space outline as the area defined by the memory. For example: in fig. 3, the rectangular region S1 can just wrap the region S2 corresponding to the actual size of the current space, and the outline of the region S2 is the track traveled by the robot when calculating the actual size of the current space. Similarly, the S1 area may also be an area defined by the memory obtained after the redundancy processing, for example: the size obtained after the maximum value of the length and the maximum value of the width of the S2 region are each increased by 10 pixels is selected as the length and the width of the S1 region.
Step S12: and calculating the actual size of the current space according to the motion parameters.
It should be noted that there are various ways to calculate the actual size of the current space according to the motion parameters, and the above mentioned ways may be calculated according to the contour of the driving track fitting area, but this way occupies much memory and affects the operation of the robot.
In this embodiment, the motion parameters include N azimuth angle parameters and N driving distance parameters, and the N azimuth angle parameters and the N driving distance parameters are mapped to a preset coordinate system to obtain a contour coordinate set of the current space; and calculating the actual size of the current space according to the contour coordinate set.
Wherein N is the number of detection points, and the starting point position and the position of each turn of the robot are the detection points, as shown in fig. 3, a0, a1, a2, A3, a4 and a5 are the detection points, and at this time, N is 6. The motion parameters include N azimuth parameters and N driving distance parameters, the azimuth is the azimuth of the current detection point, for example: the right angle of the robot before each turning is positive clockwise rotation and negative counter clockwise rotation compared with the initial direction, namely: the range of the azimuth angle is in the range of (-360 °, 360 °), the direction opposite to the default starting point a0 is 0 °, when the clockwise rotation azimuth angle is positive and the counterclockwise rotation azimuth angle is negative, the azimuth angle of a1 is 0 °, a2 is positive 90 °, A3 is positive 180 °, a4 is positive 90 °, a5 is positive 180 °, and the driving distance is the distance from the last detection point to the current detection point, for example: the travel distance of A1 was 2m, A2 was 2m, A3 was 1m, A4 was 1m, and A5 was 1 m. The azimuth angle-driving distance data corresponding to each detection point is (θ n, dn), θ n is the azimuth angle corresponding to the nth detection point, dn is the driving distance corresponding to the nth detection point, for example: referring to fig. 3, the robot is controlled to move along the edge, and during the movement along the edge, when the robot azimuth changes, the azimuth change value and the distance the robot travels at the current azimuth are recorded, θ 0=0, the azimuth change of the robot at the start point of the movement along the edge may be 0 °, and the set may be expressed as { (0 °, 0), (0 °, 2), (90 °, 2), (180 °, 2), (90 °, 1), (180 °, 1) }.
In this embodiment, the nth azimuth angle parameter is an azimuth angle of the robot at the nth detection point, the nth driving distance parameter is a distance between the nth detection point and the (n-1) th detection point, and the first two-dimensional coordinate point is determined based on the first azimuth angle parameter and the first driving distance parameter; and determining an mth two-dimensional coordinate point based on the (m-1) th driving distance parameter, the mth azimuth angle parameter and the mth driving distance parameter, wherein m is greater than or equal to 2 and less than or equal to N.
It should be noted that, the embodiment provides a preferred scheme for determining the actual size, which can quickly and simply obtain the actual size of the current space according to data corresponding to several detection points without occupying much operating memory, for example: when the clockwise rotation azimuth angle is positive and the counterclockwise rotation azimuth angle is negative, mapping the N azimuth angle parameters and the N driving distance parameters into a preset coordinate system, namely mapping the set of { (θ 0, d 0), (θ 1, d 1), (θ 2, d 2), … …, (θ N, dn) }, wherein the default starting direction is the positive direction of the x axis into the coordinate system as shown in fig. 3, and determining the maximum x, the minimum x, the maximum y and the minimum y from all two-dimensional coordinates; p = max x-min x; q = max y-min y. Wherein "mapping (θ 0, d 0), (θ 1, d 1), (θ 2, d 2), … …, (θ n, dn) under a predetermined two-dimensional coordinate system and determining corresponding two-dimensional coordinates" includes: mapping (θ 0, d 0) to (0, 0); (theta 1)D 1) is mapped to (x 1, y 1) = (x 0+ d1 × cos θ 1, y0-d1 × sin θ 1); (θ 2, d 2) is mapped to (x 2, y 2) = (x 1+ d2 × cos θ 2, y1-d2 × sin θ 2) and so on (θ n, dn) is mapped to (xn, yn) = (x 2, y 2) = (x 1+ d2 × cos θ 2) n-1 +d n *cosθ2,y n-1 -d n *sinθ2)。
Or, if the clockwise rotation azimuth angle is negative and the counterclockwise rotation azimuth angle is positive, mapping the sets { (0 °, 0), (0 °, 2), (-90 °, 2), (-180 °, 1), (-90 °, 1), (-180 °, 1) } corresponding to a0 to a5 in fig. 3 to two-dimensional coordinates, and only modifying the formula to (xn, yn) = (x) n-1 +d n *cosθ2,y n-1 +d n Sin θ 2), the calculation may be performed by (0 °, 0) corresponding to the two-dimensional coordinates (0, 0), (0 °, 2) corresponding to the two-dimensional coordinates (0 +2 × cos0 °, 0+2 × sin0 °) = (2, 0), (-90 °, 2) corresponding to the two-dimensional coordinates (2 +2 × cos (-90 °), 0+2 sin (-90 °) = (2, -2), (-180 °, 1) corresponding to the two-dimensional coordinates (2 +1 × cos (-180 °), -2+1 × sin (-180 °) = (1, -2), (-90 °, 1) corresponding to the two-dimensional coordinates (1 +1 × cos (-90 °), -2+1 × sin (-90 °)) = (1, -3 °), and (-180 °, 1) corresponding to the two-dimensional coordinates (1 +1 × cos (-180 °), -3+1 sin (-180 °) = (0, -3).
Further, the space environment of the robot edge-extending movement is complex and changeable, the included angle between the edges is not only an argument, but also obtuse angle and acute angle, such as the case shown in fig. 4, the embodiment is further explained by taking fig. 4 as an example, when the clockwise rotation azimuth angle is positive and the counterclockwise rotation azimuth angle is negative, the formula (xn, yn) = (x, y n-1 +d n *cosθ2,y n-1 -d n Sin θ 2), calculation may be performed by assuming that a set generated by the azimuth angle parameter and the travel distance parameter at each detection point is an "azimuth angle-travel distance set", which is { B0 (0 °, 0), B1 (0 °, 1), B2 (-45 °,
Figure 857495DEST_PATH_IMAGE002
),B3(-90°,1),B4(-225°,
Figure 774635DEST_PATH_IMAGE002
) B5 (-180 °, 2), B6 (-270 °, 1) }, substituting the above set into formula (xn, yn) = (x) n-1 +d n *cosθ2,y n-1 -d n Sin θ 2), which is to map (θ 0, d 0) to (x 0, x 0) = (0, 0), i.e., B0 (0, 0); b1 (x 1, y 1) = (x 0+1 × cos0 °, y0-1 × sin0 °) = (1, 0); b2 (x 2, y 2) = (x 1+
Figure 554372DEST_PATH_IMAGE002
*cos-45°,y1-
Figure 887264DEST_PATH_IMAGE002
*sin-45°)=(2,1);B3(x3,y3)=(x2+1*cos-90°,y2-1*sin-90°)=(2,2);B4(x4,y4)=(x3+
Figure 701637DEST_PATH_IMAGE002
*cos-225°,y3-
Figure 461782DEST_PATH_IMAGE002
Sin-225 °) = (1, 1); b5 (x 5, y 5) = (x 4+2 cos-180 °, y4-2 sin-180 °) = (-1, 1); b6 (x 6, y 6) = (x 5+1 × cos-270 °, y5-1 × sin-270 °) = (-1, 0). The coordinates of each detection point, i.e., the contour coordinates, are obtained.
In this embodiment, a target rectangle is determined according to the contour coordinate set, where the target rectangle is the smallest rectangle in a rectangle set that encloses all coordinates in the contour coordinate set; and determining the actual size of the current space according to the target rectangle.
It is understood that, of all rectangles that can cover the contour coordinate set, the rectangle with the smallest area may be selected as the internally defined region, for example: the smallest rectangle in FIG. 3 can include all points A0-A5.
The embodiment records the motion parameters of the robot in the motion process; and calculating the actual size of the current space according to the motion parameters. The actual size of the current space is calculated through the motion parameters, high-precision space detection equipment is not needed, and the method does not depend on an external data source, so that the map memory allocation adaptability of the robot is improved, and the cost is saved.
In addition, an embodiment of the present invention further provides a storage medium, where a map memory allocation program of a robot is stored in the storage medium, and when the map memory allocation program of the robot is executed by a processor, the steps of the map memory allocation method of the robot described above are implemented.
Referring to fig. 6, fig. 6 is a block diagram illustrating a first embodiment of a map memory allocation apparatus for a robot according to the present invention.
As shown in fig. 6, a map memory allocation apparatus for a robot according to an embodiment of the present invention includes:
and an obtaining module 10, configured to obtain an actual size of the current space.
The obtaining module 10 is further configured to obtain map parameter information; and the processing module 20 is configured to determine the size of the target memory according to the actual size and the map parameter information.
The processing module 20 is further configured to define a memory area according to the size of the target memory, where the memory area is used to store a map corresponding to the current space.
It should be understood that the above is only an example, and the technical solution of the present invention is not limited in any way, and in a specific application, a person skilled in the art may set the technical solution as needed, and the present invention is not limited thereto.
The embodiment acquiring module 10 acquires the actual size of the current space; the obtaining module 10 obtains map parameter information; the processing module 20 determines the size of the target memory according to the actual size and the map parameter information; the processing module 20 defines a memory area according to the size of the target memory, and the memory area is used for storing the map corresponding to the current space. By the scheme, the memory is pre-estimated by combining the actual size of the map and the map precision, so that the accurate memory size is obtained, the utilization rate of the memory is improved, and the map is prevented from being lost.
In this embodiment, the obtaining module 10 is further configured to record a motion parameter of the robot during the motion process;
and calculating the actual size of the current space according to the motion parameters.
In this embodiment, the obtaining module 10 is further configured to map the N azimuth angle parameters and the N driving distance parameters to a preset coordinate system, so as to obtain a contour coordinate set of the current space;
and calculating the actual size of the current space according to the contour coordinate set.
In this embodiment, the obtaining module 10 is further configured to determine a target rectangle according to the outline coordinate set, where the target rectangle is a smallest rectangle in a rectangle set that encloses all coordinates in the outline coordinate set;
and determining the actual size of the current space according to the target rectangle.
In this embodiment, the obtaining module 10 is further configured to determine a first two-dimensional coordinate point based on the first azimuth angle parameter and the first driving distance parameter;
and determining an mth two-dimensional coordinate point based on the (m-1) th driving distance parameter, the mth azimuth angle parameter and the mth driving distance parameter, wherein m is more than or equal to 2 and less than or equal to N.
In this embodiment, the processing module 20 is further configured to determine a length and a width of the current space according to the actual size;
respectively carrying out redundancy processing on the length and the width to obtain an estimated length and an estimated width;
and determining the size of a target memory according to the estimated length, the estimated width and the map parameter information.
In this embodiment, the processing module 20 is further configured to obtain a map storage type;
determining the number of image channels according to the map storage type;
and determining the size of a target memory according to the actual size, the map parameter information and the number of image channels.
It should be noted that the above-described work flows are only exemplary, and do not limit the scope of the present invention, and in practical applications, a person skilled in the art may select some or all of them to achieve the purpose of the solution of the embodiment according to actual needs, and the present invention is not limited herein.
In addition, the technical details that are not described in detail in this embodiment may refer to the map memory allocation method for the robot provided in any embodiment of the present invention, and are not described herein again.
Further, it is to be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or system that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or system. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other like elements in a process, method, article, or system that comprises the element.
The above-mentioned serial numbers of the embodiments of the present invention are only for description, and do not represent the advantages and disadvantages of the embodiments.
Through the description of the foregoing embodiments, it is clear to those skilled in the art that the method of the foregoing embodiments may be implemented by software plus a necessary general hardware platform, and certainly may also be implemented by hardware, but in many cases, the former is a better implementation. Based on such understanding, the technical solution of the present invention or portions thereof that contribute to the prior art may be embodied in the form of a software product, where the computer software product is stored in a storage medium (e.g. Read Only Memory (ROM)/RAM, magnetic disk, optical disk), and includes several instructions for enabling a terminal device (e.g. a mobile phone, a computer, a server, or a network device) to execute the method according to the embodiments of the present invention.
The above description is only a preferred embodiment of the present invention, and not intended to limit the scope of the present invention, and all modifications of equivalent structures and equivalent processes, which are made by using the contents of the present specification and the accompanying drawings, or directly or indirectly applied to other related technical fields, are included in the scope of the present invention.

Claims (9)

1. A map memory allocation method of a robot is characterized by comprising the following steps:
acquiring the actual size of the current space;
wherein, the obtaining the actual size of the current space includes:
controlling the robot to drive along the edge of the current space, and recording the motion parameters of the robot in the driving process;
when the running track of the robot is closed, calculating the actual size of the current space according to the motion parameters;
obtaining map parameter information;
determining the size of a target memory according to the actual size and the map parameter information;
and defining a memory area according to the size of the target memory, wherein the memory area is used for storing the map corresponding to the current space.
2. The method of claim 1, wherein the motion parameters include N azimuth parameters and N distance traveled parameters, and wherein calculating the actual size of the current space from the motion parameters comprises:
mapping the N azimuth angle parameters and the N driving distance parameters to a preset coordinate system to obtain a contour coordinate set of the current space;
and calculating the actual size of the current space according to the contour coordinate set.
3. The method of claim 2, wherein said calculating the actual size of the current space from the set of contour coordinates comprises:
determining a target rectangle according to the outline coordinate set, wherein the target rectangle is the smallest rectangle in a rectangle set enclosing all coordinates in the outline coordinate set;
and determining the actual size of the current space according to the target rectangle.
4. The method as claimed in claim 2, wherein the nth azimuth parameter is an azimuth of the robot at the nth detection point, the nth travel distance parameter is a distance between the nth detection point and the (N-1) th detection point, and the mapping the N azimuth parameters and the N travel distance parameters into a preset coordinate system to obtain the set of contour coordinates of the current space includes:
determining a first two-dimensional coordinate point based on the first azimuth angle parameter and the first driving distance parameter;
and determining an mth two-dimensional coordinate point based on the (m-1) th driving distance parameter, the mth azimuth angle parameter and the mth driving distance parameter, wherein m is greater than or equal to 2 and less than or equal to N.
5. The method of any one of claims 1 to 4, wherein said determining a target memory size based on said actual size and said map parameter information comprises:
determining the length and the width of the current space according to the actual size;
respectively carrying out redundancy processing on the length and the width to obtain a predicted length and a predicted width;
and determining the size of a target memory according to the estimated length, the estimated width and the map parameter information.
6. The method of claim 5, wherein the map parameter information includes a map type and a map accuracy value, and wherein determining a target memory size based on the estimated length, the estimated width, and the map parameter information comprises:
determining the number of image channels according to the map type;
and determining the size of a target memory according to the estimated length, the estimated width, the map accuracy value and the number of image channels.
7. A map memory allocation device for a robot, the map memory allocation device for the robot comprising:
the acquisition module is used for acquiring the actual size of the current space;
the acquisition module is also used for controlling the robot to run along the edge of the current space and recording the motion parameters of the robot in the running process; when the running track of the robot is closed, calculating the actual size of the current space according to the motion parameters;
the acquisition module is also used for acquiring map parameter information;
the processing module is used for determining the size of a target memory according to the actual size and the map parameter information;
the processing module is further configured to define a memory area according to the size of the target memory, where the memory area is used to store a map corresponding to the current space.
8. A robot, characterized in that the robot comprises: a memory, a processor and a map memory allocation program for a robot stored on the memory and operable on the processor, the map memory allocation program for a robot being configured to implement the steps of the map memory allocation method for a robot as claimed in any one of claims 1 to 6.
9. A storage medium having stored thereon a map memory allocation program for a robot, the map memory allocation program for a robot, when executed by a processor, implementing the steps of the map memory allocation method for a robot according to any one of claims 1 to 6.
CN202210536965.7A 2022-05-18 2022-05-18 Map memory allocation method and device for robot, robot and storage medium Active CN114637698B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210536965.7A CN114637698B (en) 2022-05-18 2022-05-18 Map memory allocation method and device for robot, robot and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210536965.7A CN114637698B (en) 2022-05-18 2022-05-18 Map memory allocation method and device for robot, robot and storage medium

Publications (2)

Publication Number Publication Date
CN114637698A CN114637698A (en) 2022-06-17
CN114637698B true CN114637698B (en) 2022-09-02

Family

ID=81952757

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210536965.7A Active CN114637698B (en) 2022-05-18 2022-05-18 Map memory allocation method and device for robot, robot and storage medium

Country Status (1)

Country Link
CN (1) CN114637698B (en)

Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101900570A (en) * 2009-02-18 2010-12-01 三星电子株式会社 Produce and use the equipment and the method for grid map path

Family Cites Families (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103927264B (en) * 2014-05-12 2016-08-24 中国航空无线电电子研究所 A kind of distribution method in airborne digital map software map datum running memory space
KR102326077B1 (en) * 2017-06-15 2021-11-12 엘지전자 주식회사 Method of identifying movable obstacle in 3-dimensional space and robot implementing thereof
CN107390700B (en) * 2017-09-05 2021-06-01 珠海市一微半导体有限公司 Dynamic mapping method and chip for robot
KR102255273B1 (en) * 2019-01-04 2021-05-24 삼성전자주식회사 Apparatus and method for generating map data of cleaning space
US10937192B2 (en) * 2019-05-29 2021-03-02 Dell Products, L.P. Resolving incorrect distributed simultaneous localization and mapping (SLAM) data in edge cloud architectures
US11003934B2 (en) * 2019-08-30 2021-05-11 Here Global B.V. Method, apparatus, and system for selecting sensor systems for map feature accuracy and reliability specifications
CN112988609B (en) * 2019-12-02 2023-05-02 杭州海康机器人股份有限公司 Data processing method, device, storage medium and client
CN111631639B (en) * 2020-05-26 2021-07-06 珠海市一微半导体有限公司 Map traversal block establishment method and chip of global grid map and mobile robot
WO2022000260A1 (en) * 2020-06-30 2022-01-06 深圳市大疆创新科技有限公司 Map updating method and apparatus, and movable platform and storage medium

Patent Citations (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101900570A (en) * 2009-02-18 2010-12-01 三星电子株式会社 Produce and use the equipment and the method for grid map path

Also Published As

Publication number Publication date
CN114637698A (en) 2022-06-17

Similar Documents

Publication Publication Date Title
US11763575B2 (en) Object detection for distorted images
CN109214980B (en) Three-dimensional attitude estimation method, three-dimensional attitude estimation device, three-dimensional attitude estimation equipment and computer storage medium
CN107223244B (en) Localization method and device
JP7289927B2 (en) Two-dimensional code recognition method, generation method, device, two-dimensional code and small car
US20190095212A1 (en) Neural network system and operating method of neural network system
CN111813101A (en) Robot path planning method and device, terminal equipment and storage medium
CN110246182A (en) Vision-based global map positioning method and device, storage medium and equipment
CN111598316B (en) Object transfer boxing process strategy generation method and device and computer equipment
CN113344986B (en) Point cloud registration result evaluation method, device, equipment and storage medium
JP2009163156A (en) Moving robot system and control method therefor
CN111319041A (en) Robot pose determining method and device, readable storage medium and robot
CN115546313A (en) Vehicle-mounted camera self-calibration method and device, electronic equipment and storage medium
EP3961583A2 (en) Method for detecting obstacle, electronic device, roadside device and cloud control platform
CN114637698B (en) Map memory allocation method and device for robot, robot and storage medium
CN115014328A (en) Dynamic loading method, device, equipment and medium for grid map
CN111462235A (en) Inclined target detection method and device based on yolo v3 algorithm and storage medium
CN110824496B (en) Motion estimation method, motion estimation device, computer equipment and storage medium
CN114080626A (en) Method for determining the position of a first image region in a corresponding image, SoC and control device and system for carrying out the method, and computer program
CN114078247A (en) Target detection method and device
CN112799628B (en) Virtual LED box body orientation determining method and device, computer equipment and storage medium
CN112669196B (en) Method and equipment for optimizing data by factor graph in hardware acceleration engine
CN114663449A (en) Road defect area calculation method and device, computer equipment and storage medium
CN114168695A (en) Target position determining method, device, terminal and storage medium
CN114332201A (en) Model training and target detection method and device
CN116698038A (en) Positioning loss judging method and device of robot and robot

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant