22-year electric competition question B - electric car with automatic parking function - record and experience sharing

foreword

This question is also a small car electric competition question. Due to the accumulation of some experience in the electric competition question in October, the feeling of doing this question is not bad, but we have not carefully reviewed the question, and there are some deviations from the question requirements. , but the basic functions are still made, and you can still refer to them

This problem is the second subject in our daily life, reversing into the garage and parking on the side, requiring the use of four-wheel electric vehicles with front wheel steering, which restricts the types of vehicles. This is a point

But there is no limit to the MCU, that is, you can use the MCU that you think is easy to use and familiar with to do the questions

For this question, we use TI's MCU, the model is TIM4C123G6HPM, which is the small board below. Except for a little less pins, it is similar to 32 after familiar use, and can be used quickly.

insert image description here

At that time, we considered that if the topic of this year's e-sports competition restricted TI's MCU, we used TI's MCU for this topic.


Problem analysis

Let's first look at the requirements of this topic. The basic requirement is to independently complete the reverse storage and exit, respectively, and independently complete the side storage and exit

Everything is done on this basis
insert image description here
insert image description here

According to the topic, we can know that it is backing into the garage and side parking. The requirements of different topics are whether there is a car in the adjacent garage, whether it is a single step backing into the garage or side parking or continuous

Ok, let's analyze according to the topic

1. Vehicle model selection
2. Tracking along the sideline of the storage line
3. Reversing storage stop to prepare for reversing sign
4. Reversing storage operation or side storage operation
5. There are cars in the adjacent storage, small vehicles enter and exit

The most important thing about this topic is 车型的选择to准备倒库倒车停止标志


1. Selection of car models

this topic,The vehicle type is limited, requiring the use of four-wheeled vehicles with front-wheel steering

Since the four-wheeled car steered by the front wheel steering gear has been used in the following car system, we use a four-wheeled car with the front wheel steering gear and the rear wheel as the driving wheel for this question.

However, because we are practicing, we did not study the size of the trolley carefully. We modified the structure of the trolley in the following trolley system and used it directly.

And note that the topic is also limited in the size of the car, the requirements are as follows
insert image description here

So this question is different from the previous one where the length limit was less than 25, and the car model has become larger. It is still difficult for reversing into the garage and parking on the side.

建议大家根据题目要求来合理选择自己的车型

Prepare several more models before the game, and keep more hands


2. Tracking along the edge of the library

The title requires that the projection on the right side of the trolley is about 5cm away from the edge of the warehouse

We have ignored the requirements of this question, so when doing the question, it is not 5cm away from the edge of the library, and there are a few small flaws

insert image description here
insert image description here

How to realize this, of course the basic infrared and grayscale cannot be realized, because the warehouse side line is on the right side of the car, so the camera can only be used for tracking

Here, the method of simulating the grayscale sensor by the camera is used. According to the movement posture of the car, different deviation values ​​are given, and then the car corrects its own posture according to the deviation value err sent back, so that the car is always moving forward at the expected value of patrolling the line.

The knowledge points shared in the previous two issues are the same, so I won’t repeat them too much.

大家可以去看前两期分享的博客,里面有详细的介绍,关于小车循迹的几种方法以及32端如何接收OpenMv传回来的偏差值进行PID计算


3. Reversing warehouse stop ready to reversing sign

The main purpose of the car is to reverse into the garage or park on the side. When the car follows the track, when will it stop and prepare to reverse the garage?

We divide the upper right part of the camera into the region of interest, and then perform template matching to match

Because everyone can see whether it is reversing into the garage or parking on the side,第三个库的库角都和前两个的特征不同,根据这个特征就可以进行模板匹配

insert image description here
insert image description here

When the camera matches the warehouse corner mark, it will send the mark position to the car, and the car will stop according to the mark position and prepare to reverse the warehouse


4. Reverse storage operation or side storage operation

When the car recognizes the sign of ready to dump the warehouse, I basically wrote the following operations to death

  • Go forward for a while, turn on the direction and reverse the car, back up until it is level with the garage, turn the direction back, and reverse the garage

The switching timing here is judged according to the distance traveled by the car, and when the car is reversed, a small differential speed can be given to the rear wheels, which is more convenient for the car to reverse

  • Stop for 2 seconds after entering the warehouse, prepare to leave the warehouse, continue to patrol the line after leaving the warehouse, until the identification of the side parking stop line

The steps of side parking are basically the same as reverse parking

Everyone has to find the right timing and the right steering gear direction (ie PWM), and then connect

Completed reverse parking or side parking

Of course, on station B, I also saw that the storage of many big guys is very smooth, and it is worth learning.
The tutorial of the unknown brother gave me a lot of inspiration at the beginning.
You can visit station B more and discover your own. inspiration


5. There is a car in the adjacent warehouse, and the car enters and exits the warehouse

This we found,如果采用上述说过的方法,有很大可能识别不到准备倒库停止标志,因为可能邻库的车把库角挡住了,然后摄像头识别不到或者是识别的概率大大降低

We have not resolved this point, and this is also one of the flaws. There is a probability that it cannot be recognized, and the car will run away directly, and the warehouse will fail.

Due to time constraints, we have made a rough idea of ​​this topic. Both the basic inverted library and the side method can be realized, but there are flaws, but you can still refer to the program logic and basic ideas for learning.


Debugging experience sharing

In fact, if this question is only done on the side or the side,基本的调试可能更多的在摄像头那边,因为要保证停车标志的准确性

The rest is the logic writing on the side of the car, and the most debugging is estimated to be the switching of various states, such as the angle of the corner, the distance of the back and forward, and the debugging of the line inspection.

nothing more

If there is a car in the adjacent warehouse, there is still a probability that the parking stop sign cannot be recognized, and it needs to be improved


Another point is to pay attention to read the questions carefully, use a pen to draw the various requirements of the questions, and review the questions carefully, otherwise, in the formal competition, it may be due to temporary negligence, resulting in no results


Summarize

这是关于自己刷真题时,做题的记录和经验分享,都是自己经过实际测试和调试后得出的方案,将这些给大家分享,希望能够帮助到大家

After doing this topic,
I concluded that a set of program flow codes suitable for me is very easy to use, such as various state switching, etc.

Similarly, I also open sourced the code for this topic, you can refer to it for learning


open source link

You can refer to study

Everyone can visit and download by themselves

下方为gitee开源链接,请大家点一个star,谢谢

oufen / 2022 E-sports Question B-Automatic Parking System

Guess you like

Origin blog.csdn.net/cyaya6/article/details/132333145