Method for realizing automobile attitude measurement positioning based on STM32 and laser radar

文档序号:1534037 发布日期:2020-02-14 浏览:56次 中文

阅读说明:本技术 基于stm32和激光雷达实现汽车姿态测量定位的方法 (Method for realizing automobile attitude measurement positioning based on STM32 and laser radar ) 是由 张丹丹 张志民 王娟 卢扬扬 于 2019-10-29 设计创作,主要内容包括:本发明属于汽车搬运姿态定位领域,涉及一种可适用于室外汽车搬运的基于STM32和激光雷达实现待搬运汽车姿态快速测量定位的方法,该方法利用STM32车载控制器收到第一激光雷达和第二激光雷达的测量信息后,建立在坐标系下的车体点模型,在坐标系中选取n对左右两侧的有效数据点并进行均值处理,所有均值点组成的点线即为激光雷达扫描车体模型的中心线,通过对这些均值点进行拟合处理即可计算出待搬运汽车中心点与搬运AGV中心点的相对位置关系,进而控制搬运AGV进行姿态调整。本发明具有可快速测量出待搬运汽车的姿态,测量精度高,是实现汽车无人搬运较为重要的一个环节,可大大节约人工成本,提高企业的生产节拍,可节约开发成本。(The invention belongs to the field of automobile carrying attitude positioning, and relates to a method for realizing quick measuring and positioning of the attitude of an automobile to be carried based on STM32 and a laser radar, which is suitable for outdoor automobile carrying. The invention can quickly measure the posture of the automobile to be transported, has high measurement precision, is an important link for realizing unmanned transportation of the automobile, can greatly save labor cost, improves the production rhythm of enterprises, and can save development cost.)

1. A method for achieving automobile attitude measurement positioning based on STM32 and a laser radar is characterized in that an STM32 vehicle-mounted controller is used for receiving measurement information of a first laser radar and a second laser radar, a vehicle body point model under a coordinate system is built, n pairs of effective data points on the left side and the right side are selected from the coordinate system and subjected to mean value processing, a point line formed by all the mean value points is a central line of the laser radar scanning vehicle body model, and finally the relative position relation between a center point of an automobile to be transported and a center point of an AGV to be transported can be calculated through fitting processing of the mean value points, so that the AGV to be transported is controlled to conduct attitude adjustment.

2. The method according to claim 1, characterized in that the method comprises the following specific steps:

s1) the STM32 vehicle-mounted controller is in communication connection with the first laser radar and the second laser radar;

s2) the first laser radar and the second laser radar send collected measurement information to an STM32 vehicle-mounted controller, the STM32 vehicle-mounted controller establishes a vehicle body point model under a coordinate system through the measurement information, and mean value processing is carried out on the data;

s3) point lines formed by all the mean values are the center lines of the car body model, and the relative position relations △ d and △ theta between the center points of the car body and the AGV body are calculated according to the center lines, namely the distance and the angle of the AGV to move;

s4) converting the distance and angle of the AGV to be moved into a motion instruction which can be recognized by the AGV, and controlling the AGV to perform attitude fine adjustment until the relative position relation between the central point of the automobile to be transported and the central point of the AGV is adjusted to be within an allowable error range.

3. The method as claimed in claim 2, wherein the specific steps of S2) are:

s2.1) establishing a first lidar center point O1And a second lidar centre point O2The line is X-axis and the vertical direction is Y-axis, O1And O2A point model in a coordinate system with the center point of the connecting line as the origin, and then filtering the jumping data;

s2.2) selecting n pairs of effective data points A (x, y) and B (x, y) from the coordinate system, and carrying out mean value processing on the n pairs of effective data points A (x, y) and B (x, y), wherein the value range of n is a positive integer larger than 0 to obtain a mean value point C (x, y), and a point line formed by all the mean value points C (x, y) is the central line of the laser radar scanning vehicle body model;

s2.3) setting A (x, y) as (x) at the ith data pointAi,yAi) (ii) a B (x, y) points and A (x, y) are (x, y) at the ith data pointBn+1-i,yBn+1-i) And i is 1 … n, the mean value C (x, y) is ((x)Ai+xBn+1-i)/2,(yAi+yBn+1-i) And/2), fitting the mean value point C (X, Y) according to a least square method to form a linear straight line equation aX + bY + C which is 0, wherein a is a coefficient of X, b is a coefficient of Y, and C is a constant.

4. The method according to claim 3, wherein the specific steps of S2.1) are as follows:

