WO2018077306A1 - 一种避障跟随方法和电子设备、存储介质 - Google Patents

一种避障跟随方法和电子设备、存储介质 Download PDF

Info

Publication number
WO2018077306A1
WO2018077306A1 PCT/CN2017/110749 CN2017110749W WO2018077306A1 WO 2018077306 A1 WO2018077306 A1 WO 2018077306A1 CN 2017110749 W CN2017110749 W CN 2017110749W WO 2018077306 A1 WO2018077306 A1 WO 2018077306A1
Authority
WO
WIPO (PCT)
Prior art keywords
electronic device
obstacle
target object
device body
control instruction
Prior art date
Application number
PCT/CN2017/110749
Other languages
English (en)
French (fr)
Inventor
陈子冲
廖方波
Original Assignee
纳恩博(北京)科技有限公司
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 纳恩博(北京)科技有限公司 filed Critical 纳恩博(北京)科技有限公司
Publication of WO2018077306A1 publication Critical patent/WO2018077306A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G05CONTROLLING; REGULATING
    • G05DSYSTEMS FOR CONTROLLING OR REGULATING NON-ELECTRIC VARIABLES
    • G05D1/00Control of position, course, altitude or attitude of land, water, air or space vehicles, e.g. using automatic pilots
    • G05D1/02Control of position or course in two dimensions
    • G05D1/021Control of position or course in two dimensions specially adapted to land vehicles
    • G05D1/0231Control of position or course in two dimensions specially adapted to land vehicles using optical position detecting means
    • G05D1/0246Control of position or course in two dimensions specially adapted to land vehicles using optical position detecting means using a video camera in combination with image processing means

