Disclosure of Invention
The invention provides a racing car, an intelligent control method, a system and a computer readable storage medium thereof, which are used for solving the problems of low intelligent degree, unbalanced striking capacity and endurance capacity of the conventional racing car.
In order to achieve the above object, the present invention provides an intelligent control method applied to racing car, the method comprising the following steps:
s101, acquiring an athletic map;
s102, carrying out partition processing on the competition map;
s103, acquiring the current position of the racing car, and adjusting the control program of the racing car according to the current position;
s104, receiving a striking instruction, and controlling the mechanical arm to execute striking action.
Specifically, the step S101 of acquiring the athletic map includes:
the method comprises the steps of acquiring a pre-imported competition map or acquiring the competition map on site through a laser sensor or a vision acquisition system.
Specifically, the step S102 of partitioning the athletic map includes:
acquiring a central position O of the athletic map, and setting the central position O as a circle center and R0 as a radius as a first partition;
Setting an area with a width W from the edge of the athletic map as a third partition;
And setting the remaining area of the athletic map as a second partition.
Specifically, the step S103 is to obtain the current position of the racing car, and adjust the control program of the racing car according to the current position, including:
if the current position of the racing car is located in a first partition, a first control program is started;
If the current position of the racing car is located in a second partition, a second control program is started;
if the current position of the racing car is located in a third partition, a third control program is started;
wherein, the
The first control program is used for detecting the current position and speed of a target racing car, setting an ultrasonic sensor or a radar sensor into a first working state, wherein the first working state comprises setting the pulse repetition frequency of the ultrasonic sensor or the radar sensor into a first frequency F1;
The second control program is used for detecting the current position and speed of the target racing car, setting the ultrasonic sensor or the radar sensor into a second working state, wherein the second working state comprises setting the pulse repetition frequency into a second frequency, starting a mechanical arm swinging program to set the mechanical arm into a swinging state when the relative position is smaller than a second threshold value, and setting the second threshold value to be smaller than the first threshold value;
And the third control program is that the current position and the speed of the target racing car are not detected, and the ultrasonic sensor or the radar sensor is set to be in a dormant state.
Specifically, the first frequencyThe calculation is performed by the following formula:
;
for the initial pulse repetition frequency, alpha, beta are adjustment coefficients, v is the current speed of the racing car, And delta v is the relative speed of the racing car and the target racing car.
Specifically, the step S104 of receiving the striking command, controlling the mechanical arm to perform the striking action includes:
The current gesture of the racing car is obtained, the gesture of the racing car is adjusted to face the target racing car, and the striking action is executed.
Further, the method further comprises:
S105, monitoring the mechanical arm of the target racing car, and adjusting the position of the racing car according to the state of the mechanical arm of the target racing car.
In another aspect, the present invention also provides a racing car, the racing car comprising:
the sensor module is used for collecting the position and speed information of the racing car and the target racing car;
The communication module is used for sending and receiving the acquired data and control instructions;
And a processor for executing the intelligent control method as described above.
On the other hand, the invention also provides an intelligent control system applied to the racing car, and the system comprises a server which executes the intelligent control method.
In another aspect, the present invention also provides a computer readable storage medium storing a computer program for electronic data exchange, wherein the computer program is used to execute the intelligent control method as described above.
Compared with the prior art, the intelligent control method, the intelligent control system and the computer readable storage medium for the racing car have the advantages that the intelligent control method of the racing car is improved, the racing map is partitioned, the current position of the racing car is detected, the working states of sensors of the racing car in different partitions are controlled, the pulse repetition frequency of the sensors is regulated, the frequency of data acquisition of the sensors is controlled, the swinging state of the mechanical arm is intelligently controlled, the racing car can swing the mechanical arm more intelligently, and a striking action is prepared for the racing car, so that the sensors can be prevented from being overloaded for a long time to acquire data, the data acquisition frequency is reduced, the pressure of a processor for processing the data is reduced, the system jamming caused by overload processing of the acquired data of the processor is avoided, and on the other hand, the configuration of the processor of the racing car can be properly reduced, and the manufacturing cost is reduced. In addition, the intelligent sensor control can give consideration to the striking capability and the endurance capability of the racing car.
Detailed Description
The following description of the embodiments of the present invention will be made clearly and completely with reference to the accompanying drawings, in which it is apparent that the embodiments described are only some embodiments of the present invention, but not all embodiments. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention. For more detailed description of the present invention, the following describes a racing car, an intelligent control method, a system and a computer readable storage medium thereof with reference to the accompanying drawings.
Racing car refers to a car with a mechanical arm/swing arm, also known as a robotic car, a combat robot. The racing car usually appears on a relatively closed racing field, can receive control instructions of users and finish movements such as moving and swinging the mechanical arm/swinging arm. Racing vehicles generally comprise a body with wheels, and various sensors and mechanical arms arranged on the body, and can be controlled by controlling the forward and reverse rotation of corresponding motors to complete operations such as forward, backward, turning, controlling the mechanical arms to perform swinging, beating and the like.
As shown in fig. 1, the invention provides an intelligent control method applied to a racing car, which comprises the following steps:
s101, acquiring an athletic map;
s102, carrying out partition processing on the competition map;
s103, acquiring the current position of the racing car, and adjusting the control program of the racing car according to the current position;
s104, receiving a striking instruction, and controlling the mechanical arm to execute striking action.
It will be appreciated that conventional racing vehicles do not include an intelligent control system that enables movement thereof solely by control of the user, however, as demand for people increases, conventional racing vehicles have become difficult to meet, and people have begun to add processors and various sensors to racing vehicles to increase their ability to play.
In this embodiment, the position of the racing car is detected, and the control program is intelligently adjusted according to the position of the racing car, so that the intelligent degree of the racing car is improved, and the endurance of the racing car is considered.
Specifically, the step S101 of acquiring the athletic map includes:
the method comprises the steps of acquiring a pre-imported competition map or acquiring the competition map on site through a laser sensor or a vision acquisition system.
It can be understood that when racing in a racing game, the racing car is usually in a relatively closed area, and a user performs operations such as backlog and striking on the racing car of other users by controlling the mechanical arm of the racing car, so that the racing car of the opposite party is damaged or is in a state of being unable to continue to move, so as to obtain the winning of the game, and the number of racing cars in the racing game is usually 2, although the racing car is not limited to this, and there are multiple racing cars in a mixed game. In a racing game, since the speed of racing car is high, in order to make the racing car play its mobility to the maximum extent, it is usual to fight in the middle area of the racing area.
In this embodiment, the competition map is imported into the competition racing car in advance, so that the competition map can be analyzed in advance, the competition map is divided into areas, and when the competition racing car is in different areas, different control programs are adopted.
In another embodiment, a laser sensor or a vision acquisition system can be also arranged for the racing car, so that after the racing car arrives at the racing field, the racing map can be dynamically scanned in real time, and the control precision is improved.
Further, the step S102 of partitioning the athletic map includes:
acquiring a central position O of the athletic map, and setting the central position O as a circle center and R0 as a radius as a first partition;
Setting an area with a width W from the edge of the athletic map as a third partition;
And setting the remaining area of the athletic map as a second partition.
It can be appreciated that the competition map is generally rectangular or circular, and the method disclosed in this embodiment achieves intelligent control over the competitive racing car by partitioning the competition map. The method comprises the steps of obtaining a central position O of an athletic map, wherein the central position O can be the center of a circle or an ellipse map when the athletic map is a circle or an ellipse, can be the diagonal intersection point of a rectangular map when the athletic map is a rectangle, can be determined according to the characteristics of other regular patterns or irregular patterns when the athletic map is a regular pattern, and is used for extracting the maximum lengths of the map in the horizontal and vertical directions, namely, the maximum lengths are equivalent to the circle or the rectangle, and the center of a circle or a rectangle area is used as the central position O.
As described above, since racing cars are fast in the course of racing, in order to maximize the mobility of racing cars, it is common to fight in the middle region of the racing area. Therefore, in this embodiment, a virtual circle is drawn with the center position O as a center and R0 as a radius, and is used as the first partition. The radius R0 may be set as required, and is not particularly limited, and for example, the radius R0 may be set to 5-8 times, preferably 6 times, the maximum length or the maximum width of the racing car, or the radius R0 may be set to 0.3-0.6 times the maximum length or the maximum width of the map area.
In the competition process, the periphery of the competition map is usually provided with a surrounding shield so as to prevent the competition racing car from flying out of the competition field. Therefore, in the playing process, when the user starts the racing car to the edge area of the playing map, the mechanical arm of the racing car is not operated, on one hand, the mobility of the racing car in the edge area is poor, other racing cars cannot be hit accurately, and on the other hand, the mechanical arm is operated in the edge area, so that the mechanical arm is blocked in the enclosure, and unnecessary damage is caused. Therefore, in the present embodiment, the area having the width W from the edge of the athletic map is set as the third division. The width W may be set as required, and is not particularly limited, and may be, for example, 2 times the maximum length or maximum width of the racing car, or 0.05-0.1 times the maximum length or maximum width of the racing map area. It can be understood that the third partition is the outermost peripheral area of the competition map, the shape of which matches with the outline of the competition map, the third partition is circular when the competition map is circular, and the third partition is rectangular when the competition map is rectangular.
And setting the remaining area of the competition map as a second partition based on the first partition and the third partition. It will be appreciated that when the racing car is in the second partition, it is typically in a race ready state or in a condition of adjusting the attitude of the car, in which area the racing car is ready to enter the race state at any time.
Further, the step S103 is to obtain a current position of the racing car, and adjust a control program of the racing car according to the current position, including:
if the current position of the racing car is located in a first partition, a first control program is started;
If the current position of the racing car is located in a second partition, a second control program is started;
if the current position of the racing car is located in a third partition, a third control program is started;
wherein, the
The first control program is used for detecting the current position and speed of a target racing car, setting an ultrasonic sensor or a radar sensor into a first working state, wherein the first working state comprises setting the pulse repetition frequency of the ultrasonic sensor or the radar sensor into a first frequency F1;
The second control program is used for detecting the current position and speed of the target racing car, setting the ultrasonic sensor or the radar sensor into a second working state, wherein the second working state comprises setting the pulse repetition frequency into a second frequency, starting a mechanical arm swinging program to set the mechanical arm into a swinging state when the relative position is smaller than a second threshold value, and setting the second threshold value to be smaller than the first threshold value;
the third control program is to set the ultrasonic sensor or the radar sensor to a sleep state without detecting the target racing car.
It can be appreciated that in this embodiment, by intelligently controlling each sensor on the racing car for different partitions, unnecessary data acquisition is avoided, and the processing load of the processor is excessively high. As described above, when the racing car is in the first partition, the timeliness of the sensor for acquiring data is required to be maintained because the racing car is in the combat state, so as to improve the maneuverability of the racing car, reduce the data processing delay caused by untimely sensor sampling, and further cause that the mechanical arm cannot timely enter the swing state. When a user controls the mechanical arm of the racing car to perform a striking action, the mechanical arm is usually required to enter a swinging state, and the striking force of the mechanical arm is improved by utilizing the centrifugal force generated when the mechanical arm swings. However, if the swing mechanical arm is first executed and then the hitting action is executed when the hitting instruction of the user is received, the hitting action may not be timely and the target racing car cannot be hit, and if the hitting action is directly executed, the hitting force is insufficient and the target racing car cannot be damaged.
Therefore, in this embodiment, by detecting the current position of the racing car, if the current position is in the first partition, the ultrasonic sensor or the radar sensor on the racing car is set to the first working state, so as to increase the pulse repetition frequency of the sensor. Further, since the racing car of the user and the target racing car of the opponent are both in a high-speed motion state, if the intelligent control is performed only based on the speed of the racing car of the user, there is a problem of low control accuracy, and the problem of low accuracy is mainly caused by the fact that the moving speed of the target racing car of the opponent is high, so that the relative speeds of the two are high. The method comprises the steps of detecting the current position and the speed of a target racing car, dynamically adjusting pulse repetition frequency based on the position and the speed information of the two parties, improving timeliness of data acquired by a sensor, starting a swinging program of a mechanical arm when the relative position of the racing car and the target racing car is smaller than a first threshold value, setting the mechanical arm to be in a swinging state, enabling the mechanical arm to enter a ready state for executing a striking action, and rapidly executing the striking action and accurately striking the target racing car when a striking instruction is received. The detection of the positions and the speeds of the racing car and the target racing car and the relative speeds of the racing car and the target racing car can be realized by combining a data fusion algorithm or a differential algorithm through technologies such as a distance sensor, a laser range finder or 3D structured light.
When the racing car is in the second partition, the racing car is in a racing ready state or a racing car posture adjusting state, and high timeliness is not needed, if the sensor keeps the pulse repetition frequency in the first partition for data acquisition, the acquired data volume is too large, the calculation pressure of a processor is increased, and system blocking or downtime is caused when the sensor is severe. Therefore, in this embodiment, when the racing car is in the second partition, the ultrasonic sensor or the radar sensor is set to a second working state, the pulse repetition frequency is set to a second frequency, the second frequency may be an initial pulse repetition frequency of the ultrasonic sensor or the radar sensor, when the relative position is smaller than a second threshold, a swing program of the mechanical arm is started, the mechanical arm is set to a swing state, and the second threshold is smaller than the first threshold. It can be understood that the pulse repetition frequency of the sensor of the racing car in the second partition is properly reduced, and when the relative position of the sensor and the racing car is smaller than the second threshold value, the target racing car of the opposite side is closer to the racing car of the user, and the mechanical arm needs to be set in a swinging state to enter into striking preparation.
When the racing car is in the third partition, no striking operation is usually performed, so the pulse repetition frequency of the sensor can be minimized or put directly to sleep, so that the sensor and the processor can be maximized "rest" to keep the racing car in an optimal state.
Further, in order to enable the sensor to acquire data more timely when the racing car is in the first zone, the pulse repetition frequency of the ultrasonic sensor or the radar sensor is set to be a first frequencyThe first frequencyThe calculation is performed by the following formula:
;
for the initial pulse repetition frequency, alpha, beta are adjustment coefficients, v is the current speed of the racing car, And delta v is the relative speed of the racing car and the target racing car.
It will be appreciated that the reference speed may be the average speed of the racing car over a period of time or the average of the maximum speed and the minimum speed of the racing car, a first frequencyDynamic adjustment is made according to the speed of the racing car and the target racing car. When the speed of the racing car is faster, the speed of the target racing car is faster, the first frequencyThe larger the interval at which the sensor collects data, the more timely the data is collected.
In order to further improve the racing ability of the racing car, the step S104 of receiving the striking command and controlling the mechanical arm to perform the striking action further comprises the steps of obtaining the current gesture of the racing car, adjusting the gesture of the racing car to face the target racing car, and performing the striking action.
It can be understood that the mechanical arm can only move back and forth along one direction, and if the striking action of the mechanical arm is precisely hit, the posture of the racing car or the posture of the holder where the mechanical arm is positioned needs to be adjusted. However, during the course of the racing, the user may not be able to correctly adjust the correct orientation of the racing car or the tripod head due to the high tension. In this embodiment, the specific orientation of the target racing car can be obtained by analyzing the data collected by the sensors on the racing car, and the posture of the racing car is adjusted so that the racing car faces the target racing car. Therefore, when a user sends out a striking instruction, the mechanical arm can accurately hit the target racing car.
The gestures in the above embodiments are directed to the position and orientation of the racing car only, but are not limited thereto. In order to improve the racing ability during design, the racing car can refer to the robot to set a joint-like component, so that the racing car can adjust the posture of the whole car, such as front tilting, back tilting and the like, and the striking ability and the evading ability of the racing car are improved. For this type of racing car, the method of this embodiment may be applied to adjust the posture of the racing car while performing the striking action, for example, when the mechanical arm performs the striking action forward, the striking force is maximized in cooperation with the front tilting of the racing car.
Further, the method further comprises:
S105, monitoring the mechanical arm of the target racing car, and adjusting the position of the racing car according to the state of the mechanical arm of the target racing car.
It can be appreciated that various sensors and a visual acquisition system can be arranged in the racing car, the state of the target racing car can be analyzed through an image recognition technology according to the acquired data, and when the target racing car is detected and the hitting action is being executed, the racing car is timely adjusted to avoid operation, so that the mechanical arm of the target racing car is prevented from hitting the important part of the racing car.
In order to achieve the object of the present invention, as shown in fig. 2, the present invention also provides a racing car comprising:
the sensor module is used for collecting the position and speed information of the racing car and the target racing car;
The communication module is used for sending and receiving the acquired data and control instructions;
And a processor for executing the intelligent control method as described above.
In order to achieve the object of the invention, the invention also provides an intelligent control system applied to racing cars, which comprises a server, wherein the server executes the intelligent control method.
To achieve the object of the invention, the invention also provides a computer-readable storage medium storing a computer program for electronic data exchange, wherein the computer program is for executing the intelligent control method as described above.
From the above description of embodiments, it will be clear to a person skilled in the art that the present invention may be implemented by means of software plus necessary general purpose hardware, but of course also by means of hardware, but in many cases the former is a preferred embodiment. Based on such understanding, the technical solution of the present invention may be embodied essentially or in a part contributing to the prior art in the form of a software product stored in a readable storage medium, such as a floppy disk, a hard disk, or an optical disk of a computer, etc., including several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute the method according to the embodiments of the present invention.
The foregoing embodiments are only for illustrating the technical solution of the present invention, but not for limiting the same, and although the present invention has been described in detail with reference to the foregoing embodiments, it should be understood by those skilled in the art that modifications may be made to the technical solution described in the foregoing embodiments or equivalents may be substituted for parts of the technical features thereof, and such modifications or substitutions do not depart from the spirit and scope of the technical solution of the embodiments of the present invention.