s2.11) taking a connecting line of the first laser radar and the second laser radar as an X-axis direction, taking the center of the connecting line of the first laser radar and the second laser radar as an origin O, taking the vertical direction as a Y-axis direction, and setting the center point of the first laser radar as O1Point, the center point of the second laser radar is set as O2Point;

s2.12) setting a first laser radar center point O1Distance to A (x, y) point is L1From the origin O to the first lidar center point O1Is L from each otherA

Angle ∠ AO1O=π-θ1,π=180°,θ1Is the scanning angle of the first laser radar;

the x coordinate of point A (x, y) is L1cos(π-θ1)-LA

The y coordinate of point A (x, y) is L1sin(π-θ1);

That is, point A (x, y) is A (L)1cos(π-θ1)-LA,L1sin(π-θ1));

S2.13) setting a second laser radar center point O2Distance to point B (x, y) is L2From the origin O to the center point O of the second laser radar2Is L from each otherB

Angle ∠ BO2O=θ2,θ2Is the scanning angle of the first laser radar;

the x coordinate of point B (x, y) is LB-L2cos(θ2);

Point B (x, y) has y coordinate L2sin(θ2);

I.e. point B (x, y) is B (L)B-L2cosθ2,L2sin(θ2))。

5. The method as claimed in claim 2, wherein the specific steps of S3) are:

s3.1) adjusting an included angle between 0 and the Y axis of the fitted linear equation aX + bY + c until the included angle between the linear equation and the Y axis is 0 degree;

s3.2) before the vehicle enters the AGV, namely the value of the Y coordinate of the front end of the vehicle is larger than 0, linearly fitting the scanned data of the front end of the vehicle to obtain a straight line a1X+b1Y+c1The intersection D between 0 and the equation aX + bY + c is 0, where a is the anchor point before the vehicle enters the AGV for transport1Is a coefficient of X, b1Is a coefficient of Y, c1Is a constant;

s3.3) when the vehicle enters the AGV, namely the value of the Y coordinate of the front end of the vehicle is less than or equal to 0, the laser radar cannot scan the front end of the vehicle after the front end of the vehicle crosses the X axis of the coordinate system, namely the scanning data of the front end of the vehicle cannot be obtained, only the data of the vehicle bodies on two sides of the vehicle from the head to the tail of the vehicle can be scanned, and the mean value processing in the X direction and the Y direction is carried out on all the scanned data of the vehicle bodies on the two sides of the vehicle from the head to the tail of the vehicle in the coordinate system to obtain the position of the vehicle;

s3.4) after the vehicle enters the AGV, the x coordinate of a positioning coordinate point D (x, y) for transporting the AGV is as follows:

Figure FDA0002251839770000031

the y-coordinate of the location coordinate point D (x, y) is:

Figure FDA0002251839770000032

s3.5) the STM32 vehicle-mounted controller calculates the relative position relations △ d and △ theta between the center point of the vehicle body and the center point of the AGV body, namely the distance and the angle to be moved for transporting the AGV.

6. The method as claimed in claim 2, wherein the STM32 vehicle-mounted controller in S1) is communicatively connected with the lidar through an LWIP protocol stack.

7. The method of claim 2, wherein the first lidar and the second lidar scanning in S2) range from-45 ° to 225 °.

8. A computer program implementing a method of implementing an automotive attitude measurement fix based on STM32 and lidar as claimed in any of claims 1-7.

9. An information processing terminal implementing the method for achieving automobile attitude measurement positioning based on STM32 and lidar according to any of claims 1-7.

10. A computer-readable storage medium comprising instructions which, when executed on a computer, cause the computer to perform the method of achieving vehicle attitude measurement positioning based on STM32 and lidar of any of claims 1 to 7.

The technical field is as follows:

the invention belongs to the field of automobile carrying attitude positioning, and relates to a method for realizing rapid measuring and positioning of automobile attitude to be carried based on STM32 and laser radar, which is suitable for outdoor automobile carrying.

Background art:

at present, the most common method for positioning and mapping the automobile attitude in an unknown environment is the SLAM algorithm, but the SLAM algorithm is complex to implement and high in memory consumption, so that the SLAM algorithm is developed on an industrial personal computer, and the scanning and modeling of the vehicle to be transported cannot be realized by applying the SLAM algorithm on an STM32 board card. In the serial communication mode, data is transmitted sequentially bit by bit, and the data transmission efficiency is low.

Disclosure of Invention

The invention discloses a method for realizing automobile attitude measurement positioning based on STM32 and a laser radar, which aims to solve any one of the above and other potential problems in the prior art.