Definitions

  • the present invention relates to the field of electronic technologies, and in particular, to an obstacle avoidance following method, an electronic device, and a storage medium.
  • Embodiments of the present invention provide an obstacle avoidance following method, an electronic device, and a storage medium, which can achieve the technical effect of automatically avoiding collision obstacles in following motion.
  • an embodiment of the present invention provides an obstacle avoidance following method, including:
  • the method includes:
  • the unit drives the electronic device body to follow the target object, and is configured to control the electronic device body to avoid obstacles in the obstacle map in the process of following the target object.
  • the method further includes:
  • the third control instruction is used to control the electronic device body in the process of traveling
  • the yaw angle also converges while rotating so that the distance between the electronic device body and the target object converges.
  • the method further includes:
  • the fourth control instruction is used to control the electronic device body to rotate in place, Deviating the angle of the electronic device body with the target object.
  • an obstacle map of an environment in which the electronic device is located including:
  • the obstacle map is constructed based on the location of the obstacle.
  • the method further includes:
  • the compensation obstacle that is not recognized from the image data is determined, and the compensation obstacle is also determined as the obstacle.
  • constructing the obstacle map based on the location of the obstacle including:
  • each of the obstacle positions and the previously constructed obstacle map are integrated to construct the obstacle map.
  • the method before generating the second control instruction according to the preset second following policy, the method further includes:
  • Performing a PTG transform on the optimal PTG inverse transform result obtaining a target angular velocity and a target linear velocity corresponding to the optimal PTG inverse transform result; the target angular velocity and the target linear velocity determining the electronic component by the driving unit An angular velocity and a linear velocity of movement of the apparatus body, the target angular velocity and the target linear velocity being used to generate the second control command.
  • an embodiment of the present invention provides an electronic device having a driving unit configured to provide a driving force for the electronic device to enable the electronic device body to generate motion.
  • the electronic device further has an image acquisition unit, the image acquisition unit is disposed on the main body of the electronic device, and the electronic device further includes:
  • a first following module configured to determine a target object to be followed and a first location of the target object relative to the image acquisition unit based on image data obtained by the image acquisition unit, and according to a preset first following strategy And generating, by the first location, a first control instruction, and executing the first control instruction; wherein the first control instruction is used to control a rotation angle of the image acquisition unit, so that the image acquisition unit can follow Target object
  • a first obtaining module configured to obtain a second location of the target object relative to the electronic device body
  • a building module configured to construct an obstacle map of an environment in which the electronic device is located based on the image data
  • a second following module configured to generate a second control instruction according to the preset second following policy based on the obstacle map and the second position, and execute the second control instruction; wherein the second control The instructions are for controlling the driving unit to drive the electronic device body to follow the target object, and for controlling the electronic device body to avoid an obstacle in the obstacle map in the process of following the target object.
  • the electronic device further includes:
  • a determining module configured to obtain an off-angle of the image collecting unit relative to the electronic device body, and determine whether the off-angle exceeds a threshold
  • a rotation module configured to generate a third control instruction based on the declination and execute the third control instruction when the declination exceeds the threshold; the third control instruction is used to control the electronic device body
  • the yaw angle also converges while rotating during the traveling so that the distance between the electronic device body and the target object converges.
  • the electronic device further includes:
  • a determining module configured to obtain an off-angle of the image collecting unit relative to the electronic device body, and determine whether the off-angle exceeds a threshold
  • an adjustment module configured to generate a fourth control instruction based on the declination and execute the fourth control instruction when the declination exceeds the threshold; the fourth control instruction is used to control the electronic device body Rotating in place to converge the off-angle of the electronic device body and the target object.
  • the building module is configured to identify a plurality of objects from the image data, and a location of each object; and remove the target object from the plurality of objects according to characteristics of the target object, And removing a ground object of the plurality of objects; determining the object after removing the target object and the ground object as the obstacle; constructing the obstacle map based on a location of the obstacle.
  • the electronic device further includes:
  • a second obtaining module configured to detect the environment by using an ultrasonic sensor after determining the object after removing the target object and the ground object as the obstacle, obtaining a compensation indicating that the object is detected The detection result of the obstacle position;
  • a determining module configured to determine the compensation obstacle that is not recognized from the image data based on the detection result and the obstacle position, and determine the compensation obstacle as the obstacle .
  • the building module is configured to obtain a motion of the electronic device body between the construction of the obstacle map and the previous construction of the obstacle map; according to the movement of the electronic device body,
  • the obstacle map is constructed by integrating each of the obstacle positions and the previously constructed obstacle map.
  • the electronic device further includes:
  • a speed calculation module configured to perform an inverse transformation of the trajectory parameter generator PTG on the target object and the obstacle before generating the second control instruction according to the preset second following strategy, and the target object and the obstacle Transforming into a path parameter TP space; obtaining, in the TP space, a plurality of PTG inverse transform results based on a proximity map ND algorithm, each of the PTG inverse transform results indicating that the electronic device body following the target object may occur
  • the path of the plurality of PTG inverse transforms is evaluated by using a cost function, and an optimal PTG inverse transform result is determined from the plurality of PTG inverse transform results; and the best PTG inverse transform result is subjected to PTG transform, Obtaining a target angular velocity and a target linear velocity corresponding to the optimal PTG inverse transform result; the target angular velocity and the target linear velocity are an angular velocity and a linear velocity at which the driving unit determines the movement of the electronic device body, the target angular velocity And the target line speed
  • an embodiment of the present invention provides an electronic device, including: a processor and a memory for storing a computer program capable of running on a processor, wherein the processor is configured to execute when the computer program is executed The steps of the method described above.
  • an embodiment of the present invention provides a computer readable storage medium having stored thereon a computer program, wherein the computer program is executed by a processor to implement the steps of the method described above.
  • the number of images obtained based on the image acquisition unit According to the determination, the target object to be followed and the first position of the target object relative to the image acquisition unit, thereby controlling the rotation of the image acquisition unit to follow the target object.
  • the control driving unit drives the electronic device body to follow the target object, And controlling the electronic device body to avoid obstacles in the process of following the target object, thereby solving the technical problem that the electronic device collides with the target object to collide with the obstacle, thereby causing damage to the device, or being blocked by the obstacle and unable to continue to follow, and realizes follow the target object and avoid the technical effects of collision obstacles.
  • 2 is an exemplary target object and a target object area in an embodiment of the present invention
  • FIG. 3 is a top plan view of an exemplary target object, an obstacle, and an electronic device in an embodiment of the present invention
  • FIG. 4 is a schematic plan view of an obstacle map constructed according to FIG. 3;
  • Figure 5 is a schematic perspective view of an embodiment of the present invention.
  • FIG. 6 is another exemplary obstacle map in an embodiment of the present invention.
  • FIG. 7 is a schematic diagram of an electronic device according to an embodiment of the present invention.
  • Embodiments of the present invention provide an obstacle avoidance following method and an electronic device, which are used to implement the technical effect of automatically avoiding collision obstacles in following motion.
  • the target object to be followed and the first position of the target object relative to the image acquisition unit are determined, thereby controlling the rotation of the image acquisition unit to follow the target object.
  • the control driving unit drives the electronic device body to follow the target object, and controls the electronic device body to avoid the obstacle in the process of following the target object, thereby solving the collision of the electronic device following the target object Obstructions, which in turn lead to equipment damage, or technical problems that are blocked by obstacles and cannot continue to follow, achieve the technical effect of following the target object and avoiding collision obstacles.
  • a first aspect of the embodiments of the present invention provides an obstacle avoidance following method, which is applied to an electronic device, such as a balance car or a robot.
  • the electronic device has a drive unit configured to provide a driving force to the electronic device to enable the electronic device body to generate motion.
  • the driving unit is, for example, a motor or a steering gear, and the like, which is not specifically limited in the embodiment of the present invention.
  • the electronic device in the embodiment of the invention further has an image acquisition unit disposed on the main body of the electronic device.
  • the number of image collection units may be one or multiple.
  • the setting position of each image capturing unit may be different, and the embodiment of the present invention does not specifically limit the present invention.
  • FIG. 1 is a flowchart of an obstacle avoidance following method according to an embodiment of the present invention.
  • the method includes:
  • S101 Determine, according to the image data obtained by the image collecting unit, a target object to be followed and a first position of the target object relative to the image capturing unit, and according to a preset first following strategy and the first Position generating a first control instruction and executing the first control instruction;
  • S103 Construct an obstacle map of an environment in which the electronic device is located based on the image data
  • S104 Generate a second control instruction according to the preset second following policy based on the obstacle map and the second location, and execute the second control instruction.
  • the image acquisition unit acquires image data, and in S101, based on the image data, the first position between the target object and the target object and the image acquisition unit is determined.
  • the electronic device performs matching in the image data according to the target object feature stored in advance, and obtains the matching degree of each object in the image with the target object. If the matching degree reaches the threshold, it is determined that the target object is identified; conversely, if the matching degree does not reach the threshold, it is determined that the target object is not recognized.
  • the general human body features are stored in advance in the electronic device.
  • the electronic device performs matching in the image data and obtains the degree of matching of each object in the image with the general human body feature.
  • the matching degree of one object with the universal human body feature is 95%, reaching the threshold value of 80%, and the matching degree of other objects is 80%, so it is determined that the target object is recognized.
  • the target object is recognized, based on the edge of the target object, a rectangular frame of the inscribed target object is obtained, and the rectangular frame is the target object area.
  • An exemplary target object and target object area are shown in FIG.
  • the position of the first reference point in the target object area is calculated, and the first reference point position is determined as the first position.
  • the first reference point is, for example, a center point of the target object area, a vertex, or other points in the target image area, which is not specifically limited in the embodiment of the present invention.
  • RGB Red Green Blue
  • depth image type depth image type
  • infrared type a target object and the first location
  • the first control instruction is generated according to the preset first following strategy and the first position, and the first control instruction is executed.
  • the first following strategy is that the image capturing unit faces the target object and follows the target object.
  • the first control command is used to control the rotation angle of the image acquisition unit (such as the yaw angle, the elevation angle, and the like), so that the image acquisition unit can follow the target object.
  • generating a first control instruction according to the first following strategy so as to control the rotation angle of the image acquisition unit according to the first position, so that the image acquisition unit can follow the movement of the target object and rotate to the direction of the target object.
  • the first control instruction specifically controls the rotation angle of the image acquisition unit such that the center of the acquired image plane coincides with the center of the target object region. Therefore, after determining the first position of the target object and the image acquisition unit, based on the deviation of the first position from the center of the image acquisition plane, determining a yaw angle and/or pitch of the center of the acquired image plane and the center of the target object region again coincide Angle angle. Further, generating a first control command based on the yaw angle and/or the pitch angle, and executing the first control command, so that the image acquisition unit rotates the yaw angle and/or the pitch angle, and acquires the image plane center after the rotation is completed. It coincides again with the target object area center.
  • the second position of the target object relative to the main body of the electronic device includes at least an angle and a distance between the target object and the main body of the electronic device.
  • there are various ways of obtaining the second position and three of them are described below.
  • the image acquisition unit includes a depth image acquisition unit.
  • the electronic device identifies the target object distance based on the depth image data acquired by the depth image acquisition unit. Further, the angle of the target object is recognized from the depth image data or the image data collected by the other image acquisition unit, thereby obtaining the second position.
  • An anchor node device is provided in the electronic device, and the target object sets the beacon device.
  • Anchor node and beacon Communication is performed between UWB (Ultra-Wideband).
  • the distance and the angle between the anchor node and the beacon are calculated according to the time difference and phase difference of the beacon transmission signal received by at least two antennas of the anchor node. Further, the distance and angle between the anchor node and the beacon are determined as the second position.
  • the third type is the third type.
  • the third way is to locate the indoor position of the target object through the indoor positioning system, and then determine the indoor position of the target object sent by the indoor positioning system as the second position.
  • a person of ordinary skill in the art to which the embodiments of the present invention may be selected may obtain the second location according to the actual selection, or the second location may be obtained in other manners.
  • S102 may also be performed before S101, or even simultaneously with S101.
  • an obstacle map of the environment in which the electronic device is located is constructed based on the image data.
  • the image data on which the obstacle map is constructed may be the image data on which the target object and the first location are determined in S101.
  • the same image acquisition unit, or the same plurality of image acquisition units are used to acquire image data, the target object is identified from the image data, and the obstacles and obstacle positions are recognized, thereby constructing an obstacle map.
  • the image data on which the obstacle map is constructed may be different from the image data on which S101 is based.
  • the image data is separately acquired using at least two different image acquisition units, the target object is identified from at least one of the image data, and the obstacle and obstacle locations are identified from the remaining image data.
  • a GRB camera is set in the robot head, and a depth camera is set on the front of the robot body, and both cameras are in an image acquisition state during the following process. Then, the robot recognizes the target object and the first position from the RGB image data, identifies the obstacle and the obstacle position from the depth image data, and then constructs the obstacle map based on the obstacle position.
  • the second control instruction is generated according to the preset second following strategy.
  • the second following strategy converges the distance between the target object and the electronic device body, and avoids collision obstacles.
  • the second control instruction is for controlling the driving unit to drive the electronic device body to follow the target object, and for controlling the electronic device body to avoid the obstacle in the process of following the target object.
  • FIG. 3 is a top view of an exemplary target object, an obstacle, and an electronic device
  • FIG. 4 is a schematic plan view of the obstacle map constructed according to FIG. 3 .
  • the target object is also represented by a rectangle in the obstacle map of FIG.
  • the white circle in Fig. 4 indicates the target object, and the black circle indicates the obstacle.
  • the second position is (30°, 3), that is, the angle between the target object and the main body of the electronic device is 30°, and the distance is 3 meters.
  • the obstacle position is (5°, 0.5), that is, the angle between the obstacle and the main body of the electronic device is 5°, and the distance is 0.5 m.
  • the target line speed and the target angular velocity are determined, and a second control command is generated and executed based on the target line speed and the target angular velocity.
  • the trajectory of the electronic device following the target object is shown in the curve in FIG.
  • the target object and the first position of the target object relative to the image acquisition unit thereby controlling the image acquisition unit to rotate and face the target object.
  • the control driving unit drives the electronic device body to follow the target object, And controlling the electronic device body to avoid obstacles in the obstacle map in the process of following the target object, thereby solving the problem that the electronic device collides with the target object to collide with the obstacle, thereby causing damage to the device, or being blocked by the obstacle and unable to continue to follow.
  • the technical problem realizes the technical effect of following the target object and avoiding collision obstacles.
  • the third control instruction is used to control the electronic device body in the process of traveling
  • the yaw angle also converges while rotating so that the distance between the electronic device body and the target object converges.
  • the off angle of the image acquisition unit relative to the electronic device is first obtained.
  • the off angle of the image acquisition unit relative to the electronic device is specifically an angle between the first reference line of the image acquisition unit and the second reference line of the main body of the electronic device.
  • the first reference line is the optical axis X1 of the image acquisition unit
  • the second reference line is the axis X2 of the main body of the electronic device parallel to the direction of motion.
  • is the deviation of the image acquisition unit from the electronic device. angle.
  • the threshold is, for example, 35° or 60°, and the like is not specifically limited in the embodiment of the present invention.
  • the third control instruction is used to control the electronic device body to travel During the process of rotation, so that the distance between the main body of the electronic device and the target object converges, the off angle also converges.
  • the control driving unit is brought to the electronic device body to rotate in a direction in which the yaw angle converges, that is, while rotating.
  • the control drive unit is followed by a counterclockwise rotation to the electronic device body.
  • the driving unit can be controlled to drive only the electronic device body to follow the target object without rotating the electronic device body, or the driving unit can drive the electronic device body to follow the target object and appropriately rotate the electronic device body. Make the yaw too big.
  • a person of ordinary skill in the art can make a selection according to the actual situation, and the embodiment of the present invention does not specifically limit the present invention.
  • the off-angle of the image acquisition unit relative to the electronic device may or may not be obtained.
  • the image acquisition unit always follows the target object, and the electronic device body always follows the target object, but when the off-angle exceeds the threshold, it is not necessary to adjust the off-angle convergence.
  • the third type is the third type.
  • the fourth control instruction is used to control the electronic device body to rotate in place, Deviating the angle of the electronic device body with the target object.
  • the way to obtain the off angle in the third way is similar to the first method, and the details are repeated here.
  • the fourth control command is generated based on the yaw angle, and the fourth control command is executed.
  • the fourth control instruction is used to control the electronic device body to rotate in place to converge the off-angle of the electronic device body and the target object.
  • the control drive unit when the yaw angle exceeds the threshold, the control drive unit is brought to the electronic device body to rotate in place. When rotating in place, the linear velocity of the electronic device is zero until the declination converges to the threshold and the linear velocity that is not zero is restored.
  • the driving unit can be controlled to drive only the electronic device body to follow the target object without rotating the electronic device body, or the driving unit can drive the electronic device body to follow the target object and appropriately rotate the electronic device body. Make the yaw too big.
  • a person of ordinary skill in the art can make a selection according to the actual situation, and the embodiment of the present invention does not specifically limit the present invention.
  • any one of the above manners may be selected by a person skilled in the art to which the embodiments of the present invention are applied, and the embodiments of the present invention are not specifically limited.
  • an obstacle map is specifically implemented by the following process:
  • the obstacle map is constructed based on the location of the obstacle.
  • the object can be the ground, the ceiling, the table, the chair, the box, the potted plant, the target object, and the like.
  • the image data on which the obstacle map is constructed is specifically the depth image data, and then the position of the object is specifically the three-dimensional position of the object in the environment space.
  • the target object is determined from the plurality of objects according to the characteristics of the target object set in advance, and the target object is removed from the plurality of objects.
  • the ground object in the embodiment of the present invention refers to a moving surface object such as a ground, a floor, a slope, or the like.
  • the coordinates of the ground object on the axis perpendicular to the motion surface will only change little or not. Therefore, when the ground object is removed, firstly, according to the coordinates of each object perpendicular to the plane of the moving surface, objects with little or no change are extracted, and then these objects are removed as ground objects.
  • the order of removing the target object and the ground object is not limited.
  • an obstacle map is constructed.
  • another exemplary obstacle map is shown in FIG.
  • the obstacle is indicated in black, and the electronic device avoids the black area while following, thereby achieving obstacle avoidance.
  • the image data may not reflect certain obstacles, such as glass, or black objects, in order to further identify the obstacle from the environment, as an alternative embodiment, the ground object and the target object are removed. After that, it also includes:
  • a compensation obstacle that is not recognized from the image data is determined, and the compensation obstacle is also determined as the obstacle.
  • the electronic device body in the embodiment of the present invention is provided with an ultrasonic sensor configured to transmit ultrasonic waves outward and receive the returned ultrasonic waves.
  • the ultrasonic sensor is activated to send ultrasonic waves outward, and the obstacles in the environment where the ultrasonic waves encounter are returned, and the positions of the obstacles are different, and the incident angle of the returned ultrasonic waves is different. Therefore, when the ultrasonic sensor receives the returned ultrasonic wave, it reads the angle of incidence of the returning ultrasonic wave, and then obtains the detection result.
  • the obstacle detected by the ultrasonic sensor is called compensation Obstacle, the test result indicates the position of the obstacle.
  • compensating for obstacles includes identifying obstacles based on image data. Therefore, the position of each compensation obstacle is calculated based on the detection result, and then the position of the obstacle identified from the image data is compared, and if the position of the compensation obstacle is not coincident with the position of the obstacle, the compensation obstacle indicating the position is inconsistent It is not recognized from the image data, and the compensation obstacle is also determined as an obstacle.
  • the ultrasonic sensor is used to detect the environment, the detection result is obtained, and the compensation obstacle that is not recognized from the image data is determined based on the detection result, and the obstacle determined by the electronic device is supplemented, so that The obstacle map thus constructed is more precise and comprehensive.
  • an obstacle map based on the location of the obstacle is specifically implemented by the following process:
  • the position of each of the obstacles and the previously constructed obstacle map are integrated to construct the obstacle map.
  • the image acquisition unit that follows the rotation of the target object and the image acquisition unit that constructs the obstacle map are the same image acquisition unit. If the angle of deviation between the image acquisition unit and the main body of the electronic device is large, so that the range of the front of the image is not included in the image acquisition range, in order to avoid collision obstacles in the following process, it is first necessary to obtain the map of the obstacle and the previous construction obstacle. The movement of the electronic device body between the object maps.
  • the electronic device includes an IMU (Inertial Measurement Unit).
  • the electronic device reads the motion parameters detected by the IMU between the construction of the obstacle map and the previous construction of the obstacle map, and calculates the main body of the electronic device based on the IMU dynamic equation.
  • the movement of life In the embodiment of the present invention, the movement of the main body of the electronic device refers to the rotation and displacement of the main body of the electronic device.
  • the three-dimensional coordinate system referenced by the previous construction of the obstacle map is converted to be consistent with the three-dimensional coordinate system referenced by constructing the current obstacle map, so that the previously constructed obstacle map can Matches the image data collected by this build obstacle map.
  • the position of the obstacle detected this time and the previously constructed obstacle map are integrated, and the position of the obstacle identified by the current obstacle map is merged with the previously constructed obstacle map to obtain An obstacle map with a coverage greater than the current image acquisition range.
  • the electronic device is based on the obstacle.
  • the map can still determine if there are obstacles in front of it and the specific location of the obstacles to avoid obstacles.
  • the method before generating the second control instruction according to the second following policy, the method further includes:
  • Performing a PTG transform on the optimal PTG inverse transform result obtaining a target angular velocity and a target linear velocity corresponding to the optimal PTG inverse transform result; the target angular velocity and the target linear velocity determining the electronic component by the driving unit Angular velocity and linear velocity of the movement of the main body of the apparatus
  • the angular velocity and the target linear velocity are used to generate the second control command.
  • the target object and each obstacle in the obstacle map are inversely transformed by a PTG (Parameter Trajectory Generator), and then the target object and each obstacle are transformed into a TP (path parameter, Trajectory Parameter). ) in space. Then, in the TP space, based on the ND (Nearness Diagram) algorithm, a plurality of PTG inverse transform results are calculated.
  • the inverse PTG transformation result indicates that the electronic device body approaches the target object from the current location and avoids a path that the obstacle may occur.
  • each PTG inverse transform result is input into the cost function, and then the score of each PTG inverse transform result is obtained. The preference of each path is evaluated by the score corresponding to each PTG inverse transform result. Finally, the PTG inverse transform result with the highest score is determined as the best PTG inverse transform result.
  • the best PTG inverse transform result is further subjected to PTG transform.
  • the results obtained by the PTG inverse transform of the PTG inverse transform result are the target angular velocity and the target linear velocity.
  • the target angular velocity and the target linear velocity are specifically the angular velocity and linear velocity required for the path represented by the optimal PTG inverse transform result. Therefore, the electronic device controls the driving unit based on the target angular velocity and the target linear velocity such that the driving unit drives the angular velocity and the linear velocity of the electronic device body to the target angular velocity and the target linear velocity, thereby following the object in accordance with the path represented by the optimal PTG inverse transform result.
  • the second aspect of the embodiments of the present invention further provides an electronic device based on the same inventive concept as the method for avoiding obstacles in the foregoing embodiments.
  • the electronic device in the embodiment of the present invention has a driving unit configured to provide a driving force to the electronic device to enable the electronic device body to generate motion.
  • the electronic device also has an image acquisition unit, and the image acquisition unit is disposed on the main body of the electronic device. As shown in FIG. 7, the electronic device further includes:
  • the first following module 101 is configured to determine, according to the image data obtained by the image collecting unit, a target object to be followed and a first position of the target object relative to the image capturing unit, and according to a preset first following And the first location generates a first control instruction and executes the first control instruction; wherein the first control instruction is used to control the image acquisition a rotation angle of the unit to enable the image acquisition unit to follow the target object;
  • the first obtaining module 102 is configured to obtain a second location of the target object relative to the electronic device body
  • the building module 103 is configured to construct an obstacle map of an environment in which the electronic device is located based on the image data;
  • the second following module 104 is configured to generate a second control instruction according to the preset second following policy based on the obstacle map and the second position, and execute the second control instruction; wherein the second The control instruction is configured to control the driving unit to drive the electronic device body to follow the target object, and to control the electronic device body to avoid an obstacle in the obstacle map in the process of following the target object.
  • the electronic device further includes:
  • a determining module configured to obtain an off-angle of the image collecting unit relative to the electronic device body, and determine whether the off-angle exceeds a threshold
  • a rotation module configured to generate a third control instruction based on the declination and execute the third control instruction when the declination exceeds the threshold; the third control instruction is used to control the electronic device body
  • the yaw angle also converges while rotating during the traveling so that the distance between the electronic device body and the target object converges.
  • the electronic device further includes:
  • a determining module configured to obtain an off-angle of the image collecting unit relative to the electronic device body, and determine whether the off-angle exceeds a threshold
  • an adjustment module configured to generate a fourth control instruction based on the declination and execute the fourth control instruction when the declination exceeds the threshold; the fourth control instruction is used to control the electronic device body Rotating in place to converge the off-angle of the electronic device body and the target object.
  • the building module 103 is configured to identify a plurality of objects from the image data to And a location of each object; removing the target object from the plurality of objects according to a feature of the target object, and removing a ground object of the plurality of objects; removing the target object and the ground The object after the object is determined as the obstacle; the obstacle map is constructed based on the location of the obstacle.
  • the electronic device further includes:
  • a second obtaining module configured to detect the environment by using an ultrasonic sensor after determining the object after removing the target object and the ground object as the obstacle, obtaining a compensation indicating that the object is detected The detection result of the obstacle position;
  • a determining module configured to determine the compensation obstacle that is not recognized from the image data based on the detection result and a position of the obstacle, and determine the compensation obstacle as the obstacle Things.
  • the building module 103 is configured to obtain the motion of the electronic device body between the construction of the obstacle map and the previous construction of the obstacle map; according to the movement of the electronic device body, The position of each of the obstacles is integrated with the previously constructed obstacle map to construct the obstacle map.
  • the electronic device further includes:
  • a speed calculation module configured to perform an inverse transformation of the trajectory parameter generator PTG on the target object and the obstacle before generating the second control instruction according to the preset second following strategy, and the target object and the obstacle Transforming into a path parameter TP space; obtaining, in the TP space, a plurality of PTG inverse transform results based on a proximity map ND algorithm, each of the PTG inverse transform results indicating that the electronic device body following the target object may occur
  • the path of the plurality of PTG inverse transforms is evaluated by using a cost function, and an optimal PTG inverse transform result is determined from the plurality of PTG inverse transform results; and the best PTG inverse transform result is subjected to PTG transform, Obtaining a target angular velocity and a target linear velocity corresponding to the optimal PTG inverse transform result; the target angular velocity and the target linear velocity are angles at which the driving unit determines the motion of the electronic device body Speed and line speed, the target angular velocity and the target line speed are used to generate the
  • the image capturing unit may be specifically a camera
  • the driving unit may be specifically a driving or power component
  • the module, the adjustment module, the second acquisition module, the determination module, and the speed calculation module may each be a central processing unit (CPU), a microprocessor (MPU), or a digital signal processor (DSP) located on the electronic device, or may Programming Gate Array (FPGA) implementation.
  • CPU central processing unit
  • MPU microprocessor
  • DSP digital signal processor
  • the embodiment further provides an electronic device comprising: a processor and a memory for storing a computer program executable on the processor, wherein the processor is configured to execute the computer program when the computer program is executed The steps of the method.
  • the memory may be implemented by any type of volatile or non-volatile storage device, or a combination thereof.
  • the non-volatile memory may be a Read Only Memory (ROM), a Programmable Read-Only Memory (PROM), or an Erasable Programmable Read (EPROM). Only Memory), Electrically Erasable Programmable Read-Only Memory (EEPROM), Ferromagnetic Random Access Memory (FRAM), Flash Memory, Magnetic Surface Memory , CD-ROM, or Compact Disc Read-Only Memory (CD-ROM); the magnetic surface memory can be a disk storage or a tape storage.
  • the volatile memory may be a random access memory (RAM), which is used as External cache.
  • RAM Random Access Memory
  • SRAM Static Random Access Memory
  • SSRAM Synchronous Static Random Access Memory
  • SSRAM Dynamic Random Access
  • DRAM Dynamic Random Access Memory
  • SDRAM Synchronous Dynamic Random Access Memory
  • DDRSDRAM Double Data Rate Synchronous Dynamic Random Access Memory
  • ESDRAM enhancement Enhanced Synchronous Dynamic Random Access Memory
  • SLDRAM Synchronous Dynamic Random Access Memory
  • DRRAM Direct Memory Bus Random Access Memory
  • the processor may be an integrated circuit chip with signal processing capabilities.
  • each step of the above method may be completed by an integrated logic circuit of hardware in a processor or an instruction in a form of software.
  • the above processor may be a general purpose processor, a digital signal processor (DSP), or other programmable logic device, discrete gate or transistor logic device, discrete hardware component, or the like.
  • the processor may implement or perform the methods, steps, and logic blocks disclosed in the embodiments of the present invention.
  • a general purpose processor can be a microprocessor or any conventional processor or the like.
  • the steps of the method disclosed in the embodiment of the present invention may be directly implemented as a hardware decoding processor, or may be performed by a combination of hardware and software modules in the decoding processor.
  • the software module can be located in a storage medium, the storage medium being located in the memory, the processor reading the information in the memory, and completing the steps of the foregoing methods in combination with the hardware thereof.
  • the present embodiment also provides a computer readable storage medium, such as a memory including a computer program, which can be executed by a processor of an electronic device to perform the steps described in the foregoing methods.
  • the computer readable storage medium may be FRAM, ROM, programmable read only memory A memory such as PROM, EPROM, EEPROM, Flash Memory, magnetic surface memory, optical disk, or CD-ROM; or various devices including one or any combination of the above memories.
  • the target object to be followed and the first position of the target object relative to the image acquisition unit are determined, thereby controlling the rotation of the image acquisition unit to follow the target object.
  • the control driving unit drives the electronic device body to follow the target object, And controlling the electronic device body to avoid obstacles in the process of following the target object, thereby solving the technical problem that the electronic device collides with the target object to collide with the obstacle, thereby causing damage to the device, or being blocked by the obstacle and unable to continue to follow, and realizes follow the target object and avoid the technical effects of collision obstacles.
  • embodiments of the present invention can be provided as a method, system, or computer program product. Accordingly, the present invention may take the form of an entirely hardware embodiment, an entirely software embodiment, or a combination of software and hardware. Moreover, the invention can take the form of a computer program product embodied on one or more computer-usable storage media (including but not limited to disk storage, CD-ROM, optical storage, etc.) including computer usable program code.
  • computer-usable storage media including but not limited to disk storage, CD-ROM, optical storage, etc.
  • the computer program instructions can also be stored in a computer readable memory that can direct a computer or other programmable data processing device to operate in a particular manner, such that the instructions stored in the computer readable memory produce an article of manufacture comprising the instruction device.
  • the apparatus implements the functions specified in one or more blocks of a flow or a flow and/or block diagram of the flowchart.
  • These computer program instructions can also be loaded onto a computer or other programmable data processing device such that a series of operational steps are performed on a computer or other programmable device to produce computer-implemented processing for execution on a computer or other programmable device.
  • the instructions provide steps for implementing the functions specified in one or more of the flow or in a block or blocks of a flow diagram.
  • the embodiment of the invention solves the technical problem that the electronic device collides with the target object to collide with the obstacle, thereby causing the device to be damaged, or is blocked by the obstacle and cannot continue to follow, and realizes the technical effect of following the target object and avoiding the collision obstacle.

