CN110202571B - Method, device and equipment for setting sensor address and storage medium - Google Patents
Method, device and equipment for setting sensor address and storage medium Download PDFInfo
- Publication number
- CN110202571B CN110202571B CN201910396192.5A CN201910396192A CN110202571B CN 110202571 B CN110202571 B CN 110202571B CN 201910396192 A CN201910396192 A CN 201910396192A CN 110202571 B CN110202571 B CN 110202571B
- Authority
- CN
- China
- Prior art keywords
- sensor
- obstacle
- preset
- distance
- address
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
- 238000000034 method Methods 0.000 title claims abstract description 42
- 238000001514 detection method Methods 0.000 claims abstract description 109
- 238000013507 mapping Methods 0.000 claims description 8
- 238000010586 diagram Methods 0.000 description 16
- 230000006870 function Effects 0.000 description 8
- 238000012545 processing Methods 0.000 description 8
- 238000004590 computer program Methods 0.000 description 7
- 238000009434 installation Methods 0.000 description 3
- 238000012986 modification Methods 0.000 description 3
- 230000004048 modification Effects 0.000 description 3
- 238000005516 engineering process Methods 0.000 description 2
- 230000003287 optical effect Effects 0.000 description 2
- 230000005540 biological transmission Effects 0.000 description 1
- 230000001364 causal effect Effects 0.000 description 1
- 238000004891 communication Methods 0.000 description 1
- 238000013461 design Methods 0.000 description 1
- 238000011161 development Methods 0.000 description 1
- 230000001788 irregular Effects 0.000 description 1
- 238000004519 manufacturing process Methods 0.000 description 1
- 238000012544 monitoring process Methods 0.000 description 1
- 230000000644 propagated effect Effects 0.000 description 1
- 230000003068 static effect Effects 0.000 description 1
- 239000002699 waste material Substances 0.000 description 1
Images
Classifications
-
- B—PERFORMING OPERATIONS; TRANSPORTING
- B25—HAND TOOLS; PORTABLE POWER-DRIVEN TOOLS; MANIPULATORS
- B25J—MANIPULATORS; CHAMBERS PROVIDED WITH MANIPULATION DEVICES
- B25J9/00—Programme-controlled manipulators
- B25J9/16—Programme controls
- B25J9/1694—Programme controls characterised by use of sensors other than normal servo-feedback from position, speed or acceleration sensors, perception control, multi-sensor controlled systems, sensor fusion
-
- G—PHYSICS
- G01—MEASURING; TESTING
- G01S—RADIO DIRECTION-FINDING; RADIO NAVIGATION; DETERMINING DISTANCE OR VELOCITY BY USE OF RADIO WAVES; LOCATING OR PRESENCE-DETECTING BY USE OF THE REFLECTION OR RERADIATION OF RADIO WAVES; ANALOGOUS ARRANGEMENTS USING OTHER WAVES
- G01S15/00—Systems using the reflection or reradiation of acoustic waves, e.g. sonar systems
- G01S15/02—Systems using the reflection or reradiation of acoustic waves, e.g. sonar systems using reflection of acoustic waves
- G01S15/06—Systems determining the position data of a target
- G01S15/08—Systems for measuring distance only
-
- G—PHYSICS
- G01—MEASURING; TESTING
- G01S—RADIO DIRECTION-FINDING; RADIO NAVIGATION; DETERMINING DISTANCE OR VELOCITY BY USE OF RADIO WAVES; LOCATING OR PRESENCE-DETECTING BY USE OF THE REFLECTION OR RERADIATION OF RADIO WAVES; ANALOGOUS ARRANGEMENTS USING OTHER WAVES
- G01S17/00—Systems using the reflection or reradiation of electromagnetic waves other than radio waves, e.g. lidar systems
- G01S17/02—Systems using the reflection of electromagnetic waves other than radio waves
- G01S17/06—Systems determining position data of a target
- G01S17/08—Systems determining position data of a target for measuring distance only
Landscapes
- Engineering & Computer Science (AREA)
- Physics & Mathematics (AREA)
- Radar, Positioning & Navigation (AREA)
- Remote Sensing (AREA)
- Computer Networks & Wireless Communication (AREA)
- General Physics & Mathematics (AREA)
- Electromagnetism (AREA)
- Robotics (AREA)
- Mechanical Engineering (AREA)
- Acoustics & Sound (AREA)
- Manipulator (AREA)
Abstract
The invention discloses a method, a device, equipment and a storage medium for setting sensor addresses, which relate to the technical field of electronics and are used for uniformly setting the addresses of sensors arranged in the equipment and improving the setting efficiency of the sensor addresses, wherein the method comprises the following steps: controlling each sensor of at least one sensor arranged on the equipment to detect a reference distance between the sensor and a preset obstacle, wherein at least one obstacle is preset in an effective detection range of each sensor, and each sensor has a corresponding preset distance with the corresponding preset obstacle; respectively determining a preset distance which satisfies a preset condition with the difference value of the reference distance of each sensor from all the preset distances; and correspondingly setting the address of each sensor according to the position of the obstacle corresponding to the preset distance meeting the preset condition.
Description
Technical Field
The present invention relates to the field of electronic technologies, and in particular, to a method, an apparatus, a device, and a storage medium for setting a sensor address.
Background
With the development of science and technology, the application range of sensors is very wide, and there are situations where one or more sensors need to be installed at multiple locations in the same device (e.g. robot). At present, in order to facilitate installation, the same factory address is generally set for the sensors when the sensors are shipped, and therefore when the devices need to use the sensors to detect a certain preset direction of the devices, the addresses of the sensors are the same, the devices do not know which sensors of the multiple sensors are specifically controlled to detect, and only all the sensors can be turned on to detect, so that waste of electric energy and storage is caused. Therefore, a solution is needed to set an address specific to a sensor provided in a device in the device so that the device can directly control the sensor of a predetermined direction to be used for detection.
Disclosure of Invention
The embodiment of the application provides a method, a device, equipment and a storage medium for setting a sensor address, which are used for setting the address of a sensor arranged in the equipment, and the setting efficiency of the sensor address is improved.
In a first aspect, a method of setting a sensor address is provided, the method comprising:
controlling each sensor of at least one sensor arranged on the equipment to detect a reference distance between the sensor and a preset obstacle, wherein at least one obstacle is preset in an effective detection range of each sensor, and each sensor has a corresponding preset distance with the corresponding preset obstacle;
respectively determining a preset distance which satisfies a preset condition with the difference value of the reference distance of each sensor from all the preset distances;
and correspondingly setting the address of each sensor according to the position of the obstacle corresponding to the preset distance meeting the preset condition.
Optionally, when the number of the at least one sensor is greater than or equal to 2 and greater than the number of the obstacles, an overlapping detection area exists in effective detection ranges of at least two sensors, and for two effective detection ranges corresponding to the at least two sensors, only one obstacle is disposed at the overlapping detection area.
Optionally, when the number of the at least one sensor is equal to the number of the obstacles, the effective detection range of each sensor of the at least one sensor does not have an overlapping detection area, and one obstacle is correspondingly disposed in the effective detection range of each sensor.
Optionally, when the number of the at least one sensor is greater than 1, the predetermined distance set between each sensor and the obstacle in the corresponding effective detection range is different.
Optionally, correspondingly setting an address of each sensor according to the position of the obstacle corresponding to the predetermined distance meeting the preset condition, respectively, includes:
determining the position of the obstacle corresponding to the preset distance meeting the preset condition of each sensor according to the mapping relation between the preset distance and the position of the obstacle;
and correspondingly setting the address of each sensor according to the determined position of the obstacle.
Optionally, after the address of each sensor is correspondingly set according to the position of the obstacle corresponding to the predetermined distance meeting the preset condition, the method further includes:
receiving a detection instruction for detecting whether an obstacle exists in a preset direction;
determining the address of the sensor corresponding to the preset direction according to the detection instruction;
and controlling the sensor corresponding to the preset direction to detect according to the determined address of the sensor.
Optionally, the preset condition includes any one of the following three conditions:
determining a predetermined distance identical to the reference distance of each sensor from all the predetermined distances, respectively; or
Determining a predetermined distance having a minimum difference from the reference distance of each sensor, respectively, from all the predetermined distances; or
Determining a predetermined distance from all the predetermined distances, respectively, in which the difference from the reference distance of each sensor is smaller than a threshold value.
In a second aspect, an embodiment of the present application provides an apparatus for setting a sensor address, where the apparatus for setting a sensor address includes:
the detection unit is used for controlling each sensor of at least one sensor arranged on the equipment to detect a reference distance between the sensor and a preset obstacle, wherein at least one obstacle is preset in an effective detection range of each sensor, and a corresponding preset distance is reserved between each sensor and the corresponding preset obstacle;
a determining unit, configured to determine, from all the predetermined distances, a predetermined distance in which a difference from the reference distance of each sensor satisfies a preset condition, respectively;
and the setting unit is used for correspondingly setting the address of each sensor according to the position of the obstacle corresponding to the preset distance meeting the preset condition.
Optionally, when the number of the at least one sensor is greater than or equal to 2 and greater than the number of the obstacles, an overlapping detection area exists in effective detection ranges of at least two sensors, and for two effective detection ranges corresponding to the at least two sensors, only one obstacle is disposed at the overlapping detection area.
Optionally, when the number of the at least one sensor is equal to the number of the obstacles, the effective detection range of each sensor of the at least one sensor does not have an overlapping detection area, and one obstacle is correspondingly disposed in the effective detection range of each sensor.
Optionally, when the number of the at least one sensor is greater than 1, the predetermined distance set between each sensor and the obstacle in the corresponding effective detection range is different.
Optionally, the setting unit is further configured to:
determining the position of the obstacle corresponding to the preset distance meeting the preset condition of each sensor according to the mapping relation between the preset distance and the position of the obstacle;
and correspondingly setting the address of each sensor according to the determined position of the obstacle.
Optionally, the apparatus for setting a sensor address further includes a control unit, and the control unit is configured to:
receiving a detection instruction for detecting whether an obstacle exists in a preset direction;
determining the address of the sensor corresponding to the preset direction according to the detection instruction;
and controlling the sensor corresponding to the preset direction to detect according to the determined address of the sensor.
Optionally, the preset condition includes any one of the following three conditions:
determining a predetermined distance identical to the reference distance of each sensor from all the predetermined distances, respectively; or
Determining a predetermined distance having a minimum difference from the reference distance of each sensor, respectively, from all the predetermined distances; or
Determining a predetermined distance from all the predetermined distances, respectively, in which the difference from the reference distance of each sensor is smaller than a threshold value.
In a third aspect, an apparatus for setting a sensor address is provided, and the apparatus for setting a sensor address includes:
a memory for storing program instructions;
a processor for calling the program instructions stored in the memory and executing the steps included in any of the methods of the first aspect according to the obtained program instructions.
In a fourth aspect, there is provided a storage medium storing computer-executable instructions for causing a computer to perform the steps included in any of the methods of the first aspect.
In the embodiment of the application, at least one sensor is arranged on the same device, in the effective detection range of each sensor in the at least one sensor, an obstacle corresponding to each sensor can be arranged according to a preset distance in advance, the preset distance corresponding to each sensor is determined by comparing all the preset distances and detecting the reference distance between each sensor and the obstacle in the corresponding effective range, and then the address of the sensor corresponding to the obstacle is arranged according to the known position of the obstacle corresponding to the preset distance. Because the corresponding relation between the preset distance and the position of the obstacle is preset, after the preset distance corresponding to each sensor is determined, the position of the obstacle corresponding to each sensor can be determined quickly and accurately, and the address of the sensor can be set according to the position of the obstacle corresponding to each sensor, for example, the address of the sensor corresponding to the preset distance corresponding to the obstacle on the left side of the equipment can be set as a left sensor, and then the left sensor can be used for carrying out related detection on the left range of the equipment subsequently The parallel setting mode can also improve the setting efficiency of the sensor address.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings used in the description of the embodiments will be briefly introduced, and it is obvious that the drawings in the following description are only some embodiments of the present invention.
Fig. 1a is a schematic diagram of an application scenario provided in an embodiment of the present application;
FIG. 1b is a schematic diagram of an equivalent arrangement of sensors and obstacles according to an embodiment of the present disclosure;
FIG. 1c is a schematic diagram of another sensor and obstacle equivalent arrangement provided in an embodiment of the present application;
FIG. 1d is a schematic diagram of a number of sensors greater than a number of obstacles according to an embodiment of the present disclosure;
fig. 1e is a schematic diagram of a sensor corresponding to two obstacles according to an embodiment of the present application;
fig. 1f is a schematic diagram of two obstacles disposed in an overlapping area of effective detection ranges of two sensors according to an embodiment of the present disclosure;
FIG. 2 is a flow chart of a method for setting sensor addresses according to an embodiment of the present disclosure;
FIG. 3 is a schematic diagram of an apparatus for setting sensor addresses according to an embodiment of the present disclosure;
fig. 4 is a schematic diagram of an apparatus for setting sensor addresses according to an embodiment of the present disclosure.
Detailed Description
In order to make the objects, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are some embodiments, but not all embodiments, of the technical solutions of the present invention. All other embodiments obtained by a person skilled in the art without any inventive work based on the embodiments described in the present application are within the scope of the protection of the technical solution of the present invention.
In the embodiments of the present application, "a plurality" may mean at least two, for example, two, three, or more, and the embodiments of the present application are not limited.
For ease of understanding, the technical background of the embodiments of the present invention will be described below.
As described above, in the prior art, since the device itself does not know where each sensor is located, and thus when it is necessary to detect whether there is an obstacle in a certain direction, it is not known which sensor or sensors should be controlled to perform related detection, and therefore, it is necessary to set addresses of the sensors in the device, so that the device itself can determine where a plurality of sensors in the device are located, and further control the related sensors to perform detection according to actual detection requirements.
In view of this, the inventors of the present application provide a technical solution for setting sensor addresses, in which at least one obstacle is preset at predetermined distances for each effective detection range of a sensor of an apparatus for which an address needs to be set, and the predetermined distances corresponding to a plurality of sensors are different from each other, that is, the apparatus is provided with a number of sensors greater than or equal to the number of the predetermined distances corresponding to the setting. Therefore, the device can control all the sensors arranged on the device to detect the reference distance between the obstacles corresponding to the device, determine the preset distance matched with the reference distance from all the preset distances, namely the preset distance corresponding to each sensor, further determine the position of the obstacle corresponding to each sensor according to the known corresponding relation between the preset distance and the position of the obstacle, and further set the address of the sensor corresponding to the obstacle according to the position of the obstacle. Therefore, the address of at least one sensor can be uniformly set, and the efficiency of setting the address of the sensor is improved. Furthermore, after the specific position of each sensor in the equipment is determined, when the equipment needs to control the sensor in the preset direction to detect, the sensor in the preset direction can be controlled to detect according to the address of the sensor in the set preset direction, so that the situation that all the sensors are started to detect during each detection is avoided, and the electric energy and the storage space are saved.
After introducing the design concept of the embodiment of the present application, some simple descriptions are provided below for application scenarios to which the technical solution of the embodiment of the present application can be applied, and it should be noted that the application scenarios described below are only used for describing the embodiment of the present application and are not limited. In specific implementation, the technical scheme provided by the embodiment of the application can be flexibly applied according to actual needs.
Referring to fig. 1a, the application scenario shown in fig. 1a includes a device and a control box 11, where the device may be a robot, an automobile, or other devices that require a sensor to be installed and used, and for convenience of description, the device is specifically illustrated as the robot 10 in fig. 1 a. The robot 10 is provided with a central control center, the central control center can control the sensors arranged in the robot 10 to be turned on or off, that is, the sensors can be controlled to perform detection or stop detection, the robot 10 is provided with at least one sensor (such as a black dot in fig. 1 a), that is, one, two or more sensors can be arranged, and the specific arrangement number is determined according to actual situations. Specifically, the sensor provided on the robot 10 may be an ultrasonic sensor, an infrared sensor, or the like that can transmit a detection signal and receive a feedback signal, and is not particularly limited herein.
The control box 11 is provided with an obstacle for setting an address of a sensor in the robot 10, the control box 11 may be a closed space as shown in fig. 1a, the obstacle is arranged on a side wall of the closed space, that is, the address is set for the sensor in the robot 10 in the closed space, and since the address of the sensor is arranged in the closed space, the environment atmosphere in the closed space, such as temperature, humidity and the like, can be adjusted as required, so that the interference of external interference factors to signals sent by the sensor can be reduced, so that the sensor can be better controlled to detect the distance between the sensor and the obstacle, unnecessary interference is avoided, and the accuracy of the set address of the sensor can be further improved. Of course, the obstacle may not be disposed in the closed space, for example, the obstacle may be directly disposed in the effective detection range of the sensor according to a predetermined distance in an open space, and the requirement for the environment for disposing the obstacle is low, so that the flexibility of the sensor address setting can be improved.
In the embodiment of the present invention, the set obstacle may be a plate, a circular or rectangular object, and the like, and it should be noted herein that the set obstacle may be determined according to the type of the set sensor, that is, the set obstacle is matched with the detection principle of the sensor, for example, infrared rays emitted by the infrared sensor are propagated along a straight line, so when the obstacle is set, it should be ensured that infrared rays reflected back after encountering the set obstacle can be received by the infrared sensor.
For convenience of description in this application, the sensor is an ultrasonic sensor, and the obstacle is a rectangular object and is disposed in the control box 11.
In the embodiment of the present application, the obstacles provided in the control box 11 are set according to a known predetermined distance, the predetermined distance may be the distance between the sensor set by the user and the obstacle within the corresponding effective detection range, and when the number of the sensors provided in the device is greater than 1, the predetermined distance between each sensor and the obstacle preset within the effective detection range is different from each other. Since the detection signal emitted by the sensor is inevitably affected by the external environment during the actual detection process, so that the distance between the actually detected sensor and the obstacle within the corresponding effective detection range may not be the same as the preset predetermined distance, the distance between each sensor in the robot 10 and the obstacle corresponding to the sensor may be referred to as a reference distance. Further, when the obstacle is irregular, the sensor may receive a plurality of reflected feedback signals, and therefore, when the sensor receives a plurality of feedback signals, the reference distance between the obstacle and the sensor may be a distance calculated according to the feedback signal received by the sensor first, that is, a closest distance between the sensor and the obstacle.
Specifically, referring to fig. 1b, the total number of sensors provided on the robot 10 may be the same as the total number of obstacles provided in the control box 11. At this time, one obstacle may be provided for each sensor in a one-to-one correspondence within the effective detection range of each sensor. In this case, the effective detection range of the sensor may or may not have an overlapping detection region. When the effective detection range of the sensor has an overlapping detection area, please refer to fig. 1c, the obstacles arranged in one-to-one correspondence with the sensors are arranged in the effective detection range outside the overlapping detection area of the sensor.
Referring to fig. 1d, the total number of sensors provided on the robot 10 may be greater than the total number of obstacles provided in the control box 11. When the robot 10 is provided with at least two or more sensors and the effective detection ranges of the two or more sensors have an overlapping detection area, a common obstacle can be set in the overlapping area without setting a corresponding obstacle for each sensor, so that the number of the obstacles to be set can be reduced, the setting process of the obstacles can be simplified, and the setting time of the obstacles can be reduced.
In the embodiment of the present application, two or more obstacles may also be disposed in the effective detection range of each sensor, please refer to fig. 1e, taking the example that two obstacles are disposed in the effective detection range of each sensor disposed on the robot 10, and the predetermined distance between each sensor and the two obstacles in the corresponding effective detection range may be the same or different. Further, two or more obstacles may be disposed in the overlapping area of the effective detection ranges of two or more sensors, as shown in fig. 1f, for example, two obstacles are disposed in the overlapping area of the effective detection ranges of two sensors, and the predetermined distance between each obstacle and the sensor may be the same or different. Of course, in a specific implementation, at least two obstacles may be correspondingly disposed on a part of the sensors, and one obstacle may be correspondingly disposed on another part of the sensors, which is not limited herein.
It should be noted that the installation positions of the obstacle and the sensor in fig. 1b to 1f are only for convenience of description of the embodiments of the present application, and do not limit the present application to only these installation modes.
To further illustrate the solution for setting the sensor address provided in the embodiments of the present application, the following detailed description is made with reference to the accompanying drawings and the detailed description. Although the embodiments of the present application provide the method operation steps as shown in the following embodiments or figures, more or less operation steps may be included in the method based on the conventional or non-inventive labor. In steps where no necessary causal relationship exists logically, the order of execution of the steps is not limited to that provided by the embodiments of the present application. The method can be executed in sequence or in parallel according to the method shown in the embodiment or the figures when the method is executed in an actual processing procedure or a device (for example, a parallel processor or an application environment of multi-thread processing).
Referring to fig. 2, a flow of a method for setting a sensor address in an embodiment of the present application is described as follows.
Step 201: and controlling each sensor of at least one sensor arranged on the equipment to detect a reference distance between the sensor and a preset obstacle, wherein at least one obstacle is preset in an effective detection range of each sensor, and each sensor has a corresponding preset distance with the corresponding preset obstacle.
For convenience of description in the embodiments of the present application, the following description will be specifically made by taking the apparatus for providing the sensor as the robot 10 in the foregoing application scenario.
In the embodiment of the present application, as will be understood in conjunction with the foregoing application scenarios of fig. 1a to 1d, the robot 10 is provided with at least one sensor, and the robot can be placed in the control box 11 dedicated to setting the sensor as shown in fig. 1a to set the address of each sensor. Therefore, after the robot 10 is placed in the control box 11, the center control center of the robot 10 may control each of the at least one sensor to detect a reference distance between each sensor and a preset obstacle in the control box 11, the reference distance being a distance between the sensor and the preset obstacle detected by the sensor controlled by the robot 10, that is, a distance between a position where the robot 10 sets the sensor and the preset obstacle.
In this application embodiment, the central control center of the robot may control each sensor that is provided therein to emit a detection signal, and after each sensor emits the detection signal, obtain a feedback signal that each sensor receives, where the feedback signal may be a signal that the detection signal emitted by the sensor is blocked by an obstacle and bounces back after encountering a preset obstacle corresponding to the sensor, or may be a feedback signal that the obstacle receives the detection signal emitted by the sensor and then feeds back to the sensor according to the detection signal when the obstacle has a function of transmitting and receiving signals, and this is not particularly limited in this application embodiment.
In the embodiment of the present application, after each sensor receives the feedback signal, the reference distance between each sensor and the obstacle in the corresponding effective range may be calculated according to the time when each sensor transmits the detection signal and the time when each sensor receives the feedback signal. For example, if the sensor is an ultrasonic sensor, the time of the sensor transmitting the detection signal is t1, and the time of receiving the feedback signal is t2, the reference distance between the sensor and the obstacle in the effective detection range is v (t2-t1)/2, where v is the propagation speed of the sound wave in the transmission medium.
Step 202: from all the predetermined distances, a predetermined distance is determined, respectively, for which a difference from the reference distance of each sensor satisfies a preset condition.
In the embodiment of the present application, after obtaining the reference distance between each sensor and the obstacle preset in the effective detection range thereof, the reference distance corresponding to each sensor may be compared with all the predetermined distances stored in the robot 10, so as to determine the predetermined distance satisfying the preset condition, and the determined predetermined distance may be used as the predetermined distance between the sensor and the obstacle in the effective detection range thereof.
The preset condition can be any one of the following three conditions:
firstly, respectively determining the preset distance which is the same as the reference distance of each sensor from all the preset distances, namely, the reference distance detected by the sensors is the same as the set preset distance, at this time, the determined reference distance between the sensors and the obstacles in the corresponding effective detection range is the most accurate, and finally, the preset distance determined according to the reference distance is the most accurate.
Second, a predetermined distance having the smallest difference from the reference distance of each sensor is determined from all the predetermined distances, respectively. For example, assuming that the reference distance detected by the sensor a is 1.8m, and the preset predetermined distances include 1.5m, 2m, and 2.5m, the differences between the reference distance and the three predetermined distances are 0.3m, 0.2m, and 0.7m, respectively, wherein the predetermined distance corresponding to the minimum difference of 0.2m between the reference distances is 2m, so that 2m can be determined as the predetermined distance corresponding to the sensor a.
Third, a predetermined distance whose difference from the reference distance of each sensor is smaller than a threshold value is determined separately from all the predetermined distances. For example, assuming that the threshold is 0.2m and the reference distance detected by the sensor B is 1.4m, the preset predetermined distances include: 0.5m, 1m, and 1.5m, it can be known that the difference between the reference distance and the predetermined distance is 0.9m, 0.4m, and 0.1m, respectively, wherein when the predetermined distance is 1.5m, the value of the reference distance is less than 0.2m, so that 1.5m can be determined as the predetermined distance corresponding to the sensor B.
Step 203: and correspondingly setting the address of each sensor according to the position of the obstacle corresponding to the preset distance meeting the preset condition.
In the embodiment of the present application, after the predetermined distance meeting the preset condition is determined, that is, after the predetermined distance corresponding to the sensor is determined, the address of the sensor may be set according to the obstacle corresponding to the predetermined distance. The address of the sensor is also referred to as a sensor address, and the sensor address may be used to represent a specific position (orientation) where the sensor is disposed on the robot body, such as front, back, left, and right, so that the robot may control the sensor disposed in a certain orientation to perform related detection on the corresponding direction, that is, the sensor address may refer to a set position of the sensor relative to the device, and through the set position, the device may determine a detection direction or a detection range of the sensor, so that the corresponding sensor may be controlled to perform related detection according to an actual detection requirement.
In the embodiment of the present application, in order to implement unified setting of addresses of the sensors, a mapping relationship between a predetermined distance and a position of an obstacle may be preset, and after the predetermined distance corresponding to each sensor is determined, a position of the obstacle corresponding to the predetermined distance satisfying a preset condition of each sensor is determined according to the mapping relationship between the predetermined distance and the position of the obstacle, and then the address of each sensor is set according to the determined position of the obstacle corresponding to each sensor. Here, since each predetermined distance corresponds to the position of at least one fixed obstacle, after the predetermined distance of each sensor is determined, the robot 10 can determine the position of the obstacle to set the address of the sensor corresponding to the obstacle according to the mapping relationship between the preset distance and the position of the obstacle, quickly and accurately, thereby improving the efficiency of setting the address of the sensor.
Specifically, please refer to fig. 1b and fig. 1c continuously, as shown in fig. 1b and fig. 1c, when the number of obstacles corresponding to the effective detection range of each sensor arranged on the robot 10 is one, because each sensor only corresponds to one obstacle, when the robot 10 controls each sensor arranged on the robot to detect the reference distance between the obstacles corresponding to the sensor, only one reference distance is detected, thereby avoiding the situation that one sensor detects a plurality of reference distances, further improving the speed of detecting the reference distance, and then only one predetermined distance corresponding to the reference distance is provided, so that the accuracy of setting the sensor address can also be improved.
Referring to fig. 1e, in the embodiment of the present application, as shown in fig. 1e, when two obstacles are disposed in the effective detection range of each sensor disposed on the robot 10, the position identifiers of the two obstacles may be the same, for example, both the two obstacles are on the left side, and then the device has only one address of the sensor according to the positions of the two obstacles; certainly, the position identifiers of the two obstacles may also be different, for example, the left side 1 and the left side 2, and then the device may have two addresses of the sensor according to the positions of the two obstacles, that is, the sensor has two addresses corresponding to the two addresses, and the sensor can be controlled by the two addresses, so that even if one address has a fault, the sensor can be controlled by the other address to detect, and the problem that the corresponding sensor cannot be controlled to detect due to an address recording error is avoided.
Furthermore, when the address of the sensor corresponding to the obstacle is set according to the position of the obstacle, the position of the obstacle can be the same as the address of the sensor corresponding to the obstacle, namely, the determined position of the obstacle is directly given to the sensor corresponding to the obstacle; alternatively, the position of the obstacle may be symmetrical to the address of the corresponding sensor, that is, a position opposite to the position is determined according to the position of the obstacle, and the opposite position is used as the address of the sensor. Of course, the address of the sensor corresponding to the obstacle may also be set according to other corresponding relationships between the position of the obstacle and the address of the sensor, which is not specifically limited in the embodiment of the present application.
For example, assuming that when the predetermined distance is 1.5m, the position of the obstacle mapped thereto is left 1, then as in the foregoing example, after the predetermined distance of the sensor B is determined to be 1.5m, the position of the obstacle corresponding to the sensor B may be determined to be left 1 according to the preset mapping relationship between the predetermined distance and the position of the obstacle, and further, when the position of the obstacle is the same as the position of the sensor, the address of the sensor B is set to be left 1; when the position of the obstacle is symmetrical to the position of the sensor, the address of the sensor B is set to the right side 1.
As an optional implementation manner, in this embodiment of the application, after the execution of step 203 is completed, each sensor arranged in the robot 10 obtains a corresponding address, so that, after the robot 10 receives a detection instruction for detecting whether an obstacle exists in a predetermined direction, one or more sensors having addresses identical to the predetermined direction may be determined from all the arranged sensors according to information of the predetermined direction carried in the detection instruction, and then the robot 10 may accurately control the one or more sensors corresponding to the addresses to perform obstacle detection according to the determined addresses of the one or more sensors, so as to avoid turning on all the arranged sensors to perform detection, so that power and storage space may be saved.
As an alternative implementation manner, in the embodiment of the present application, when at least two sensors are disposed in the robot 10, addresses may be set for all the sensors disposed in the robot 10, or addresses may be set for some of the sensors disposed in the robot 10, which is not specifically limited herein.
Therefore, by the above method, in the embodiment of the present application, the predetermined distance corresponding to each sensor is determined by comparing all the predetermined distances and detecting the reference distance between each sensor and the obstacle in the corresponding effective range, and the address of the sensor corresponding to the obstacle is set according to the known position of the obstacle corresponding to the predetermined distance. Because the corresponding relation between the preset distance and the position of the obstacle is preset, after the preset distance corresponding to each sensor is determined, the position of the obstacle corresponding to each sensor can be determined quickly, and then the address of the sensor can be set according to the position of the obstacle corresponding to each sensor, so that the addresses of the sensors arranged in the equipment can be set uniformly, and the setting efficiency of the sensor address is improved.
Furthermore, after the address of at least one sensor is set, the sensor in the preset direction can be controlled according to the address of the sensor to detect the obstacle in the preset direction, so that the sensor which is not needed to be started is avoided, the resource is saved, and the detection efficiency is improved.
Based on the same inventive concept, the embodiment of the present application provides a device for setting a sensor address, where the device for setting a sensor address may be a hardware structure, a software module, or a hardware structure plus a software module. The device for setting the sensor address can be realized by a chip system, and the chip system can be formed by a chip and can also comprise the chip and other discrete devices. As shown in fig. 3, the apparatus for setting a sensor address includes: a detection unit 301, a determination unit 302, a setting unit 303. Wherein:
a detection unit 301 for controlling each of at least one sensor provided on the device to detect a reference distance from a preset obstacle, wherein at least one obstacle is preset in an effective detection range of each sensor, and each sensor has a corresponding predetermined distance from the corresponding obstacle;
a determining unit 302, configured to determine, from all predetermined distances, a predetermined distance whose difference from the reference distance of each sensor satisfies a predetermined condition, respectively;
the setting unit 303 is configured to set an address of each sensor correspondingly according to a position of an obstacle corresponding to a predetermined distance that meets a preset condition.
In an alternative embodiment, when the number of the at least one sensor is greater than or equal to 2 and greater than the number of the obstacles, the effective detection ranges of the at least two sensors have an overlapping detection area, and for the two effective detection ranges corresponding to the at least two sensors, only one obstacle is disposed at the overlapping detection area.
In an alternative embodiment, when the number of the at least one sensor is equal to the number of the obstacles, the effective detection range of each sensor of the at least one sensor does not have an overlapping detection area, and one obstacle is correspondingly arranged in the effective detection range of each sensor.
In an alternative embodiment, when the number of at least one sensor is greater than 1, the predetermined distance set between each sensor and the obstacle in the corresponding effective detection range is different.
In an optional implementation manner, the setting unit is further configured to determine, according to a mapping relationship between the predetermined distance and the position of the obstacle, a position of the obstacle corresponding to the predetermined distance satisfying the preset condition of each sensor; and correspondingly setting the address of each sensor according to the determined position of the obstacle.
In an alternative embodiment, the apparatus for setting sensor addresses as shown in fig. 3 further includes a control unit 304, where the control unit 304 is configured to receive a detection instruction for detecting whether an obstacle exists in a predetermined direction; determining the address of a sensor corresponding to the preset direction according to the detection instruction; and controlling the sensor corresponding to the preset direction to detect according to the determined address of the sensor.
In an alternative embodiment, the preset condition includes any one of the following three conditions:
respectively determining a predetermined distance which is the same as the reference distance of each sensor from all the predetermined distances; or
Respectively determining a predetermined distance with the minimum difference value from the reference distance of each sensor from all the predetermined distances; or
The predetermined distance whose difference from the reference distance of each sensor is smaller than the threshold value is determined separately from all the predetermined distances.
All relevant contents of each step related to the foregoing embodiment of the method for setting a sensor address may be referred to the functional description of the functional module corresponding to the apparatus for setting a sensor address in the embodiment of the present invention, and are not described herein again.
The division of the modules in the embodiments of the present application is schematic, and only one logical function division is provided, and in actual implementation, there may be another division manner, and in addition, each functional module in each embodiment of the present invention may be integrated in one processor, or may exist alone physically, or two or more modules are integrated in one module. The integrated module can be realized in a hardware mode, and can also be realized in a software functional module mode.
Based on the same inventive concept, the present application further provides a device for setting a sensor address, which may be the aforementioned device that needs to set a sensor, such as a robot, and may also be the device for setting a sensor address shown in fig. 4, where the device for setting a sensor address includes at least one processor 401, and a memory 402 and at least one sensor 403 connected to the at least one processor, and a specific connection medium among the processor 401, the memory 402, and the sensor 403 is not limited in the present application embodiment, and fig. 4 illustrates an example where the processor 401, the memory 402, and the sensor 403 are connected through a bus 400, and the bus 400 is represented by a thick line in fig. 4, and a connection manner among other components is only schematically illustrated and is not limited. The bus 400 may be divided into an address bus, a data bus, a control bus, etc., and is shown with only one thick line in fig. 4 for ease of illustration, but does not represent only one bus or type of bus.
In the embodiment of the present application, the memory 402 stores instructions executable by the at least one processor 401, and the at least one processor 401 may execute the steps included in the method for setting the address of the sensor by executing the instructions stored in the memory 402.
The processor 401 is a control center of the device for setting the sensor address, and may connect various parts of the entire device for setting the sensor address by using various interfaces and lines, and perform various functions and process data of the device for setting the sensor address by operating or executing instructions stored in the memory 402 and calling data stored in the memory 402, thereby performing overall monitoring on the device for setting the sensor address. Optionally, the processor 401 may include one or more processing units, and the processor 401 may integrate an application processor and a modem processor, wherein the application processor mainly handles an operating system, a user interface, an application program, and the like, and the modem processor mainly handles wireless communication. It will be appreciated that the modem processor described above may not be integrated into the processor 401. In some embodiments, processor 401 and memory 402 may be implemented on the same chip, or in some embodiments, they may be implemented separately on separate chips.
The processor 401 may be a general-purpose processor, such as a Central Processing Unit (CPU), digital signal processor, application specific integrated circuit, field programmable gate array or other programmable logic device, discrete gate or transistor logic, discrete hardware components, or the like, that may implement or perform the methods, steps, and logic blocks disclosed in embodiments of the present application. A general purpose processor may be a microprocessor or any conventional processor or the like. The steps of the method for setting the sensor address disclosed in the embodiments of the present application may be directly implemented by a hardware processor, or implemented by a combination of hardware and software modules in the processor.
By programming the processor 401, the code corresponding to the method for setting the sensor address described in the foregoing embodiment may be solidified in the chip, so that the chip can execute the steps of the method for setting the sensor address when running.
Based on the same inventive concept, embodiments of the present application provide a storage medium storing computer instructions, which, when executed on a computer, cause the computer to perform the method for setting the sensor address as described above.
As will be appreciated by one skilled in the art, embodiments of the present invention may 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 an embodiment combining software and hardware aspects. Furthermore, the present invention may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, optical storage, and the like) having computer-usable program code embodied therein.
The present invention is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the application. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
It will be apparent to those skilled in the art that various changes and modifications may be made in the present invention without departing from the spirit and scope of the invention. Thus, if such modifications and variations of the present invention fall within the scope of the claims of the present invention and their equivalents, the present invention is also intended to include such modifications and variations.
Claims (9)
1. A method of setting sensor addresses, comprising:
controlling each sensor of at least one sensor arranged on the equipment to detect a reference distance between the sensor and a preset obstacle, wherein at least one obstacle is preset in an effective detection range of each sensor, a corresponding preset distance is reserved between each sensor and the corresponding obstacle, and the preset distances reserved between each sensor and the corresponding obstacle in the effective detection range are different;
respectively determining a preset distance which satisfies a preset condition with the difference value of the reference distance of each sensor from all the preset distances;
and correspondingly setting the address of each sensor according to the position of the obstacle corresponding to the preset distance meeting the preset condition.
2. The method of claim 1, wherein when the number of the at least one sensor is greater than or equal to 2 and greater than the number of obstacles, there is an overlapping detection area for the effective detection ranges of at least two sensors, and only one obstacle is disposed at the overlapping detection area for the two effective detection ranges corresponding to the at least two sensors.
3. The method of claim 1, wherein when the number of the at least one sensor is equal to the number of obstacles, the effective detection range of each sensor of the at least one sensor does not have an overlapping detection area, and one obstacle is correspondingly disposed in the effective detection range of each sensor.
4. The method of claim 1, wherein correspondingly setting the address of each sensor according to the position of the obstacle corresponding to the predetermined distance satisfying the preset condition respectively comprises:
determining the position of the obstacle corresponding to the preset distance meeting the preset condition of each sensor according to the mapping relation between the preset distance and the position of the obstacle;
and correspondingly setting the address of each sensor according to the determined position of the obstacle.
5. The method according to any one of claims 1 to 3, wherein after the address of each sensor is correspondingly set according to the position of the obstacle corresponding to the predetermined distance satisfying the preset condition, respectively, the method further comprises:
receiving a detection instruction for detecting whether an obstacle exists in a preset direction;
determining the address of the sensor corresponding to the preset direction according to the detection instruction;
and controlling the sensor corresponding to the preset direction to detect according to the determined address of the sensor.
6. A method according to any one of claims 1 to 3, wherein the predetermined condition comprises any one of the following three conditions:
determining a predetermined distance identical to the reference distance of each sensor from all the predetermined distances, respectively; or
Determining a predetermined distance having a minimum difference from the reference distance of each sensor, respectively, from all the predetermined distances; or
Determining a predetermined distance from all the predetermined distances, respectively, in which the difference from the reference distance of each sensor is smaller than a threshold value.
7. An apparatus for setting sensor addresses, comprising:
the device comprises a detection unit, a control unit and a control unit, wherein the detection unit is used for controlling each sensor of at least one sensor arranged on the device and detecting a reference distance between the sensor and a preset obstacle, at least one obstacle is preset in an effective detection range of each sensor, a corresponding preset distance is reserved between each sensor and the corresponding obstacle, and the preset distances reserved between each sensor and the corresponding obstacle in the effective detection range are different;
a determining unit, configured to determine, from all the predetermined distances, a predetermined distance in which a difference from the reference distance of each sensor satisfies a preset condition, respectively;
and the setting unit is used for correspondingly setting the address of each sensor according to the position of the obstacle corresponding to the preset distance meeting the preset condition.
8. An apparatus for setting a sensor address, the apparatus comprising:
a memory for storing program instructions;
a processor for calling program instructions stored in said memory and for executing the steps comprised in the method of any one of claims 1 to 6 in accordance with the obtained program instructions.
9. A storage medium storing computer-executable instructions for causing a computer to perform the steps comprising the method of any one of claims 1-6.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910396192.5A CN110202571B (en) | 2019-05-14 | 2019-05-14 | Method, device and equipment for setting sensor address and storage medium |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201910396192.5A CN110202571B (en) | 2019-05-14 | 2019-05-14 | Method, device and equipment for setting sensor address and storage medium |
Publications (2)
Publication Number | Publication Date |
---|---|
CN110202571A CN110202571A (en) | 2019-09-06 |
CN110202571B true CN110202571B (en) | 2021-02-26 |
Family
ID=67785799
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201910396192.5A Active CN110202571B (en) | 2019-05-14 | 2019-05-14 | Method, device and equipment for setting sensor address and storage medium |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN110202571B (en) |
Family Cites Families (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
DE102006050303A1 (en) * | 2005-12-05 | 2007-06-14 | Cedes Ag | Sensor arrangement and sensor device for a sensor arrangement |
CN105556938A (en) * | 2013-09-17 | 2016-05-04 | 株式会社村田制作所 | System for assisting specification of sensor installation position, and method for assisting specification of sensor installation position |
KR101787872B1 (en) * | 2016-02-11 | 2017-10-19 | 한국기술교육대학교 산학협력단 | Flying car |
CN106060822B (en) * | 2016-08-18 | 2019-09-17 | 中国联合网络通信集团有限公司 | Access the method, enhancing equipment and sensor network of sensor node |
JP7024285B2 (en) * | 2017-09-26 | 2022-02-24 | オムロン株式会社 | Displacement measuring device, system, and displacement measuring method |
-
2019
- 2019-05-14 CN CN201910396192.5A patent/CN110202571B/en active Active
Also Published As
Publication number | Publication date |
---|---|
CN110202571A (en) | 2019-09-06 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
KR102459737B1 (en) | How to upgrade autonomous driving system, autonomous driving system and on-vehicle device | |
KR102459736B1 (en) | How to upgrade autonomous driving system, autonomous driving system and on-vehicle device | |
US20230017336A1 (en) | Information obtaining method and apparatus | |
CN112946623B (en) | Speed measuring method and device based on 77G millimeter wave radar installed on vehicle | |
US20230261781A1 (en) | Communication method and related device | |
US4187487A (en) | Moving object detection system | |
CN112835045A (en) | Radar detection method and device, storage medium and electronic equipment | |
CN110202571B (en) | Method, device and equipment for setting sensor address and storage medium | |
CN111123287A (en) | Robot positioning method, robot, and computer-readable storage medium | |
CN112689842B (en) | Target detection method and device | |
KR102253274B1 (en) | Fusion signal processing apparatus | |
US20170343981A1 (en) | Method, device for machine processing trajectory space detection and numerical control machine | |
KR100836297B1 (en) | Car error monitoring system using a dual processor | |
CN109799492B (en) | Method and device for adjusting output power of microwave radar equipment | |
US20210365039A1 (en) | Target tracking method and device | |
CN115363478B (en) | Cleaning method for cleaning robot repositioning failure and cleaning robot | |
CN107122084B (en) | Method and device for identifying touch operation on infrared touch screen and terminal equipment | |
CN117991232A (en) | Radar control method, radar control device, terminal equipment and computer readable storage medium | |
CN114966653A (en) | Target detection method and device based on ultrasonic radar, medium and electronic equipment | |
CN114648882A (en) | Parking space detection method and device | |
CN110133624B (en) | Unmanned driving abnormity detection method, device, equipment and medium | |
JPH02206806A (en) | Control system having plural processor units | |
JP2018106458A (en) | Memory diagnostic device, vehicle control device, memory diagnostic method and vehicle control method | |
US20220351618A1 (en) | Traffic Indication Information Determining Method and Apparatus | |
US20230169781A1 (en) | Free space detection and park-able free space detection for occupancy grids using sensor measurements |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant | ||
TR01 | Transfer of patent right |
Effective date of registration: 20240516 Address after: Room 6227, No. 999, Changning District, Shanghai 200050 Patentee after: Shenlan robot (Shanghai) Co.,Ltd. Country or region after: China Address before: Unit 1001, 369 Weining Road, Changning District, Shanghai, 200336 (9th floor of actual floor) Patentee before: DEEPBLUE TECHNOLOGY (SHANGHAI) Co.,Ltd. Country or region before: China |
|
TR01 | Transfer of patent right |