In order to achieve the purpose, the technical scheme of the invention is as follows: a method for achieving automobile attitude measurement positioning based on STM32 and a laser radar includes the steps that after an STM32 vehicle-mounted controller receives measurement information of a first laser radar and a second laser radar, a vehicle body point model under a coordinate system is built, n pairs of effective data points on the left side and the right side are selected in the coordinate system and subjected to mean value processing, point lines formed by all the mean value points are center lines of the laser radar scanning vehicle body model, finally, the STM32 vehicle-mounted controller can calculate relative position relations between center points of an automobile to be transported and center points of an AGV to be transported through fitting processing of the mean value points, and then the AGV is controlled to conduct attitude adjustment.

Further, the method comprises the following specific steps:

s1) the STM32 vehicle-mounted controller is in communication connection with the first laser radar and the second laser radar;

s2) the first laser radar and the second laser radar send collected measurement information to an STM32 vehicle-mounted controller, the STM32 vehicle-mounted controller establishes a vehicle body point model under a coordinate system through the measurement information, and mean value processing is carried out on the data;

s3) point lines formed by all the mean values are the center lines of the car body model, and the relative position relations △ d and △ theta between the center points of the car body and the AGV body are calculated according to the center lines, namely the distance and the angle of the AGV to move;

s4) converting the distance and angle of the AGV to be moved into a motion instruction which can be recognized by the AGV, and controlling the AGV to perform attitude fine adjustment until the relative position relation between the central point of the automobile to be transported and the central point of the AGV is adjusted to be within an allowable error range.

Further, the specific steps of S2) are:

s2.1) establishing a first lidar center point O1And a second lidar centre point O2The line is X-axis and the vertical direction is Y-axis, O1And O2A point model in a coordinate system with the center point of the connecting line as the origin, and then filtering the jumping data;

s2.2) selecting n pairs of effective data points A (x, y) and B (x, y) from the coordinate system, and carrying out mean value processing on the n pairs of effective corresponding data points A (x, y) and B (x, y), wherein the value range of n is a positive integer larger than 0 to obtain a mean value point C (x, y), and a point line formed by all the mean value points C (x, y) is the central line of the laser radar scanning vehicle body model;

s2.3) setting A (x, y) as (x) at the ith data pointAi,yAi) (ii) a The point corresponding to the ith data point of B (x, y) and A (x, y) is (xBn+1-i,yBn+1-i) And i is 1 … n, the mean value C (x, y) is ((x)Ai+xBn+1-i)/2,(yAi+yBn+1-i) And/2), fitting the mean value point C (X, Y) according to a least square method to form a linear straight line equation aX + bY + C which is 0, wherein a is a coefficient of X, b is a coefficient of Y, and C is a constant.

Further, the specific steps of S2.1) are:

s2.11) taking a connecting line of the first laser radar and the second laser radar as an X-axis direction, taking the center of the connecting line of the first laser radar and the second laser radar as an origin O, taking the vertical direction as a Y-axis direction, and setting the center point of the first laser radar as O1Point, the second lidar center point is set to O2Point;

s2.12) setting a first laser radar center point O1Distance to A (x, y) point is L1From the origin O to the first lidar center point O1Distance between themIs separated to LA

Angle ∠ AO1O=π-θ1,π=180°;

The x coordinate of point A (x, y) is L1cos(π-θ1)-LA

The y coordinate of point A (x, y) is L1sin(π-θ1);

That is, point A (x, y) is A (L)1cos(π-θ1)-LA,L1sin(π-θ1));

S2.13) setting a second laser radar center point O2Distance to point B (x, y) is L2From the origin O to the center point O of the second laser radar2Is L from each otherB

Angle ∠ BO2O=θ2

The x coordinate of point B (x, y) is LB-L2cos(θ2);

Point B (x, y) has y coordinate L2sin(θ2);

I.e. point B (x, y) is B (L)B-L2cosθ2,L2sin(θ2))。

Further, the specific steps of S3) are:

s3.1) adjusting an included angle between 0 and the Y axis of the fitted linear equation aX + bY + c until the included angle between the linear equation and the Y axis is 0 degree;

s3.2) before the vehicle enters the AGV, namely the value of the Y coordinate of the front end of the vehicle is larger than 0, linearly fitting the scanned data of the front end of the vehicle to obtain a straight line a1X+b1Y+c1The intersection D between 0 and the equation aX + bY + c is 0, where a is the anchor point before the vehicle enters the AGV for transport1Is a coefficient of X, b1Is a coefficient of Y, c1Is a constant;