Landscapes

  • Engineering & Computer Science (AREA)
  • Physics & Mathematics (AREA)
  • Computer Vision & Pattern Recognition (AREA)
  • Multimedia (AREA)
  • Electromagnetism (AREA)
  • Aviation & Aerospace Engineering (AREA)
  • Radar, Positioning & Navigation (AREA)
  • Remote Sensing (AREA)
  • General Physics & Mathematics (AREA)
  • Automation & Control Theory (AREA)
  • Control Of Position, Course, Altitude, Or Attitude Of Moving Bodies (AREA)

Abstract

一种避障跟随方法和电子设备、存储介质,用于实现跟随运动中自动避免碰撞障碍物的技术效果。所述方法包括:基于图像采集单元获得的图像数据,确定要跟随的目标对象以及目标对象相对于图像采集单元的第一位置,进而控制图像采集单元转动,跟随目标对象。然后,通过获得目标对象相对于电子设备主体的第二位置,以及基于图像数据构建所处环境的障碍物地图,进而基于障碍物地图以及第二位置,控制驱动单元驱动电子设备主体跟随目标对象,并控制电子设备主体在跟随目标对象的过程中避开障碍物,由此解决了电子设备跟随目标对象碰撞障碍物。

Description

一种避障跟随方法和电子设备、存储介质
相关申请的交叉引用
[根据细则91更正 15.11.2017] 
本申请基于申请号为201611033439.X、申请日为2016年11月14日的中国专利申请,以及申请号为201610941439.3、申请日为2016年10月25日的中国专利申请提出,并要求该两项中国专利申请的优先权,该两项中国专利申请的全部内容在此引入本申请作为参考。
技术领域
本发明涉及电子技术领域,尤其涉及一种避障跟随方法和电子设备、存储介质。
背景技术
目前,现有技术中的部分电子设备,例如机器人、无人机或平衡车等,有的具备自动跟随目标对象的功能。但是,由于移动空间存在障碍物,所以电子设备移动过程中就有可能碰撞障碍物,导致设备损坏,或者被障碍物阻拦而无法继续跟随。
发明内容
本发明实施例提供了一种避障跟随方法和电子设备、存储介质,能够实现跟随运动中自动避免碰撞障碍物的技术效果。
第一方面,本发明实施例提供了一种避障跟随方法,包括:
应用于具有驱动单元的电子设备,所述驱动单元配置为为所述电子设备提供驱动力以使得所述电子设备主体能够产生运动,所述电子设备还具有图像采集单元,所述图像采集单元设置于所述电子设备主体上,所述方法包括:
基于所述图像采集单元获得的图像数据,确定要跟随的目标对象以及所述目标对象相对于所述图像采集单元的第一位置,并根据预设的第一跟随策略以及所述第一位置生成第一控制指令,并执行所述第一控制指令;其中,所述第一控制指令配置为控制所述图像采集单元的转动角度,使所述图像采集单元能够跟随所述目标对象;
获得所述目标对象相对于所述电子设备主体的第二位置;
基于所述图像数据,构建所述电子设备所处环境的障碍物地图;
基于所述障碍物地图以及所述第二位置,根据预设的第二跟随策略生成第二控制指令,并执行所述第二控制指令;其中,所述第二控制指令用于控制所述驱动单元驱动所述电子设备主体跟随所述目标对象,以及用于控制所述电子设备主体在跟随所述目标对象的过程中避开障碍物地图中的障碍物。
可选的,所述方法还包括:
获得所述图像采集单元相对于所述电子设备主体的偏角,并判断所述偏角是否超过阈值;
当所述偏角超过所述阈值时,基于所述偏角生成第三控制指令,并执行所述第三控制指令;所述第三控制指令用于控制所述电子设备主体在行进的过程中转动,以使所述电子设备主体与所述目标对象的距离收敛的同时,所述偏角也收敛。
可选的,所述方法还包括:
获得所述图像采集单元相对于所述电子设备主体的偏角,并判断所述偏角是否超过阈值;
当所述偏角超过所述阈值时,基于所述偏角生成第四控制指令,并执行所述第四控制指令;所述第四控制指令用于控制所述电子设备主体原地转动,以使所述电子设备主体与所述目标对象的偏角收敛。
可选的,基于所述图像数据,构建所述电子设备所处环境的障碍物地图,包括:
从所述图像数据中识别出多个对象,以及每个对象的位置;
根据所述目标对象的特征,从所述多个对象中去除所述目标对象,以及去除所述多个对象中的地面对象;
将去除所述目标对象和所述地面对象之后的所述对象确定为所述障碍物;
基于所述障碍物的位置构建所述障碍物地图。
可选的,在将去除所述目标对象和所述地面对象之后的所述对象确定为所述障碍物之后,还包括:
利用超声波传感器对所述所处环境进行检测,获得表示检测到的补偿障碍物位置的检测结果;
基于所述检测结果和所述障碍物的位置,确定出未能从所述图像数据中识别出的所述补偿障碍物,并将所述补偿障碍物也确定为所述障碍物。
可选的,基于所述障碍物的位置构建所述障碍物地图,包括:
获得本次构建所述障碍物地图与前一次构建所述障碍物地图之间的所述电子设备主体发生的运动;
根据所述电子设备主体发生的运动,对每个所述障碍物位置和前一次构建的所述障碍物地图进行积分,构建本次所述障碍物地图。
可选的,在根据预设的第二跟随策略生成第二控制指令之前,还包括:
对所述目标对象和所述障碍物进行轨迹参数发生器PTG逆变换,将所述目标对象和所述障碍物变换到路径参数TP空间中;
在所述TP空间,基于接近图ND算法,获得多个PTG逆变换结果,每个所述PTG逆变换结果表示所述电子设备主体跟随所述目标对象可能发生的路径;
利用代价函数对所述多个PTG逆变换结果进行评价,从所述多个PTG逆变换结果中确定出最佳PTG逆变换结果;
对所述最佳PTG逆变换结果进行PTG变换,获得所述最佳PTG逆变换结果对应的目标角速度和目标线速度;所述目标角速度和所述目标线速度为所述驱动单元确定所述电子设备主体运动的角速度和线速度,所述目标角速度和所述目标线速度用于生成所述第二控制指令。
第二方面,本发明实施例提供了一种电子设备,所述电子设备具有驱动单元,所述驱动单元配置为为所述电子设备提供驱动力以使得所述电子设备主体能够产生运动,所述电子设备还具有图像采集单元,所述图像采集单元设置于所述电子设备主体上,所述电子设备还包括:
第一跟随模块,配置为基于所述图像采集单元获得的图像数据,确定要跟随的目标对象以及所述目标对象相对于所述图像采集单元的第一位置,并根据预设的第一跟随策略以及所述第一位置生成第一控制指令,并执行所述第一控制指令;其中,所述第一控制指令用于控制所述图像采集单元的转动角度,使所述图像采集单元能够跟随所述目标对象;
第一获得模块,配置为获得所述目标对象相对于所述电子设备主体的第二位置;
构建模块,配置为基于所述图像数据,构建所述电子设备所处环境的障碍物地图;
第二跟随模块,配置为基于所述障碍物地图以及所述第二位置,根据预设的第二跟随策略生成第二控制指令,并执行所述第二控制指令;其中,所述第二控制指令用于控制所述驱动单元驱动所述电子设备主体跟随所述目标对象,以及用于控制所述电子设备主体在跟随所述目标对象的过程中避开障碍物地图中的障碍物。
可选的,所述电子设备还包括:
判断模块,配置为获得所述图像采集单元相对于所述电子设备主体的偏角,并判断所述偏角是否超过阈值;
转动模块,配置为当所述偏角超过所述阈值时,基于所述偏角生成第三控制指令,并执行所述第三控制指令;所述第三控制指令用于控制所述电子设备主体在行进的过程中转动,以使所述电子设备主体与所述目标对象的距离收敛的同时,所述偏角也收敛。
可选的,所述电子设备还包括:
判断模块,配置为获得所述图像采集单元相对于所述电子设备主体的偏角,并判断所述偏角是否超过阈值;
调整模块,配置为当所述偏角超过所述阈值时,基于所述偏角生成第四控制指令,并执行所述第四控制指令;所述第四控制指令用于控制所述电子设备主体原地转动,以使所述电子设备主体与所述目标对象的偏角收敛。
可选的,所述构建模块配置为从所述图像数据中识别出多个对象,以及每个对象的位置;根据所述目标对象的特征,从所述多个对象中去除所述目标对象,以及去除所述多个对象中的地面对象;将去除所述目标对象和所述地面对象之后的所述对象确定为所述障碍物;基于所述障碍物的位置构建所述障碍物地图。
可选的,所述电子设备还包括:
第二获得模块,配置为在将去除所述目标对象和所述地面对象之后的所述对象确定为所述障碍物之后,利用超声波传感器对所述所处环境进行检测,获得表示检测到的补偿障碍物位置的检测结果;
确定模块,配置为基于所述检测结果和所述障碍物位置,确定出未能从所述图像数据中识别出的所述补偿障碍物,并将所述补偿障碍物也确定为所述障碍物。
可选的,所述构建模块配置为获得本次构建所述障碍物地图与前一次构建所述障碍物地图之间的所述电子设备主体发生的运动;根据所述电子设备主体发生的运动,对每个所述障碍物位置和前一次构建的所述障碍物地图进行积分,构建本次所述障碍物地图。
可选的,所述电子设备还包括:
速度计算模块,配置为在根据预设的第二跟随策略生成第二控制指令之前,对所述目标对象和所述障碍物进行轨迹参数发生器PTG逆变换,将所述目标对象和所述障碍物变换到路径参数TP空间中;在所述TP空间,基于接近图ND算法,获得多个PTG逆变换结果,每个所述PTG逆变换结果表示所述电子设备主体跟随所述目标对象可能发生的路径;利用代价函数对所述多个PTG逆变换结果进行评价,从所述多个PTG逆变换结果中确定出最佳PTG逆变换结果;对所述最佳PTG逆变换结果进行PTG变换,获得所述最佳PTG逆变换结果对应的目标角速度和目标线速度;所述目标角速度和所述目标线速度为所述驱动单元确定所述电子设备主体运动的角速度和线速度,所述目标角速度和所述目标线速度用于生成所述第二控制指令。
第三方面,本发明实施例提供了一种电子设备,包括:处理器和用于存储能够在处理器上运行的计算机程序的存储器,其中,所述处理器用于运行所述计算机程序时,执行以上所述方法的步骤。
第四方面,本发明实施例提供了一种计算机可读存储介质,其上存储有计算机程序,其中,该计算机程序被处理器执行时实现以上所述方法的步骤。
本申请实施例中的上述一个或多个技术方案,至少具有如下一种或多种技术效果:
在本发明实施例的技术方案中,首先基于图像采集单元获得的图像数 据,确定要跟随的目标对象以及目标对象相对于图像采集单元的第一位置,进而控制图像采集单元转动,跟随目标对象。然后,通过获得目标对象相对于电子设备主体的第二位置,以及基于图像数据构建所处环境的障碍物地图,进而基于障碍物地图以及第二位置,控制驱动单元驱动电子设备主体跟随目标对象,并控制电子设备主体在跟随目标对象的过程中避开障碍物,由此解决了电子设备跟随目标对象碰撞障碍物,进而导致设备损坏,或者被障碍物阻拦而无法继续跟随的技术问题,实现了跟随目标对象,且避免碰撞障碍物的技术效果。
附图说明
图1为本发明实施例中避障跟随方法的流程图;
图2为本发明实施例中一示例性目标对象和目标对象区域;
图3为本发明实施例中一示例性目标对象、障碍物和电子设备俯视图;
图4为根据图3构建出的障碍物地图平面示意图;
图5为本发明实施例中一偏角示意图;
图6为本发明实施例中另一示例性障碍物地图;
图7为本发明实施例中电子设备的示意图。
具体实施方式
本发明实施例提供了一种避障跟随方法和电子设备,用于实现跟随运动中自动避免碰撞障碍物的技术效果。
为了解决上述技术问题,本发明实施例提供的技术方案总体思路如下:
在本发明实施例的技术方案中,首先基于图像采集单元获得的图像数据,确定要跟随的目标对象以及目标对象相对于图像采集单元的第一位置,进而控制图像采集单元转动,跟随目标对象。然后,通过获得目标对象相对于电子设备主体的第二位置,以及基于图像数据构建所处环境的障碍物 地图,进而基于障碍物地图以及第二位置,控制驱动单元驱动电子设备主体跟随目标对象,并控制电子设备主体在跟随目标对象的过程中避开障碍物,由此解决了电子设备跟随目标对象碰撞障碍物,进而导致设备损坏,或者被障碍物阻拦而无法继续跟随的技术问题,实现了跟随目标对象,且避免碰撞障碍物的技术效果。
下面通过附图以及具体实施例对本发明技术方案做详细的说明,应当理解本申请实施例以及实施例中的具体特征是对本申请技术方案的详细的说明,而不是对本申请技术方案的限定,在不冲突的情况下,本申请实施例以及实施例中的技术特征可以相互组合。
本文中术语“和/或”,仅仅是一种描述关联对象的关联关系,表示可以存在三种关系,例如,A和/或B,可以表示:单独存在A,同时存在A和B,单独存在B这三种情况。另外,本文中字符“/”,一般表示前后关联对象是一种“或”的关系。
本发明实施例第一方面提供了一种避障跟随方法,应用于一电子设备,例如平衡车或机器人等。电子设备具有驱动单元,驱动单元配置为为电子设备提供驱动力,以使得电子设备主体能够产生运动。在具体实现过程中,驱动单元例如为电机或舵机等,本发明实施例不做具体限制。本发明实施例中的电子设备还具有设置在电子设备主体上的图像采集单元。其中,图像采集单元的数量可以为一个,也可以为多个。且图像采集单元为多个时,每个图像采集单元的设置位置可以有所不同,本发明实施例不做具体限制。
下面请参考图1,为本发明实施例避障跟随方法的流程图。该方法包括:
S101:基于所述图像采集单元获得的图像数据,确定要跟随的目标对象以及所述目标对象相对于所述图像采集单元的第一位置,并根据预设的第一跟随策略以及所述第一位置生成第一控制指令,并执行所述第一控制指令;
S102:获得所述目标对象相对于所述电子设备主体的第二位置;
S103:基于所述图像数据,构建所述电子设备所处环境的障碍物地图;
S104:基于所述障碍物地图以及所述第二位置,根据预设的第二跟随策略生成第二控制指令,并执行所述第二控制指令。
具体来讲,图像采集单元采集图像数据,在S101中,基于图像数据,确定目标对象以及目标对象与图像采集单元之间的第一位置。具体来讲,电子设备按照预先存储的目标对象特征,在图像数据中进行匹配,获得图像中每个对象与目标对象的匹配度。如果匹配度达到阈值,则确定识别出目标对象;反之,如果匹配度未达到阈值,则确定未识别出目标对象。
举例来说,假设目标对象为一用户,则预先将通用人体特征存储在电子设备中。电子设备在图像数据中进行匹配,并获得图像中每个对象与通用人体特征的匹配度。其中,一个对象与通用人体特征的匹配度为95%,达到阈值80%,而其他对象的匹配度均为达到80%,故确定识别到目标对象。
在识别到目标对象后,基于目标对象边缘,获得内接目标对象的矩形框,该矩形框为目标对象区域。图2示出的一示例性目标对象和目标对象区域。然后,计算出目标对象区域中第一参考点的位置,并将第一参考点位置确定为第一位置。在本发明实施例中,第一参考点例如为目标对象区域中心点,顶点,或者目标图像区域中的其他点,本发明实施例不做具体限制。
当然,在具体实现过程中,如果有多个且不同类型的图像采集单元同时采集图像数据,例如RGB(Red Green Blue,红绿蓝)类型、深度图像类型和红外类型,则基于每个图像采集单元的图像数据确定出目标对象和第一位置之后,还可以进一步对各个目标对象和第一位置进行融合,从而得到更加准确的目标对象和第一位置。
然后,根据预设的第一跟随策略以及第一位置生成第一控制指令,并执行第一控制指令。具体来讲,第一跟随策略为图像采集单元朝向目标对象所在方向,跟随目标对象。第一控制指令用于控制图像采集单元的转动角度(如偏航角角度、俯仰角角度等),使图像采集单元能够跟随目标对象。根据第一跟随策略生成第一控制指令,为根据第一位置控制图像采集单元的转动角度,以使图像采集单元能够跟随目标对象的移动而转动到目标对象所在方向。
举例来说,第一控制指令具体为控制图像采集单元的转动角度,使得采集图像平面中心与目标对象区域中心重合。所以,在确定目标对象与图像采集单元的第一位置后,基于第一位置与图像采集平面中心的偏差,确定出采集图像平面中心与目标对象区域中心再次重合的偏航角角度和/或俯仰角角度。进而,基于偏航角角度和/或俯仰角角度生成第一控制指令,并执行第一控制指令,使得图像采集单元转动该偏航角角度和/或俯仰角角度,完成转动后采集图像平面中心与目标对象区域中心再次重合。
接下来,S102中,获得目标对象相对于电子设备主体的第二位置。
具体来讲,在本发明实施例中,目标对象相对电子设备主体的第二位置,至少包括目标对象与电子设备主体之间的角度和距离。在本发明实施例中,获得第二位置的方式有多种,下面介绍其中三种。
第一种:
图像采集单元包括深度图像采集单元。电子设备基于深度图像采集单元采集的深度图像数据,识别出目标对象距离。进一步从深度图像数据,或者其他图像采集单元采集的图像数据中识别出目标对象的角度,进而获得第二位置。
第二种:
在电子设备设置锚节点装置,目标对象设置信标装置。锚节点和信标 之间通过UWB(超带宽,Ultra-Wideband)进行通信。在通信过程中,根据锚节点的至少两根天线接收信标发送信号的时间差和相位差等,计算出锚节点与信标之间的距离和角度。进而,将锚节点与信标之间的距离和角度确定为第二位置。
第三种:
如果电子设备在室内跟随,则第三种方式为通过室内定位系统,定位出目标对象的室内位置,进而将室内定位系统发送的目标对象的室内位置确定为第二位置。
在具体实现过程中,本发明实施例所属领域的普通技术人员可以根据实际选择上述三种中任一种,或者其他方式获得第二位置,本发明实施例不做具体限制。
另外,本领域技术人员应当理解,尽管本发明实施例将S101记载在S102之前,但在具体实现过程中,S102也可以在S101之前执行,甚至与S101同时执行。
接下来,在S103中,基于图像数据,构建电子设备所处环境的障碍物地图。
具体来讲,在本发明实施例中,构建障碍物地图所基于的图像数据,可以为S101中确定目标对象和第一位置所基于的图像数据。换言之,利用相同的一个图像采集单元,或者相同的多个图像采集单元采集图像数据,从图像数据中识别出目标对象,以及再识别出障碍物和障碍物位置,进而构建障碍物地图。
或者,构建障碍物地图所基于的图像数据,也可以不同于S101所基于的图像数据。换言之,利用至少两个不同的图像采集单元分别采集图像数据,从其中至少一组图像数据中识别出目标对象,以及从其余图像数据中识别障碍物和障碍物位置。
举例来说,在机器人头部设置GRB摄像头,在机器人身体正面设置深度摄像头,跟随过程中两个摄像头均处于图像采集状态。然后,机器人从RGB图像数据中识别目标对象和第一位置,从深度图像数据中识别障碍物和障碍物位置,然后基于障碍物位置构建障碍物地图。
类似地,本领域技术人员还应当理解,尽管本发明实施例将S101和S102记载在S103之前,但在具体实现过程中,S101、S102和S103的执行顺序可以任意,甚至同时执行,本发明实施例不做限制。
最后,在S104中,基于障碍物地图和第二位置,根据预设的第二跟随策略生成第二控制指令。
具体来讲,第二跟随策略为目标对象与电子设备主体的距离收敛,且避开碰撞障碍物。第二控制指令用于控制驱动单元驱动电子设备主体跟随目标对象,以及用于控制电子设备主体在跟随目标对象的过程中避开障碍物。根据第二跟随策略生成第二控制指令,为根据第二位置和障碍物位置,控制驱动单元驱动电子设备主体运动的线速度和角速度,以使电子设备避开障碍物跟随目标对象运动。
举例来说,请参考图3,为一示例性目标对象、障碍物和电子设备俯视图,图4为根据图3构建出的障碍物地图平面示意图。为方便说明,将目标对象用矩形也表示在图4的障碍物地图中。图4中的白色圆圈表示目标对象,黑色圆圈表示障碍物。
第二位置为(30°,3),即目标对象与电子设备主体之间的角度为30°,距离为3米。障碍物位置为(5°,0.5),即障碍物与电子设备主体之间的角度为5°,距离为0.5米。基于(30°,3)和(5°,0.5),确定目标线速度和目标角速度,并基于目标线速度和目标角速度生成并执行第二控制指令。最终,电子设备跟随目标对象的运动轨迹如图3中曲线所示。
由上述描述可知,基于图像采集单元获得的图像数据,确定要跟随的 目标对象以及目标对象相对于图像采集单元的第一位置,进而控制图像采集单元转动并朝向目标对象。然后,通过获得目标对象相对于电子设备主体的第二位置,以及基于图像数据构建所处环境的障碍物地图,进而基于障碍物地图以及第二位置,控制驱动单元驱动电子设备主体跟随目标对象,并控制电子设备主体在跟随目标对象的过程中避开障碍物地图中的障碍物,由此解决了电子设备跟随目标对象碰撞障碍物,进而导致设备损坏,或者被障碍物阻拦而无法继续跟随的技术问题,实现了跟随目标对象,且避免碰撞障碍物的技术效果。
进一步,对于电子设备图像采集单元与电子设备主体之间的协调,本发明实施例中有如下三种方式:
第一种:
获得所述图像采集单元相对于所述电子设备主体的偏角,并判断所述偏角是否超过阈值;
当所述偏角超过所述阈值时,基于所述偏角生成第三控制指令,并执行所述第三控制指令;所述第三控制指令用于控制所述电子设备主体在行进的过程中转动,以使所述电子设备主体与所述目标对象的距离收敛的同时,所述偏角也收敛。
具体来讲,首先获得图像采集单元相对于电子设备的偏角。在本发明实施例中,图像采集单元相对于电子设备的偏角,具体为图像采集单元的第一参考直线与电子设备主体第二参考直线之间的夹角。例如,请参考图5,第一参考线为图像采集单元光轴X1,第二参考线为电子设备主体平行于运动方向的轴X2,则图5中θ就是图像采集单元相对于电子设备的偏角。
接着,判断偏角是否超过阈值,当偏角超过阈值时,基于偏角生成第三控制指令,并执行第三控制指令。具体来讲,阈值例如为35°或60°等,本发明实施例不做具体限制。第三控制指令用于控制电子设备主体在行进 的过程中转动,以使电子设备主体与目标对象的距离收敛的同时,偏角也收敛。当偏角超过阈值时,在控制电子设备跟随目标对象的同时,控制驱动单元带到电子设备主体朝偏角收敛的方向旋转,也即边跟随边旋转。沿用图5中的例子,则控制驱动单元跟随的同时,带到电子设备主体逆时针旋转。
而偏角未超过阈值时,则可以控制驱动单元仅驱动电子设备主体跟随目标对象,而不旋转电子设备主体,也可以控制驱动单元驱动电子设备主体跟随目标对象的同时适当旋转电子设备主体,以使偏角不过过大。本发明实施例所属领域的普通技术人员可以根据实际进行选择,本发明实施例不做具体限制。
第二种:
在第二种实现方式中,可以获得图像采集单元相对于电子设备的偏角,与也可以不获得。但是,在第二种方式中,图像采集单元始终跟随目标对象,电子设备主体也始终跟随目标对象,但在偏角超过阈值时,不需要调整偏角收敛。
第三种:
获得所述图像采集单元相对于所述电子设备主体的偏角,并判断所述偏角是否超过阈值;
当所述偏角超过所述阈值时,基于所述偏角生成第四控制指令,并执行所述第四控制指令;所述第四控制指令用于控制所述电子设备主体原地转动,以使所述电子设备主体与所述目标对象的偏角收敛。
第三种方式中获得偏角的方式与第一种方式类似,此处就再重复赘述了。与第一种方式不同的时,当偏角超过阈值时,基于偏角生成第四控制指令,并执行第四控制指令。其中,第四控制指令用于控制电子设备主体原地转动,以使电子设备主体与目标对象的偏角收敛。
具体来讲,当偏角超过阈值时,将控制驱动单元带到电子设备主体原地旋转。原地旋转时,电子设备线速度为零,直到偏角收敛到阈值,再恢复不为零的线速度。
而偏角未超过阈值时,则可以控制驱动单元仅驱动电子设备主体跟随目标对象,而不旋转电子设备主体,也可以控制驱动单元驱动电子设备主体跟随目标对象的同时适当旋转电子设备主体,以使偏角不过过大。本发明实施例所属领域的普通技术人员可以根据实际进行选择,本发明实施例不做具体限制。
在具体实现过程中,本发明实施例所属领域的普通技术人员可以选择上述方式中的任意一种,本发明实施例不做具体限制。
接下来对如何基于图像数据构建障碍物地图进行详细介绍。在本发明实施例中,构建障碍物地图具体通过如下过程实现:
从所述图像数据中识别出多个对象,以及每个对象的位置;
根据所述目标对象的特征,从所述多个对象中去除所述目标对象,以及去除所述多个对象中的地面对象;
将去除所述目标对象和所述地面对象之后的所述对象确定为所述障碍物;
基于所述障碍物的位置构建所述障碍物地图。
具体来讲,首先从图像数据识别出多个对象,以及每个对象的位置。其中,对象可以为地面、天花板、桌子、椅子、箱子、盆栽、目标对象等。本发明实施例中,在构建障碍物地图时所基于的图像数据具体为深度图像数据,那么,对象的位置就具体为对象在所处环境空间中的三维位置。
为了避免电子设备将目标对象当成障碍物避开,根据预先设置的目标对象的特征,从多个对象中确定出目标对象,并从多个对象中去除目标对象。
另外,由于大地也被识别为对象,而大地并不需要避开,所以,进一步还需要去除地面对象。本发明实施例中的地面对象指的是地面、地板、斜坡等运动面对象。
具体来讲,由于无论电子设备怎样运动,地面对象的在垂直于运动面轴上的坐标只会发生较小的变化,甚至不发生变化。所以去除地面对象时,首先根据各个对象垂直于运动面轴上的坐标,提取出发生较小的变化,甚至不发生变化的对象,进而将这些对象作为地面对象去除。
在具体实现过程中,去除目标对象和地面对象的顺序不做限制。
去除目标对象和地面对象后的其他对象就确定为障碍物。然后,根据每个障碍物的三维位置,构建出障碍物地图。在本发明实施例中,如图6示出的另一示例性障碍物地图。在图6所示的障碍物地图中,以黑色表示障碍物,那么电子设备在跟随时,避开黑色区域,从而实现避障跟随。
进一步,由于图像数据可以无法体现出某些障碍物,例如玻璃,或者黑色物体,所以为了进一步从所处环境中识别出障碍物,作为一种可选的实施例,在去除地面对象和目标对象后,还包括:
利用超声波传感器对所述所处环境进行检测,获得表示检测到的补偿障碍物位置的检测结果;
基于所述检测结果和所述障碍物的位置,确定出未能从所述图像数据中识别出的补偿障碍物,并将所述补偿障碍物也确定为所述障碍物。
具体来讲,本发明实施例中的电子设备主体上设置有超声波传感器,配置为向外发送超声波,并接收返回的超声波。在需要构建障碍物地图时,启动超声波传感器向外发送超声波,超声波遇到所处环境中的障碍物会返回,且障碍物的位置的不同,返回超声波的入射角度有所不同。所以,超声波传感器接收返回的超声波时,读取返回超声波的入射角度,然后获得检测结果。在本发明实施例中,将超声波传感器检测到的障碍物称为补偿 障碍物,检测结果表示补偿障碍物的位置。
由于超声波遇到大部分障碍物都会返回,所以补偿障碍物中包括基于图像数据识别出障碍物。所以,基于检测结果计算出各个补偿障碍物的位置,然后对比前述从图像数据中识别出的障碍物的位置,如果补偿障碍物位置与障碍物的位置不一致,则表示该位置不一致的补偿障碍物从图像数据中并没有被识别出,进而将该补偿障碍物也确定为障碍物。
由此,基于所有障碍物的位置,构建出更加精确的障碍物地图。
由上述描述可以看出,利用超声波传感器对所处环境进行检测,获得检测结果,并基于检测结果确定出从图像数据中未能识别出的补偿障碍物,补充电子设备确定出的障碍物,使得由此构建的障碍物地图更加精确和全面。
作为一种可选的实施例,基于障碍物的位置构建障碍物地图具体通过如下过程实现:
获得本次构建所述障碍物地图与前一次构建所述障碍物地图之间的所述电子设备主体发生的运动;
根据所述电子设备主体发生的运动,对每个所述障碍物的位置和前一次构建的所述障碍物地图进行积分,构建本次所述障碍物地图。
具体来讲,在本发明实施例中,跟随目标对象转动的图像采集单元和构建障碍物地图的图像采集单元为同一图像采集单元。如果图像采集单元与电子设备主体的偏角较大,以致图像采集范围中已不包括跟随前方范围时,为了避免跟随过程中碰撞障碍物,首先需要获得构建本次障碍物地图与前一次构建障碍物地图之间电子设备主体发生的运动。
具体来讲,电子设备包括IMU(惯性检测单元,Inertial measurement unit)。电子设备读取IMU在本次构建障碍物地图和前一次构建障碍物地图之间检测到的运动参数,基于IMU动力学方程式,计算出电子设备主体发 生的运动。本发明实施例中,电子设备主体发生的运动指的是电子设备主体发生的旋转和位移。
然后,根据电子设备发生的运动,确定将前一次构建障碍物地图所参考的三维坐标系转换到与构建本次障碍物地图所参考的三维坐标系一致,从而使得前一次构建的障碍物地图能够与本次构建障碍物地图采集的图像数据匹配。
然后,对本次检测到的障碍物的位置和前一次构建的障碍物地图进行积分,将本次构建障碍物地图识别出的障碍物的位置与前一次构建的障碍物地图融合在一起,获得覆盖范围大于当前图像采集范围的障碍物地图。
由此可见,如果图像采集单元与电子设备主体的偏角较大,且图像采集范围中已不包括跟随前方范围时,由于障碍物地图所覆盖的范围大于图像采集范围,所以电子设备基于障碍物地图依然可以确定跟随前方是否有障碍物,以及障碍物具体的位置,从而避开障碍物。
作为一种可选的实施,在根据第二跟随策略生成第二控制指令之前,还包括:
对所述目标对象和所述障碍物进行轨迹参数发生器PTG逆变换,将所述目标对象和所述障碍物变换到路径参数TP空间中;
在所述TP空间,基于接近图ND算法,获得多个PTG逆变换结果,每个所述PTG逆变换结果表示所述电子设备主体跟随所述目标对象可能发生的路径;
利用代价函数对所述多个PTG逆变换结果进行评价,从所述多个PTG逆变换结果中确定出最佳PTG逆变换结果;
对所述最佳PTG逆变换结果进行PTG变换,获得所述最佳PTG逆变换结果对应的目标角速度和目标线速度;所述目标角速度和所述目标线速度为所述驱动单元确定所述电子设备主体运动的角速度和线速度,所述目 标角速度和所述目标线速度用于生成所述第二控制指令。
具体来讲,首先对目标对象和障碍物地图中的各个障碍物进行PTG(轨迹参数发生器,Parameter Trajectory Generator)逆变换,进而将目标对象和各个障碍物都变换到TP(路径参数,Trajectory Parameter)空间中。然后,在TP空间,基于ND(接近图,Nearness Diagram)算法,计算出多个PTG逆变换结果。在本发明实施例中,PTG逆变换结果表示电子设备主体从当前位置接近目标对象,且避开障碍物可能发生的路径。
接下来,将每个PTG逆变换结果输入代价函数,进而得到每个PTG逆变换结果的分数。通过每个PTG逆变换结果对应的分数评价每条路径的优选性。最终,将分数最高的PTG逆变换结果确定为最佳PTG逆变换结果。
最后,将最佳PTG逆变换结果再进行PTG变换。PTG逆变换结果经过PTG变换后获得的结果为目标角速度和目标线速度。目标角速度和目标线速度具体为发生最佳PTG逆变换结果表示的路径所需要的角速度和线速度。所以,电子设备基于目标角速度和目标线速度控制驱动单元,使得驱动单元驱动电子设备主体的角速度和线速度为目标角速度和目标线速度,从而按照最佳PTG逆变换结果表示的路径跟随对象。
基于与前述实施例中避障跟随的方法同样的发明构思,本发明实施例第二方面还提供一种电子设备。具体来讲,本发明实施例中的电子设备具有驱动单元,驱动单元配置为为电子设备提供驱动力以使得电子设备主体能够产生运动。电子设备还具有图像采集单元,图像采集单元设置于电子设备主体上。如图7所示,电子设备还包括:
第一跟随模块101,配置为基于所述图像采集单元获得的图像数据,确定要跟随的目标对象以及所述目标对象相对于所述图像采集单元的第一位置,并根据预设的第一跟随策略以及所述第一位置生成第一控制指令,并执行所述第一控制指令;其中,所述第一控制指令用于控制所述图像采集 单元的转动角度,使所述图像采集单元能够跟随所述目标对象;
第一获得模块102,配置为获得所述目标对象相对于所述电子设备主体的第二位置;
构建模块103,配置为基于所述图像数据,构建所述电子设备所处环境的障碍物地图;
第二跟随模块104,配置为基于所述障碍物地图以及所述第二位置,根据预设的第二跟随策略生成第二控制指令,并执行所述第二控制指令;其中,所述第二控制指令用于控制所述驱动单元驱动所述电子设备主体跟随所述目标对象,以及用于控制所述电子设备主体在跟随所述目标对象的过程中避开障碍物地图中的障碍物。
可选的,电子设备还包括:
判断模块,配置为获得所述图像采集单元相对于所述电子设备主体的偏角,并判断所述偏角是否超过阈值;
转动模块,配置为当所述偏角超过所述阈值时,基于所述偏角生成第三控制指令,并执行所述第三控制指令;所述第三控制指令用于控制所述电子设备主体在行进的过程中转动,以使所述电子设备主体与所述目标对象的距离收敛的同时,所述偏角也收敛。
可选的,电子设备还包括:
判断模块,配置为获得所述图像采集单元相对于所述电子设备主体的偏角,并判断所述偏角是否超过阈值;
调整模块,配置为当所述偏角超过所述阈值时,基于所述偏角生成第四控制指令,并执行所述第四控制指令;所述第四控制指令用于控制所述电子设备主体原地转动,以使所述电子设备主体与所述目标对象的偏角收敛。
可选的,构建模块103配置为从所述图像数据中识别出多个对象,以 及每个对象的位置;根据所述目标对象的特征,从所述多个对象中去除所述目标对象,以及去除所述多个对象中的地面对象;将去除所述目标对象和所述地面对象之后的所述对象确定为所述障碍物;基于所述障碍物的位置构建所述障碍物地图。
可选的,电子设备还包括:
第二获得模块,配置为在将去除所述目标对象和所述地面对象之后的所述对象确定为所述障碍物之后,利用超声波传感器对所述所处环境进行检测,获得表示检测到的补偿障碍物位置的检测结果;
确定模块,配置为基于所述检测结果和所述障碍物的位置,确定出未能从所述图像数据中识别出的所述补偿障碍物,并将所述补偿障碍物也确定为所述障碍物。
可选的,构建模块103配置为获得本次构建所述障碍物地图与前一次构建所述障碍物地图之间的所述电子设备主体发生的运动;根据所述电子设备主体发生的运动,对每个所述障碍物的位置和前一次构建的所述障碍物地图进行积分,构建本次所述障碍物地图。
可选的,电子设备还包括:
速度计算模块,配置为在根据预设的第二跟随策略生成第二控制指令之前,对所述目标对象和所述障碍物进行轨迹参数发生器PTG逆变换,将所述目标对象和所述障碍物变换到路径参数TP空间中;在所述TP空间,基于接近图ND算法,获得多个PTG逆变换结果,每个所述PTG逆变换结果表示所述电子设备主体跟随所述目标对象可能发生的路径;利用代价函数对所述多个PTG逆变换结果进行评价,从所述多个PTG逆变换结果中确定出最佳PTG逆变换结果;对所述最佳PTG逆变换结果进行PTG变换,获得所述最佳PTG逆变换结果对应的目标角速度和目标线速度;所述目标角速度和所述目标线速度为所述驱动单元确定所述电子设备主体运动的角 速度和线速度,所述目标角速度和所述目标线速度用于生成所述第二控制指令。
前述图1-图6实施例中的避障跟随方法的各种变化方式和具体实例同样适用于本实施例的电子设备,通过前述对避障跟随方法的详细描述,本领域技术人员可以清楚的知道本实施例中电子设备的实施方法,所以为了说明书的简洁,在此不再详述。
实际应用中,所述图像采集单元可以具体为摄像头,所述驱动单元可以具体为驱动或动力组件;所述第一跟随模块、第一获得模块、构建模块以及第二跟随模块、判断模块、转动模块、调整模块、第二获得模块、确定模块以及速度计算模块均可以由位于电子设备上的中央处理器(CPU)、或微处理器(MPU)、或数字信号处理器(DSP)、或可编程门阵列(FPGA)实现。
本实施例还提供了一种电子设备,,包括:处理器和用于存储能够在处理器上运行的计算机程序的存储器,其中,所述处理器用于运行所述计算机程序时,执行以上所述方法的步骤。
这里,实际应用中,存储器可以由任何类型的易失性或非易失性存储设备、或者它们的组合来实现。其中,非易失性存储器可以是只读存储器(ROM,Read Only Memory)、可编程只读存储器(PROM,Programmable Read-Only Memory)、可擦除可编程只读存储器(EPROM,Erasable Programmable Read-Only Memory)、电可擦除可编程只读存储器(EEPROM,Electrically Erasable Programmable Read-Only Memory)、磁性随机存取存储器(FRAM,Ferromagnetic Random Access Memory)、快闪存储器(Flash Memory)、磁表面存储器、光盘、或只读光盘(CD-ROM,Compact Disc Read-Only Memory);磁表面存储器可以是磁盘存储器或磁带存储器。易失性存储器可以是随机存取存储器(RAM,Random Access Memory),其用作 外部高速缓存。通过示例性但不是限制性说明,许多形式的RAM可用,例如静态随机存取存储器(SRAM,Static Random Access Memory)、同步静态随机存取存储器(SSRAM,Synchronous Static Random Access Memory)、动态随机存取存储器(DRAM,Dynamic Random Access Memory)、同步动态随机存取存储器(SDRAM,Synchronous Dynamic Random Access Memory)、双倍数据速率同步动态随机存取存储器(DDRSDRAM,Double Data Rate Synchronous Dynamic Random Access Memory)、增强型同步动态随机存取存储器(ESDRAM,Enhanced Synchronous Dynamic Random Access Memory)、同步连接动态随机存取存储器(SLDRAM,SyncLink Dynamic Random Access Memory)、直接内存总线随机存取存储器(DRRAM,Direct Rambus Random Access Memory)。本发明实施例描述的存储器旨在包括但不限于这些和任意其它适合类型的存储器。
所述处理器可能是一种集成电路芯片,具有信号的处理能力。在实现过程中,上述方法的各步骤可以通过处理器中的硬件的集成逻辑电路或者软件形式的指令完成。上述的处理器可以是通用处理器、数字信号处理器(DSP,Digital Signal Processor),或者其他可编程逻辑器件、分立门或者晶体管逻辑器件、分立硬件组件等。处理器可以实现或者执行本发明实施例中的公开的各方法、步骤及逻辑框图。通用处理器可以是微处理器或者任何常规的处理器等。结合本发明实施例所公开的方法的步骤,可以直接体现为硬件译码处理器执行完成,或者用译码处理器中的硬件及软件模块组合执行完成。软件模块可以位于存储介质中,该存储介质位于存储器,处理器读取存储器中的信息,结合其硬件完成前述方法的步骤。
本实施例还提供了一种计算机可读存储介质,例如包括计算机程序的存储器,上述计算机程序可由电子设备的处理器执行,以完成前述方法所述步骤。计算机可读存储介质可以是FRAM、ROM、可编程只读存储器 PROM、EPROM、EEPROM、Flash Memory、磁表面存储器、光盘、或CD-ROM等存储器;也可以是包括上述存储器之一或任意组合的各种设备。
本申请实施例中的上述一个或多个技术方案,至少具有如下一种或多种技术效果:
在本发明实施例的技术方案中,首先基于图像采集单元获得的图像数据,确定要跟随的目标对象以及目标对象相对于图像采集单元的第一位置,进而控制图像采集单元转动,跟随目标对象。然后,通过获得目标对象相对于电子设备主体的第二位置,以及基于图像数据构建所处环境的障碍物地图,进而基于障碍物地图以及第二位置,控制驱动单元驱动电子设备主体跟随目标对象,并控制电子设备主体在跟随目标对象的过程中避开障碍物,由此解决了电子设备跟随目标对象碰撞障碍物,进而导致设备损坏,或者被障碍物阻拦而无法继续跟随的技术问题,实现了跟随目标对象,且避免碰撞障碍物的技术效果。
本领域内的技术人员应明白,本发明的实施例可提供为方法、系统、或计算机程序产品。因此,本发明可采用完全硬件实施例、完全软件实施例、或结合软件和硬件方面的实施例的形式。而且,本发明可采用在一个或多个其中包含有计算机可用程序代码的计算机可用存储介质(包括但不限于磁盘存储器、CD-ROM、光学存储器等)上实施的计算机程序产品的形式。
本发明是参照根据本发明实施例的方法、设备(系统)、和计算机程序产品的流程图和/或方框图来描述的。应理解可由计算机程序指令实现流程图和/或方框图中的每一流程和/或方框、以及流程图和/或方框图中的流程和/或方框的结合。可提供这些计算机程序指令到通用计算机、专用计算机、嵌入式处理机或其他可编程数据处理设备的处理器以产生一个机器,使得通过计算机或其他可编程数据处理设备的处理器执行的指令产 生用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的装置。
这些计算机程序指令也可存储在能引导计算机或其他可编程数据处理设备以特定方式工作的计算机可读存储器中,使得存储在该计算机可读存储器中的指令产生包括指令装置的制造品,该指令装置实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能。
这些计算机程序指令也可装载到计算机或其他可编程数据处理设备上,使得在计算机或其他可编程设备上执行一系列操作步骤以产生计算机实现的处理,从而在计算机或其他可编程设备上执行的指令提供用于实现在流程图一个流程或多个流程和/或方框图一个方框或多个方框中指定的功能的步骤。
显然,本领域的技术人员可以对本发明进行各种改动和变型而不脱离本发明的精神和范围。这样,倘若本发明的这些修改和变型属于本发明权利要求及其等同技术的范围之内,则本发明也意图包含这些改动和变型在内。
工业实用性
本发明实施例解决了电子设备跟随目标对象碰撞障碍物,进而导致设备损坏,或者被障碍物阻拦而无法继续跟随的技术问题,实现了跟随目标对象,且避免碰撞障碍物的技术效果。

