Storage medium, robot, and method for generating navigation map
A storage medium, a robot, and a method for generating navigation map are provided. By disposing a first lidar and a second lidar located higher than the first lidar, it constructs a first map corresponding to the first lidar based on first laser data collected by the first lidar, and calculate second positioning data corresponding to the second lidar during constructing the first map, constructs a second map corresponding to the second lidar based on the second positioning data and second laser data collected by the second lidar, and obtains a navigation map corresponding to the robot by fusing the first map with the second map, such that the fused map includes not only positioning information provided by the first map, but also obstacle information provided by the first map and the second map.
1 . A computer-implemented navigation grid map generation method, comprising:
providing a robot comprising a first lidar, a second lidar, an odometer, and a processor electrically coupled to the first lidar, the second lidar and the odometer, wherein the first lidar is disposed at a first position of the robot, the second lidar is disposed at a second position of the robot, the first position is higher than the second position, and a number of movable objects in a spatial area covered by the second lidar is greater than a number of the movable objects in a spatial area covered by the first lidar;
controlling, by the processor, the robot to move, collecting, by the first lidar, first laser data at a first moment, constructing, by the processor, a first grid map corresponding to the first lidar based on the first laser data, and obtaining, by the processor, first positioning data using a Gauss-Newton matching algorithm based on the first laser data, wherein the first positioning data is configured to indicate position information of the first lidar at the first moment;
collecting, by the second lidar, second laser data at a second moment, wherein the second moment is later than the first moment;
obtaining, by the processor, a movement distance of the robot from the first moment to the second moment using the odometer, generating second positioning data based on the first positioning data and the movement distance, and constructing a second grid map corresponding to the second lidar based on the second positioning data and the second laser data, wherein the second positioning data is configured to indicate position information of the second lidar at the second moment;
obtaining, by the processor, a navigation grid map corresponding to the robot by fusing the first grid map with the second grid map; and
navigating, by the processor, the robot according to the navigation grid map;
wherein the robot has a first odometer corresponding to the first lidar and a second odometer corresponding to the second lidar, and the step of obtaining, by the processor, the movement distance of the robot from the first moment to the second moment using the odometer comprises:
obtaining, by the processor, a first odometer reading of the first odometer at the first moment, and a second odometer reading of the second odometer at the second moment; and
calculating, by the processor, a difference between the first odometer reading and the second odometer reading, and using the difference as the movement distance;
wherein the navigation grid map comprises: positioning information provided by the first grid map, and obstacle information provided by the first grid map and the second grid map;
wherein the spatial area covered by the first lidar is larger than the spatial area covered by the second lidar, a size of the first grid map is larger than a size of the second grid map, and the step of obtaining, by the processor, the navigation grid map corresponding to the robot by fusing the first grid map with the second grid map comprises:
constructing, by the processor, a first pixel coordinate system based on a first frame of the first laser data, and constructing a second pixel coordinate system based on a first frame of the second laser data;
obtaining a positional distance difference between the first pixel coordinate system and the second pixel coordinate system by calculating a coordinate difference between origins of the first pixel coordinate system and the second pixel coordinate system in a world coordinate system, wherein the positional distance difference is a translation amount of the first pixel coordinate system and the second pixel coordinate system in a horizontal direction;
translating the second grid map based on the positional distance difference to align the first grid map with the second grid map; and
generating the navigation grid map by merging the first grid map and the second grid map after aligning the first grid map with the second grid map; and
wherein the first grid map is constructed by using a key frame matching based scheme based on the first laser data, and the second grid map is constructed by using the key frame matching based scheme based on the second positioning data and the second laser data.
2 . The method of claim 1 , wherein the robot has one odometer, and the step of obtaining, by the processor, the movement distance of the robot from the first moment to the second moment using the odometer comprises:
obtaining, by the processor, a first odometer reading of the odometer at the first moment, and a second odometer reading of the odometer at the second moment; and
calculating, by the processor, a difference between the first odometer reading and the second odometer reading, and using the difference as the movement distance.
3 . The method of claim 1 , wherein the second positioning data is generated by adding the movement distance to the first positioning data.
4 . The method of claim 1 , wherein the robot is a humanoid robot, the first lidar is disposed on a head of the humanoid robot, and the second lidar is disposed on a portion of the humanoid robot lower than the head.
5 . A humanoid robot, comprising:
a first lidar;
a second lidar;
an odometer;
a processor electrically coupled to the first lidar, the second lidar and the odometer;
a memory coupled to the processor; and
one or more computer programs stored in the memory and executable on the processor;
wherein the first lidar is disposed at a first position of the humanoid robot, the second lidar is disposed at a second position of the humanoid robot, the first position is higher than the second position, and a number of movable objects in a spatial area covered by the second lidar is greater than a number of the movable objects in a spatial area covered by the first lidar; and
wherein the one or more computer programs comprise:
instructions for controlling the humanoid robot to move;
instructions for collecting, by the first lidar, first laser data at a first moment, constructing a first grid map corresponding to the first lidar based on the first laser data, and obtaining first positioning data using a Gauss-Newton matching algorithm based on the first laser data, wherein the first positioning data is configured to indicate position information of the first lidar at the first moment;
instructions for collecting, by the second lidar, second laser data at a second moment, wherein the second moment is later than the first moment;
instructions for obtaining a movement distance of the humanoid robot from the first moment to the second moment using the odometer, generating second positioning data based on the first positioning data and the movement distance, and constructing a second grid map corresponding to the second lidar based on the second positioning data and the second laser data, wherein the second positioning data is configured to indicate position information of the second lidar at the second moment;
instructions for obtaining a navigation grid map corresponding to the humanoid robot by fusing the first grid map with the second grid map; and
instructions for navigating the humanoid robot according to the navigation grid map;
wherein the humanoid robot has a first odometer corresponding to the first lidar and a second odometer corresponding to the second lidar, and the instructions for obtaining the movement distance of the humanoid robot from the first moment to the second moment using the odometer comprise:
instructions for obtaining a first odometer reading of the first odometer at the first moment, and a second odometer reading of the second odometer at the second moment; and
instructions for calculating a difference between the first odometer reading and the second odometer reading, and using the difference as the movement distance;
wherein the navigation grid map comprises: positioning information provided by the first grid map, and obstacle information provided by the first grid map and the second grid map;
wherein the spatial area covered by the first lidar is larger than the spatial area covered by the second lidar, a size of the first grid map is larger than a size of the second grid map, and the instructions for obtaining the navigation grid map corresponding to the humanoid robot by fusing the first grid map with the second grid map comprise:
instructions for constructing a first pixel coordinate system based on a first frame of the first laser data, and constructing a second pixel coordinate system based on a first frame of the second laser data;
instructions for obtaining a positional distance difference between the first pixel coordinate system and the second pixel coordinate system by calculating a coordinate difference between origins of the first pixel coordinate system and the second pixel coordinate system in a world coordinate system, wherein the positional distance difference is a translation amount of the first pixel coordinate system and the second pixel coordinate system in a horizontal direction;
instructions for translating the second grid map based on the positional distance difference to align the first grid map with the second grid map; and
instructions for generating the navigation grid map by merging the first grid map and the second grid map after aligning the first grid map with the second grid map; and
wherein the first grid map is constructed by using a key frame matching based scheme based on the first laser data, and the second grid map is constructed by using the key frame matching based scheme based on the second positioning data and the second laser data.
6 . The humanoid robot of claim 5 , wherein the humanoid robot has one odometer, and the instructions for obtaining the movement distance of the humanoid robot from the first moment to the second moment using the odometer comprise:
instructions for obtaining a first odometer reading of the odometer at the first moment, and a second odometer reading of the odometer at the second moment; and
instructions for calculating a difference between the first odometer reading and the second odometer reading, and using the difference as the movement distance.
7 . The humanoid robot of claim 5 , wherein the second positioning data is generated by adding the movement distance to the first positioning data.
8 . A non-transitory computer-readable storage medium for storing one or more computer programs executable on a processor of a robot, wherein the robot further comprises a first lidar, a second lidar and an odometer, wherein the first lidar is disposed at a first position of the robot, the second lidar is disposed at a second position of the robot, the first position is higher than the second position, and a number of movable objects in a spatial area covered by the second lidar is greater than a number of the movable objects in a spatial area covered by the first lidar; and
wherein the one or more computer programs comprise:
instructions for controlling the robot to move;
instructions for collecting, by the first lidar, first laser data at a first moment, constructing a first grid map corresponding to the first lidar based on the first laser data, and obtaining first positioning data using a Gauss-Newton matching algorithm based on the first laser data, wherein the first positioning data is configured to indicate position information of the first lidar at the first moment;
instructions for collecting, by the second lidar, second laser data at a second moment, wherein the second moment is later than the first moment;
instructions for obtaining a movement distance of the robot from the first moment to the second moment using the odometer, generating second positioning data based on the first positioning data and the movement distance, and constructing a second grid map corresponding to the second lidar based on the second positioning data and the second laser data, wherein the second positioning data is configured to indicate position information of the second lidar at the second moment;
instructions for obtaining a navigation grid map corresponding to the robot by fusing the first grid map with the second grid map; and
instructions for navigating the robot according to the navigation grid map;
wherein the robot has a first odometer corresponding to the first lidar and a second odometer corresponding to the second lidar, and the instructions for obtaining the movement distance of the robot from the first moment to the second moment using the odometer comprise:
instructions for obtaining a first odometer reading of the first odometer at the first movment, and a second odometer reading of the second odometer at the second moment; and
instructions for calculating a difference between the first odometer reading and the second odometer reading, and using the difference as the movement distance;
wherein the navigation grid map comprises: positioning information provided by the first grid map, and obstacle information provided by the first grid map and the second grid map;
wherein the spatial area covered by the first lidar is larger than the spatial area covered by the second lidar, a size of the first grid map is larger than a size of the second grid map, and the instructions for obtaining the navigation grid map corresponding to the robot by fusing the first grid map with the second grid map comprise:
instructions for constructing a first pixel coordinate system based on a first frame of the first laser data, and constructing a second pixel coordinate system based on a first frame of the second laser data;
instructions for obtaining a positional distance difference between the first pixel coordinate system and the second pixel coordinate system by calculating a coordinate difference between origins of the first pixel coordinate system and the second pixel coordinate system in a world coordinate system, wherein the positional distance difference is a translation amount of the first pixel coordinate system and the second pixel coordinate system in a horizontal direction;
instructions for translating the second grid map based on the positional distance difference to align the first grid map with the second grid map; and
instructions for generating the navigation grid map by merging the first grid map and the second grid map after aligning the first grid map with the second grid map; and
wherein the first grid map is constructed by using a key frame matching based scheme based on the first laser data, and the second grid map is constructed by using the key frame matching based scheme based on the second positioning data and the second laser data.
9 . The non-transitory computer-readable storage medium of claim 8 , wherein the robot has one odometer, and the instructions for obtaining the movement distance of the robot from the first moment to the second moment using the odometer comprise:
instructions for obtaining a first odometer reading of the odometer at the first moment, and a second odometer reading of the odometer at the second moment; and
instructions for calculating a difference between the first odometer reading and the second odometer reading, and using the difference as the movement distance.