s3.3) when the vehicle enters the AGV, namely the value of the Y coordinate of the front end of the vehicle is less than or equal to 0, the laser radar cannot scan the front end of the vehicle after the front end of the vehicle crosses the X axis of the coordinate system, namely the scanning data of the front end of the vehicle cannot be obtained, only the data of the vehicle bodies on two sides of the vehicle from the head to the tail of the vehicle can be scanned, and the mean value processing in the X direction and the Y direction is carried out on all the scanned data of the vehicle bodies on the two sides of the vehicle from the head to the tail of the vehicle in the coordinate system to obtain the position of the vehicle;

s3.4) after the vehicle enters the AGV, the x coordinate of a positioning coordinate point D (x, y) for transporting the AGV is as follows:

Figure BDA0002251839780000041

the y-coordinate of the location coordinate point D (x, y) is:

Figure BDA0002251839780000042

s3.5) the STM32 vehicle-mounted controller calculates the relative position relations △ d and △ theta between the center point of the vehicle body and the center point of the AGV body, namely the distance and the angle to be moved for transporting the AGV.

Further, in the S1), the STM32 vehicle-mounted controller and the laser radar implement communication connection through an LWIP protocol stack.

Further, S2) the settable maximum scanning ranges of the first lidar and the second lidar are-45 ° to 225 °, the scanning range of the lidar in practical application may be set according to a specific application scenario, and the angular resolution is 0.33 °.

A computer program for realizing the method for realizing the automobile attitude measurement positioning based on the STM32 and the laser radar is provided.

An information processing terminal for realizing the method for realizing the automobile attitude measurement positioning based on STM32 and laser radar.

A computer-readable storage medium comprising instructions which, when executed on a computer, cause the computer to perform the above-described method for achieving vehicle attitude measurement positioning based on STM32 and lidar.

The invention has the beneficial effects that: due to the adoption of the technical scheme, the gesture of the automobile to be transported can be rapidly measured, the measurement precision is high, the method is an important link for realizing unmanned transportation of the automobile, the labor cost can be greatly saved, the production rhythm of an enterprise is improved, and meanwhile, the cost of the STM32 board card is far lower than that of an industrial personal computer, so that the development cost can be saved.

Drawings

Fig. 1 is a schematic view of the measurement of a first lidar and a second lidar in accordance with the present invention.

FIG. 2 is a flow chart of a method for achieving automobile attitude measurement positioning based on STM32 and laser radar.

FIG. 3 is a schematic diagram of an exemplary TIM561 lidar measurement positioning.

FIG. 4 is a laser radar scan vehicle body data point model.

FIG. 5 is a vehicle body scan modeling centerline.

Fig. 6 is a fitted straight line of the mean point C.

FIG. 7 is a schematic view of a positioning scheme before a vehicle enters the AGV.

FIG. 8 is a schematic view of a positioning scheme after a vehicle enters an AGV.

FIG. 9 is a schematic diagram showing the relative position relationship between the center point of the vehicle to be transported and the center point of the AGV.

In the figure:

1. the laser radar system comprises a first laser radar data point line, a second laser radar data point line, a fitting straight line, a modeling central line, a vertical fitting straight line, a horizontal fitting straight line, a first laser radar and a second laser radar, wherein the modeling central line is 4, the vertical fitting straight line is 5, the horizontal fitting straight line is 6, and the first laser radar is 7 and the second laser radar is 8.

Detailed Description

The technical solution of the present invention is further explained with reference to the accompanying drawings and specific embodiments.

As shown in FIG. 2, the method for realizing the measurement and positioning of the automobile attitude based on STM32 and laser radar establishes an automobile body point model under a coordinate system after receiving the measurement information of a first laser radar and a second laser radar by using an STM32 vehicle-mounted controller, selects n pairs of effective data points on the left side and the right side in the coordinate system and carries out mean value processing, a point line formed by all the mean value points is a central line of the laser radar scanning automobile body model, and finally the STM32 vehicle-mounted controller can calculate the relative position relationship between the center point of the automobile to be transported and the center point of the transporting AGV by fitting the mean value points, thereby controlling the transporting AGV to carry out attitude adjustment.

The method comprises the following specific steps:

s1) the STM32 vehicle-mounted controller is in communication connection with the first laser radar and the second laser radar;

s2) the first laser radar and the second laser radar send collected measurement information to an STM32 vehicle-mounted controller, the STM32 vehicle-mounted controller establishes a vehicle body point model under a coordinate system through the measurement information, and mean value processing is carried out on the data;

s3) a point line formed by all the mean values is a center line of the car body model, and the relative position relations △ d and △ theta between the center point of the car body and the center point of the AGV body are calculated according to the center line, namely the distance and the angle of the AGV to move;