Claims (16)

  1. 一种避障跟随方法,应用于具有驱动单元的电子设备,所述驱动单元配置为为所述电子设备提供驱动力以使得所述电子设备主体能够产生运动,所述电子设备还具有图像采集单元,所述图像采集单元设置于所述电子设备主体上,所述方法包括:
    基于所述图像采集单元获得的图像数据,确定要跟随的目标对象以及所述目标对象相对于所述图像采集单元的第一位置,并根据预设的第一跟随策略以及所述第一位置生成第一控制指令,并执行所述第一控制指令;其中,所述第一控制指令用于控制所述图像采集单元的转动角度,使所述图像采集单元能够跟随所述目标对象;
    获得所述目标对象相对于所述电子设备主体的第二位置;
    基于所述图像数据,构建所述电子设备所处环境的障碍物地图;
    基于所述障碍物地图以及所述第二位置,根据预设的第二跟随策略生成第二控制指令,并执行所述第二控制指令;其中,所述第二控制指令用于控制所述驱动单元驱动所述电子设备主体跟随所述目标对象,以及用于控制所述电子设备主体在跟随所述目标对象的过程中避开障碍物地图中的障碍物。
  2. 如权利要求1所述的方法,其中,所述方法还包括:
    获得所述图像采集单元相对于所述电子设备主体的偏角,并判断所述偏角是否超过阈值;
    当所述偏角超过所述阈值时,基于所述偏角生成第三控制指令,并执行所述第三控制指令;所述第三控制指令用于控制所述电子设备主体在行进的过程中转动,以使所述电子设备主体与所述目标对象的距离收敛的同时,所述偏角也收敛。
  3. 如权利要求1所述的方法,其中,所述方法还包括:
    获得所述图像采集单元相对于所述电子设备主体的偏角,并判断所述偏角是否超过阈值;
    当所述偏角超过所述阈值时,基于所述偏角生成第四控制指令,并执行所述第四控制指令;所述第四控制指令用于控制所述电子设备主体原地转动,以使所述电子设备主体与所述目标对象的偏角收敛。
  4. 如权利要求1所述的方法,其中,基于所述图像数据,构建所述电子设备所处环境的障碍物地图,包括:
    从所述图像数据中识别出多个对象,以及每个对象的位置;
    根据所述目标对象的特征,从所述多个对象中去除所述目标对象,以及去除所述多个对象中的地面对象;
    将去除所述目标对象和所述地面对象之后的对象确定为所述障碍物;
    基于所述障碍物的位置构建所述障碍物地图。
  5. 如权利要求4所述的方法,其中,在将去除所述目标对象和所述地面对象之后的所述对象确定为所述障碍物之后,还包括:
    利用超声波传感器对所述所处环境进行检测,获得表示检测到的补偿障碍物位置的检测结果;
    基于所述检测结果和所述障碍物的位置,确定出未能从所述图像数据中识别出的所述补偿障碍物,并将所述补偿障碍物也确定为所述障碍物。
  6. 如权利要求5所述的方法,其中,基于所述障碍物的位置构建所述障碍物地图,包括:
    获得本次构建所述障碍物地图与前一次构建所述障碍物地图之间的所述电子设备主体发生的运动;
    根据所述电子设备主体发生的运动,对每个所述障碍物位置和前一次构建的所述障碍物地图进行积分,构建本次所述障碍物地图。
  7. 如权利要求1所述的方法,其中,在根据预设的第二跟随策略生成第二控制指令之前,还包括:
    对所述目标对象和所述障碍物进行轨迹参数发生器PTG逆变换,将所述目标对象和所述障碍物变换到路径参数TP空间中;
    在所述TP空间,基于接近图ND算法,获得多个PTG逆变换结果,每个所述PTG逆变换结果表示所述电子设备主体跟随所述目标对象可能发生的路径;
    利用代价函数对所述多个PTG逆变换结果进行评价,从所述多个PTG逆变换结果中确定出最佳PTG逆变换结果;
    对所述最佳PTG逆变换结果进行PTG变换,获得所述最佳PTG逆变换结果对应的目标角速度和目标线速度;所述目标角速度和所述目标线速度为所述驱动单元确定所述电子设备主体运动的角速度和线速度,所述目标角速度和所述目标线速度用于生成所述第二控制指令。
  8. 一种电子设备,所述电子设备具有驱动单元,所述驱动单元配置为为所述电子设备提供驱动力以使得所述电子设备主体能够产生运动,所述电子设备还具有图像采集单元,所述图像采集单元设置于所述电子设备主体上,所述电子设备还包括:
    第一跟随模块,配置为基于所述图像采集单元获得的图像数据,确定要跟随的目标对象以及所述目标对象相对于所述图像采集单元的第一位置,并根据预设的第一跟随策略以及所述第一位置生成第一控制指令,并执行所述第一控制指令;其中,所述第一控制指令用于控制所述图像采集单元的转动角度,使所述图像采集单元能够跟随所述目标对象;
    第一获得模块,配置为获得所述目标对象相对于所述电子设备主体的第二位置;
    构建模块,配置为基于所述图像数据,构建所述电子设备所处环境的 障碍物地图;
    第二跟随模块,配置为基于所述障碍物地图以及所述第二位置,根据预设的第二跟随策略生成第二控制指令,并执行所述第二控制指令;其中,所述第二控制指令用于控制所述驱动单元驱动所述电子设备主体跟随所述目标对象,以及用于控制所述电子设备主体在跟随所述目标对象的过程中避开障碍物地图中的障碍物。
  9. 如权利要求8所述的电子设备,其中,所述电子设备还包括:
    判断模块,配置为获得所述图像采集单元相对于所述电子设备主体的偏角,并判断所述偏角是否超过阈值;
    转动模块,配置为当所述偏角超过所述阈值时,基于所述偏角生成第三控制指令,并执行所述第三控制指令;所述第三控制指令用于控制所述电子设备主体在行进的过程中转动,以使所述电子设备主体与所述目标对象的距离收敛的同时,所述偏角也收敛。
  10. 如权利要求8所述的电子设备,其中,所述电子设备还包括:
    判断模块,配置为获得所述图像采集单元相对于所述电子设备主体的偏角,并判断所述偏角是否超过阈值;
    调整模块,配置为当所述偏角超过所述阈值时,基于所述偏角生成第四控制指令,并执行所述第四控制指令;所述第四控制指令用于控制所述电子设备主体原地转动,以使所述电子设备主体与所述目标对象的偏角收敛。
  11. 如权利要求8所述的电子设备,其中,所述构建模块配置为从所述图像数据中识别出多个对象,以及每个对象的位置;根据所述目标对象的特征,从所述多个对象中去除所述目标对象,以及去除所述多个对象中的地面对象;将去除所述目标对象和所述地面对象之后的所述对象确定为所述障碍物;基于所述障碍物的位置构建所述障碍物地图。
  12. 如权利要求11所述的电子设备,其中,所述电子设备还包括:
    第二获得模块,配置为在将去除所述目标对象和所述地面对象之后的所述对象确定为所述障碍物之后,利用超声波传感器对所述所处环境进行检测,获得表示检测到的补偿障碍物位置的检测结果;
    确定模块,配置为基于所述检测结果和所述障碍物位置,确定出未能从所述图像数据中识别出的所述补偿障碍物,并将所述补偿障碍物也确定为所述障碍物。
  13. 如权利要求12所述的电子设备,其中,所述构建模块配置为获得本次构建所述障碍物地图与前一次构建所述障碍物地图之间的所述电子设备主体发生的运动;根据所述电子设备主体发生的运动,对每个所述障碍物位置和前一次构建的所述障碍物地图进行积分,构建本次所述障碍物地图。
  14. 如权利要求8所述的电子设备,其中,所述电子设备还包括:
    速度计算模块,配置为在根据预设的第二跟随策略生成第二控制指令之前,对所述目标对象和所述障碍物进行轨迹参数发生器PTG逆变换,将所述目标对象和所述障碍物变换到路径参数TP空间中;在所述TP空间,基于接近图ND算法,获得多个PTG逆变换结果,每个所述PTG逆变换结果表示所述电子设备主体跟随所述目标对象可能发生的路径;利用代价函数对所述多个PTG逆变换结果进行评价,从所述多个PTG逆变换结果中确定出最佳PTG逆变换结果;对所述最佳PTG逆变换结果进行PTG变换,获得所述最佳PTG逆变换结果对应的目标角速度和目标线速度;所述目标角速度和所述目标线速度为所述驱动单元确定所述电子设备主体运动的角速度和线速度,所述目标角速度和所述目标线速度用于生成所述第二控制指令。
  15. 一种电子设备,包括:处理器和用于存储能够在处理器上运行的 计算机程序的存储器,其中,所述处理器用于运行所述计算机程序时,执行权利要求1至7所述方法的步骤。
  16. 一种计算机可读存储介质,其上存储有计算机程序,其中,该计算机程序被处理器执行时实现权利要求1至7所述方法的步骤。
PCT/CN2017/110749 2016-10-25 2017-11-13 一种避障跟随方法和电子设备、存储介质 WO2018077306A1 (zh)

Applications Claiming Priority (4)

Application Number Priority Date Filing Date Title
CN201610941439.3 2016-10-25
CN201610941439 2016-10-25
CN201611033439.X 2016-11-14
CN201611033439.XA CN106774301B (zh) 2016-10-25 2016-11-14 一种避障跟随方法和电子设备

Publications (1)

Publication Number Publication Date
WO2018077306A1 true WO2018077306A1 (zh) 2018-05-03

Family

ID=58970763

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2017/110749 WO2018077306A1 (zh) 2016-10-25 2017-11-13 一种避障跟随方法和电子设备、存储介质

Country Status (2)

Country Link
CN (1) CN106774301B (zh)
WO (1) WO2018077306A1 (zh)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109079746A (zh) * 2018-11-02 2018-12-25 中国人民解放军陆军工程大学 一种四轮及六足可变形的实训机器人装置及控制方法
CN110709792A (zh) * 2018-07-23 2020-01-17 深圳市大疆创新科技有限公司 移动平台的辅助移动方法、移动装置及移动平台
CN110955241A (zh) * 2019-11-22 2020-04-03 深圳市优必选科技股份有限公司 移动机器人避障方法、装置、移动机器人及存储介质
CN111982134A (zh) * 2020-08-10 2020-11-24 北京轩宇空间科技有限公司 适应未知动态空间的路径跟随控制方法、装置及存储介质
CN112613469A (zh) * 2020-12-30 2021-04-06 深圳市优必选科技股份有限公司 目标对象的运动控制方法及相关设备