s4) converting the distance and angle of the AGV to be moved into a motion instruction which can be recognized by the AGV, and controlling the AGV to perform attitude fine adjustment until the relative position relation between the central point of the automobile to be transported and the central point of the AGV is adjusted to be within an allowable error range.

The S2) comprises the following specific steps:

s2.1) establishing a first lidar center point O1And a second lidar centre point O2The line is X-axis and the vertical direction is Y-axis, O1And O2A point model in a coordinate system with the center point of the connecting line as the origin, and then filtering the jumping data;

s2.2) selecting n pairs of effective data points A (x, y) and B (x, y) from the coordinate system, and carrying out mean value processing on the n pairs of effective data points A (x, y) and B (x, y), wherein the value range of n is a positive integer larger than 0 to obtain a mean value point C (x, y), and a point line formed by all the mean value points C (x, y) is the central line of the laser radar scanning vehicle body model;

s2.3) setting A (x, y) as (x) at the ith data pointAi,yAi) (ii) a B (x, y) points and A (x, y) are (x, y) at the ith data pointBn+1-i,yBn+1-i) And i is 1 … n, the mean value C (x, y) is ((x)Ai+xBn+1-i)/2,(yAi+yBn+1-i) 2), for the mean point C (x,y) fitting bY the least square method to obtain a linear equation aX + bY + c equal to 0, where a is the coefficient of X, b is the coefficient of Y, and c is a constant.

The S2.1) comprises the following specific steps:

s2.11) taking a connecting line of the first laser radar and the second laser radar as an X-axis direction, taking the center of the connecting line of the first laser radar and the second laser radar as an origin O, taking the vertical direction as a Y-axis direction, and setting the center point of the first laser radar as O1Point, the second lidar center point is set to O2Point;

s2.12) setting a first laser radar center point O1Distance to A (x, y) point is L1From the origin O to the first lidar center point O1Is L from each otherA

Angle ∠ AO1O=π-θ1,π=180°,θ1Is the scanning angle of the first laser radar;

the x coordinate of point A (x, y) is L1cos(π-θ1)-LA

The y coordinate of point A (x, y) is L1sin(π-θ1);

That is, point A (x, y) is A (L)1cos(π-θ1)-LA,L1sin(π-θ1));

S2.13) setting a second laser radar center point O2Distance L to point B (x, y)2From the origin O to the center point O of the second laser radar2Is L from each otherB

Angle ∠ BO2O=θ2

The x coordinate of point B (x, y) is LB-L2cos(θ2);

Point B (x, y) has y coordinate L2sin(θ2);

I.e. point B (x, y) is B (L)B-L2cosθ2,L2sin(θ2))。

The S3) comprises the following specific steps:

s3.1) adjusting an included angle between 0 and the Y axis of the fitted linear equation aX + bY + c until the included angle between the linear equation and the Y axis is 0 degree;

s3.2) before the vehicle enters the AGV, namely the value of the Y coordinate of the front end of the vehicle is larger than 0, linearly fitting the scanned data of the front end of the vehicle to obtain a straight line a1X+b1Y+c1The intersection D between 0 and the equation aX + bY + c is 0, where a is the anchor point before the vehicle enters the AGV for transport1Is a coefficient of X, b1Is a coefficient of Y, c1Is a constant;

s3.3) when the vehicle enters the AGV, namely the value of the Y coordinate of the front end of the vehicle is less than or equal to 0, the laser radar cannot scan the front end of the vehicle after the front end of the vehicle crosses the X axis of the coordinate system, namely the scanning data of the front end of the vehicle cannot be obtained, only the data of the vehicle bodies on two sides of the vehicle from the head to the tail of the vehicle can be scanned, and the mean value processing in the X direction and the Y direction is carried out on all the scanned data of the vehicle bodies on the two sides of the vehicle from the head to the tail of the vehicle in the coordinate system to obtain the position of the vehicle;

s3.4) after the vehicle enters the AGV, the x coordinate of a positioning coordinate point D (x, y) for transporting the AGV is as follows:

Figure BDA0002251839780000091

the y-coordinate of the location coordinate point D (x, y) is:

Figure BDA0002251839780000092

s3.5) the STM32 vehicle-mounted controller calculates the relative position relations △ d and △ theta between the center point of the vehicle body and the center point of the AGV body, namely the distance and the angle to be moved for transporting the AGV.

And S1), the STM32 vehicle-mounted controller and the laser radar realize communication connection through an LWIP protocol stack.

And S2), the settable maximum scanning range of the first laser radar and the second laser radar is-45-225 degrees, the scanning range of the laser radar in practical application can be set according to specific application scenes, and the angular resolution is 0.33 degrees.

16页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:测量装置

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!

技术分类