Families Citing this family (16)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106774301B (zh) * 2016-10-25 2020-04-24 纳恩博(北京)科技有限公司 一种避障跟随方法和电子设备
US10627828B2 (en) * 2017-06-30 2020-04-21 Casio Computer Co., Ltd. Autonomous movement device, autonomous movement method and program recording medium
CN107713230A (zh) * 2017-09-30 2018-02-23 合肥学院 一种智能跟随代步箱包及其控制方法
CN108732925B (zh) * 2017-11-01 2021-12-14 北京猎户星空科技有限公司 智能设备的行进控制方法、装置和智能设备
CN108107884A (zh) * 2017-11-20 2018-06-01 北京理工华汇智能科技有限公司 机器人跟随导航的数据处理方法及其智能装置
CN108170166A (zh) * 2017-11-20 2018-06-15 北京理工华汇智能科技有限公司 机器人的跟随控制方法及其智能装置
CN108255173A (zh) * 2017-12-20 2018-07-06 北京理工大学 机器人跟随避障方法及装置
CN107992052B (zh) * 2017-12-27 2020-10-16 纳恩博(北京)科技有限公司 目标跟踪方法及装置、移动设备及存储介质
WO2019140686A1 (zh) * 2018-01-22 2019-07-25 深圳市大疆创新科技有限公司 跟随控制方法、控制终端及无人机
CN109164830A (zh) * 2018-08-03 2019-01-08 深圳市迅驰智能电子科技有限公司 一种平衡车自动跟随方法及平衡车
CN112703504A (zh) * 2018-10-19 2021-04-23 深圳新物种科技有限公司 对象识别方法、装置、电子设备及计算机可读存储介质
CN109633661A (zh) * 2018-11-28 2019-04-16 杭州凌像科技有限公司 一种基于rgb-d传感器与超声波传感器融合的玻璃检测系统和方法
CN109828558A (zh) * 2018-12-20 2019-05-31 钟胤舜 一种智能运动系统及方法
CN111446781B (zh) * 2019-01-17 2022-05-17 Oppo广东移动通信有限公司 无线充电方法、装置、存储介质及电子设备
CN112445209A (zh) * 2019-08-15 2021-03-05 纳恩博(北京)科技有限公司 机器人的控制方法和机器人、存储介质及电子装置
CN113359692B (zh) * 2020-02-20 2022-11-25 杭州萤石软件有限公司 一种障碍物的避让方法、可移动机器人

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101667037A (zh) * 2008-09-03 2010-03-10 中国科学院自动化研究所 一种基于可行通道的机器人目标追踪方法
WO2016026039A1 (en) * 2014-08-18 2016-02-25 Verity Studios Ag Invisible track for an interactive mobile robot system
CN105425803A (zh) * 2015-12-16 2016-03-23 纳恩博(北京)科技有限公司 自主避障方法、装置和系统
CN105467992A (zh) * 2015-11-20 2016-04-06 纳恩博(北京)科技有限公司 移动电子设备路径的确定方法和装置
CN106774301A (zh) * 2016-10-25 2017-05-31 纳恩博(北京)科技有限公司 一种避障跟随方法和电子设备

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP3994950B2 (ja) * 2003-09-19 2007-10-24 ソニー株式会社 環境認識装置及び方法、経路計画装置及び方法、並びにロボット装置
CN105629970A (zh) * 2014-11-03 2016-06-01 贵州亿丰升华科技机器人有限公司 一种基于超声波的机器人定位避障方法
CN105425795B (zh) * 2015-11-26 2020-04-14 纳恩博(北京)科技有限公司 规划最优跟随路径的方法及装置
CN105844631B (zh) * 2016-03-21 2018-11-20 湖南拓视觉信息技术有限公司 一种目标定位方法及装置
CN105872371B (zh) * 2016-03-31 2019-04-02 纳恩博(北京)科技有限公司 一种信息处理方法和电子设备
CN105892668B (zh) * 2016-04-01 2019-04-02 纳恩博(北京)科技有限公司 设备控制方法和装置

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101667037A (zh) * 2008-09-03 2010-03-10 中国科学院自动化研究所 一种基于可行通道的机器人目标追踪方法
WO2016026039A1 (en) * 2014-08-18 2016-02-25 Verity Studios Ag Invisible track for an interactive mobile robot system
CN105467992A (zh) * 2015-11-20 2016-04-06 纳恩博(北京)科技有限公司 移动电子设备路径的确定方法和装置
CN105425803A (zh) * 2015-12-16 2016-03-23 纳恩博(北京)科技有限公司 自主避障方法、装置和系统
CN106774301A (zh) * 2016-10-25 2017-05-31 纳恩博(北京)科技有限公司 一种避障跟随方法和电子设备

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110709792A (zh) * 2018-07-23 2020-01-17 深圳市大疆创新科技有限公司 移动平台的辅助移动方法、移动装置及移动平台
CN109079746A (zh) * 2018-11-02 2018-12-25 中国人民解放军陆军工程大学 一种四轮及六足可变形的实训机器人装置及控制方法
CN110955241A (zh) * 2019-11-22 2020-04-03 深圳市优必选科技股份有限公司 移动机器人避障方法、装置、移动机器人及存储介质
CN110955241B (zh) * 2019-11-22 2023-04-14 深圳市优必选科技股份有限公司 移动机器人避障方法、装置、移动机器人及存储介质
CN111982134A (zh) * 2020-08-10 2020-11-24 北京轩宇空间科技有限公司 适应未知动态空间的路径跟随控制方法、装置及存储介质
CN111982134B (zh) * 2020-08-10 2022-08-05 北京轩宇空间科技有限公司 适应未知动态空间的路径跟随控制方法、装置及存储介质
CN112613469A (zh) * 2020-12-30 2021-04-06 深圳市优必选科技股份有限公司 目标对象的运动控制方法及相关设备
CN112613469B (zh) * 2020-12-30 2023-12-19 深圳市优必选科技股份有限公司 目标对象的运动控制方法及相关设备

Also Published As

Publication number Publication date
CN106774301B (zh) 2020-04-24
CN106774301A (zh) 2017-05-31

Similar Documents

Publication Publication Date Title
WO2018077306A1 (zh) 一种避障跟随方法和电子设备、存储介质
Pandey et al. Automatic targetless extrinsic calibration of a 3d lidar and camera by maximizing mutual information
KR101539270B1 (ko) 충돌회피 및 자율주행을 위한 센서융합 기반 하이브리드 반응 경로 계획 방법, 이를 수행하기 위한 기록 매체 및 이동로봇
US10948907B2 (en) Self-driving mobile robots using human-robot interactions
US20220371602A1 (en) Vehicle positioning method, apparatus, and controller, intelligent vehicle, and system
US8787614B2 (en) System and method building a map
US8909375B2 (en) Nodding mechanism for a single-scan sensor
WO2018177159A1 (zh) 运动物体的位置确定方法及系统
US20180210442A1 (en) Systems and methods for controlling a vehicle using a mobile device
JP2018514879A (ja) フロア処理デバイス及びそのナビゲーション方法、並びに、一群のフロア処理デバイス及びそれらの全体的なナビゲーション方法
US20180141213A1 (en) Anti-collision system and anti-collision method
CN104184932A (zh) 球机控制方法及装置
JP2008076252A (ja) 自己位置認識システム
An et al. Development of mobile robot SLAM based on ROS
WO2016067640A1 (ja) 自律移動装置
CN113256716B (zh) 一种机器人的控制方法及机器人
CN103472434B (zh) 一种机器人声音定位方法
JP2024509690A (ja) 三次元地図を構築する方法および装置
CN109895100A (zh) 一种导航地图的生成方法、装置及机器人
WO2018068446A1 (zh) 一种追踪方法及追踪设备、计算机存储介质
Yang et al. Vision-based localization and mapping for an autonomous mower
Smith et al. PiPS: Planning in perception space
US20210156710A1 (en) Map processing method, device, and computer-readable storage medium
JP2020149186A (ja) 位置姿勢推定装置、学習装置、移動ロボット、位置姿勢推定方法、学習方法
US10979687B2 (en) Using super imposition to render a 3D depth map

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 17866174

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 17866174

Country of ref document: EP

Kind code of ref document: A1