Disclosure of Invention
In order to overcome the defects in the prior art, the application aims to provide a mobile robot local track planning method and system based on adaptive model predictive control.
In order to achieve the above object of the present application, the present application provides a mobile robot local trajectory planning method based on adaptive model predictive control, comprising the steps of:
establishing a dynamic model of the mobile robot;
establishing a state prediction model of the mobile robot based on the dynamic model to obtain a state space equation and a prediction output equation of the mobile robot;
acquiring a global map and a local map containing obstacles;
determining a global path based on the global map;
constructing an obstacle avoidance function based on the obstacle information of the local map;
constructing an objective function capable of avoiding the motion trail of the obstacle based on the obstacle avoidance function;
and carrying out local track planning on the mobile robot based on the mobile robot state prediction model and the objective function, determining a forward-looking area in real time according to a global path in the planning process, and predicting the adaptive change of a time domain along with the forward-looking area.
The method is beneficial to reducing the uncertainty of the environment and can better predict the future state of the mobile robot.
As an upper preferable scheme of the mobile robot local track planning method based on the adaptive model predictive control: and a repulsive force potential field is introduced, the direction of the repulsive force is taken as the movement direction of the mobile robot, and the mobile robot bypasses the obstacle under the repulsive force action to construct an obstacle avoidance function.
Preferably, the obstacle avoidance function is:
F r for the repulsive force of the obstacle to the controlled object, z is the number of obstacle points, (x) o ,y o ) For moving the robot coordinate position, (x) i ,y i ) For the position coordinates of the obstacle, eta r Is the repulsive force potential energy gain coefficient, D is the Euclidean distance between the mobile robot and the nearest obstacle, D r Is the radius of the obstacle repulsive field when the distance between the vehicle and the obstacle is smaller than D r When the mobile robot receives repulsive forceIs a function of (a) and (b).
This preferred solution helps the mobile robot to avoid obstacles better.
As an upper preferable scheme of the mobile robot local track planning method based on the adaptive model predictive control: when the objective function is constructed, the objective is to predict that the output variable is closest to the reference track, avoid the obstacle and the smoothness of the local track and the speed profile is optimal.
Preferably, the objective function is:
where α is a weight coefficient, ρ is a relaxation factor, Q, R is a weighting matrix of the output error and the control input, ΔU, respectively min 、ΔU max Respectively, the sets of the minimum value and the maximum value of the control increment in the control time domain, k refers to the current moment, k+i refers to the k+i moment, Y refers to the predicted path, Y (k+i|k) refers to the output variable at the k+i moment on the predicted path under the current moment k, Y r For reference path, Y r (k+i|k) denotes the output variable at the k+i-th time on the reference path at the current time k, np denotes the model prediction range, nc denotes the control range, ΔU (k+i|k) denotes the predicted control increment at the k+i-th time at the current time k, F r (k+i|k) refers to the obstacle avoidance function output variable at the k+i time at the current time k.
In the preferred scheme, the first term of the objective function minJ represents that the planned trajectory should be as close as possible to the reference trajectory to ensure the shortest planned trajectory; the second item is to control the increment size so as to ensure that the mobile robot does not have severe changes of speed, course angle and acceleration in the running process, and ensure the stability and comfort of the mobile robot to a certain extent; the third item represents potential energy values of the mobile robot in an obstacle potential field, so that the mobile robot can effectively avoid dynamic obstacles; the fourth term is a relaxation factor that can enhance the solution of the feasible region, thereby ensuring that the planning problem has an optimal solution.
As an upper preferable scheme of the mobile robot local track planning method based on the adaptive model predictive control: the front view area determining step comprises the following steps:
the point of the mobile robot, the position of which is closest to the reference path, is taken as a matching point P m (x m ,y m ) The starting point of the forward looking region is defined by the matching point P m (x m ,y m ) Determining an initial forward looking region l according to the speed of the mobile robot v The initial front view area end point is P v (x v ,y v );
The calculation formula of the initial forward looking region:middle l vmin For the minimum length of the initial forward looking region, l vmax A, b are preset constants for the maximum length of the initial forward looking region, and v is the speed of the mobile robot;
connecting discrete path points in the front area according to the passing sequence of the mobile robot to obtain curve segments, and calculating an initial front vision area l v Is defined by the curvature of:wherein n is the number of broken line segments in the curve segment, the numerical value is determined by the number of discrete path points in the front region, and the included angle between the adjacent broken line segments is as follows:In the middle ofSaid i means the i-th discrete waypoint, ">Velocity vector, x of the i-th discrete waypoint i ,y i The coordinates of the mobile robot at the ith discrete path point; selecting three adjacent discrete path points to calculate curvature:
front view area l d The calculation formula of (2) is as follows:in Kappa min 、Kappa max Respectively the minimum value and the maximum value of the curvature Kappa, lambda and beta are preset constants, l dmin For the final forward viewing area l d Is a minimum of (2).
The lower the speed of the mobile robot, the greater the curvature of the path, the shorter the forward looking region, and conversely the longer the forward looking region. The front view area implicitly reflects the crowdedness of the environment, helping to reduce the uncertainty of the environment.
As an upper preferable scheme of the mobile robot local track planning method based on the adaptive model predictive control: the calculation formula of the adaptive change of the prediction time domain along with the front view area is as follows:l n for the distance between the mobile robot and the matching point, the matching point is the point where the position of the mobile robot is nearest to the reference path, i d For the forward looking region, σ is the scaling factor and T is the sampling time.
In the optimal scheme, the prediction time domain self-adaptive change is adaptive to the change of the current environment and the change of the model motion state, so that the future state is predicted better, the accuracy, the robustness and the reliability of the planning track are improved, and the calculation resources are reduced to a certain extent.
As an upper preferable scheme of the mobile robot local track planning method based on the adaptive model predictive control: when the front view area reaches the end point of the global reference track, the front view area at the moment becomes an area between the matching point and the end point of the global reference track, and the target point of the front view area stops at the end point position of the global reference track. When the mobile robot approaches the end point, the prediction vision self-adaption is reduced, and the calculation efficiency is improved.
As an upper preferable scheme of the mobile robot local track planning method based on the adaptive model predictive control: designing a local planning trigger execution mechanism: and calculating the accumulated error between the predicted track state and the actual state of the mobile robot in the tracking predicted track, entering the next optimization when the accumulated error is higher than a set threshold tau or when the mobile robot tracks to the end point of the predicted track, and updating the predicted track state and the actual state of the mobile robot.
The optimization scheme reduces the frequency of local path re-planning, thereby further reducing the calculation load and improving the real-time performance of local planning.
The application also provides a mobile robot local track planning system based on the adaptive model predictive control, which comprises a positioning and mapping module, a control module and a storage module, wherein the positioning and mapping module is arranged on the mobile robot and is used for acquiring a global map and a local map containing an obstacle, the positioning and mapping module is respectively in communication connection with the control module, the control module is in communication connection with the storage module, the storage module is used for storing at least one executable instruction, and the executable instruction enables the control module to execute the operation corresponding to the mobile robot local track planning method based on the adaptive model predictive control, so that the local track planning of the mobile robot is realized. The mobile robot local track planning system based on the adaptive model predictive control has all the advantages of the mobile robot local track planning method based on the adaptive model predictive control.
The beneficial effects of the application are as follows:
1. according to the method, the crowding of the environment is implicitly reflected through the calculation of the forward-looking area, the uncertainty of the environment is reduced, the adaptive change of the time domain along with the forward-looking area is predicted, the future state is predicted better through adapting to the change of the current environment and the change of the model motion state, the accuracy, the robustness and the reliability of the planning track are improved, and the calculation resources are reduced to a certain extent.
2. The application provides a design local planning trigger execution mechanism, which reduces the frequency of local path re-planning, thereby further reducing the calculation load and improving the real-time performance of local planning.
3. The local track planning scheme provided by the application not only can effectively improve the smoothness, accuracy, stability and safety of the local track, but also can greatly reduce the computing resources and improve the instantaneity of a local planning algorithm.
Additional aspects and advantages of the application will be set forth in part in the description which follows, and in part will be obvious from the description, or may be learned by practice of the application.
Detailed Description
Embodiments of the present application are described in detail below, examples of which are illustrated in the accompanying drawings, wherein like or similar reference numerals refer to like or similar elements or elements having like or similar functions throughout. The embodiments described below by referring to the drawings are illustrative only and are not to be construed as limiting the application.
In the description of the present application, unless otherwise specified and defined, it should be noted that the terms "mounted," "connected," and "coupled" are to be construed broadly, and may be, for example, mechanical or electrical, or may be in communication with each other between two elements, directly or indirectly through intermediaries, as would be understood by those skilled in the art, in view of the specific meaning of the terms described above.
The application provides an embodiment of a mobile robot local track planning method based on adaptive model predictive control, and the whole planning framework is shown in figure 1. The mobile robot navigation space is represented by a global map depicting only static obstacles and a local map containing static, dynamic obstacles. In this embodiment, global and local maps are created by lidar and IMU mounted on the mobile robot as inputs to global and local planning, respectively. Of course, the creation of global and local maps can also be achieved here by installing depth cameras, GNSS, etc. on mobile robots. And constructing an obstacle avoidance function through the obstacle information of the local map, and optimizing the local track of the future time domain based on a model predictive control algorithm of the mobile robot kinematic model. Wherein the prediction time domain of the model predictive control is adaptively changed along with the front view area. The front view area implicitly reflects the crowdedness of the environment, helping to reduce the uncertainty of the environment. The prediction time domain adaptive change is used for adapting to the change of the current environment and the change of the motion state of the model, so that the future state is predicted better. Not only improves the accuracy, robustness and reliability of planning tracks, but also reduces the computing resources to a certain extent.
The following details the present embodiment, specifically including the following steps:
and establishing a dynamic model of the mobile robot. The dynamic model of the mobile robot may be a kinematic model, a point quality model, a dynamic model, or the like, and the present embodiment is described by taking the kinematic model as an example.
The mobile robot is described using a two-degree-of-freedom kinematic model, a simplified motion model of which is shown in fig. 2, where the o-point represents the centroid of the mobile robot, simply assumed to be at the center of the robot. Thus, OXY represents a coordinate system fixed to the mobile robot, and global coordinates are represented by OXY. The o-point pose (x, y, θ) represents the pose of the mobile robot in the global coordinate system, θ represents the attitude angle of the mobile robot, L represents the wheelbase, v represents the current speed of the mobile robot, and δ represents the front wheel yaw angle.
The kinematic model of the mobile robot is as follows:
wherein,,representing the speed of the mobile robot centroid o in the x-direction under the global coordinate system, +.>Representing the velocity of the mobile robot centroid o in the y-direction under the global coordinate system, +.>Indicating yaw rate of mobile robot, +.>Representing the acceleration of the mobile robot centroid.
Since the controlled system in MPC usually adopts a discrete state space model, it is necessary to build a state space expression under a linear discrete time system, where the sampling time is T, and the new state space expression is as follows:
wherein k refers to the kth moment, and k+1 represents the kth+1 moment;
based on a state space model of the future dynamics of the prediction system, rewriting the formula (3) into an incremental model:
wherein the method comprises the steps of
Construction of new state vectors
There is no specific meaning for ζ (k) here, but just a new state vector is constructed.
The new state space expression is
Where η (k) represents the system output,
I c 、I s and respectively representing the identity matrixes with the dimensions of c and s, wherein c is the dimension of the control quantity, and s is the dimension of the state quantity, namely completing the construction of the kinematic model of the mobile robot.
Then, based on the dynamic model, a state prediction model of the mobile robot is established, and a state space equation and a prediction output equation of the mobile robot are obtained, specifically:
the model prediction range is set to Np, and the control range is set to Nc. Assuming that the current time is k, defining an input vector and a predicted output vector of the system in the future time domain by using the current state information:
input vector
Predicting output vectorWherein,,the output vectors at the k+1st, k+2nd, … and k+np th predicted at the current time k are shown.
The prediction output equation in the Np time domain is as follows
Wherein the method comprises the steps of
Acquiring a global map and a local map containing obstacles;
determining a global path based on the global map;
during the running of the mobile robot, an obstacle may be encountered, so that an obstacle avoidance function is constructed based on the obstacle information of the local map. In this embodiment, the obstacle avoidance function is designed by introducing the concept of repulsive potential field in the artificial potential field method. The direction of the repulsive force is taken as the movement direction of the mobile robot, so that the mobile robot can bypass the obstacle under the repulsive force action, and the dynamic obstacle avoidance is realized. Therefore, the obstacle avoidance function is constructed with the aim of bypassing the obstacle by the mobile robot:
F r for the repulsive force of the obstacle to the controlled object, z is the number of obstacle points, (x) o ,y o ) For moving the robot coordinate position, (x) i ,y i ) For the position coordinates of the obstacle, eta r Is the repulsive force potential energy gain coefficient, D is the Euclidean distance between the mobile robot and the nearest obstacle, D r Is the radius of the obstacle repulsive field when the distance between the vehicle and the obstacle is smaller than D r The mobile robot will be affected by the repulsive force at that time. The constructed obstacle avoidance function is shown in figure 3.
And then constructing an objective function capable of avoiding the motion track of the obstacle based on the obstacle avoidance function.
In this embodiment, in order to ensure that the predicted output variable is as close to the reference track as possible, that is, the mobile robot uses the shortest path as possible, and to avoid the obstacle, and to improve the smoothness of the generated local track and speed profile, the objective function of the optimization solution is constructed as follows:
where α is a weight coefficient, ρ is a relaxation factor, Q, R is a weighting matrix of the output error and the control input, ΔU, respectively min 、ΔU max The minimum value and the maximum value of the control increment in the control time domain are respectively provided with a set, k refers to the current moment, k+i refers to the k+i moment, Y is a predicted path, Y (k+i|k) refers to an output variable at the k+i moment on the predicted path under the current moment k, Y r For reference path, Y r (k+i|k) denotes the output variable at the k+i-th time on the reference path at the current time k, np denotes the model prediction range, nc denotes the control range, ΔU (k+i|k) denotes the predicted control increment at the k+i-th time at the current time k, F r (k+i|k) refers to an obstacle avoidance function output variable at the k+i time under the current time k, and the first term of the objective function minJ represents that the planned trajectory should be as close to the reference trajectory as possible so as to ensure the shortest planned trajectory; the second item is to control the increment size so as to ensure that the mobile robot does not have severe changes of speed, course angle and acceleration in the running process, and ensure the stability and comfort of the mobile robot to a certain extent; the third item represents potential energy values of the mobile robot in an obstacle potential field, so that the mobile robot can effectively avoid dynamic obstacles; the fourth term is a relaxation factor that can enhance the solution of the feasible region, thereby ensuring that the planning problem has an optimal solution.
And carrying out local track planning on the mobile robot based on the mobile robot state prediction model and the objective function, determining a forward-looking area in real time according to a global path in the planning process, and predicting the adaptive change of a time domain along with the forward-looking area.
Specifically, a section of forward-looking area is determined on the global path, and factors such as curvature change of the global path and speed change of the mobile robot are comprehensively considered to determine the forward-looking area, so that the prediction time domain adaptively changes along with the forward-looking area.
The front view area is determined by the following steps:
the starting point of the forward looking region is defined by the matching point P m (x m ,y m ) (the nearest point of the position of the mobile robot to the reference path) is determined, first, the initial forward-looking region l is initially determined according to the speed of the mobile robot v The initial front view area end point is P v (x v ,y v ). The faster the speed, the longer the forward viewing area and the shorter the reverse forward viewing area. In summary, the calculation formula of the foresight area is proposed:
wherein, I vmin For the minimum length of the initial forward looking region, l vmax For the maximum length of the initial forward looking region, the two values are preset according to the actual situation, a and b are preset constants, and v is the speed of the mobile robot according to the test determination.
According to the initial forward-looking region l v Is used to determine the final forward viewing area d The larger the curvature, the shorter the forward looking region and the longer the reverse forward looking region. Initial forward looking region l v As shown in fig. 4, the average curvature of its curve segment is calculated as a true value, namely:
initial forward looking region l v Curvature of (2)The curve segment is a segment obtained by connecting discrete path points in the front area according to the passing sequence of the mobile robot, n is the number of broken line segments in the curve segment, and a specific numerical value is determined by the number of discrete path points in the front area, as shown in fig. 5.
The included angle between the adjacent folding line sections on the curve section is
In the middle ofi refers to the i-th discrete path point, < ->Velocity vector, x of the i-th discrete waypoint i ,y i Refers to the coordinates of the mobile robot at the i-th discrete waypoint.
Selecting three adjacent discrete points to calculate curvature:
front view area l d As the curvature Kappa of the reference path changes, propose l d Is calculated according to the formula:
in Kappa min 、Kappa max Respectively the minimum value and the maximum value of the curvature Kappa, and presetting according to actual conditions, wherein lambda and beta are preset constants, and l dmin For the final forward viewing area l d The minimum value of (2) is preset according to the actual situation.
The prediction time domain adaptively changes along with the front view area, and a calculation formula of the prediction time domain along with the front view area is designed as follows:
l n for the distance between the mobile robot and the matching point, sigma is a scaling factor, T is sampling time, and the distance is presetThe time domain is the model prediction range.
Specifically, when the front view region reaches the end point of the global reference track, the front view region at this time becomes a region between the matching point and the global reference track end point, and the target point of the front view region will stop at the global reference track (reference path) end point position. When the mobile robot approaches the end point, the prediction vision self-adaption is reduced, and the calculation efficiency is improved.
Because the model prediction control can perform rolling optimization once in each frame, the local planning can plan the track in each frame, which not only greatly increases the calculation amount, but also causes discontinuous and unsmooth tracking of the mobile robot. In order to further improve the calculation efficiency and enable the mobile robot to smoothly track the track, on the basis of the embodiment, the application provides a preferable scheme: a local programming trigger execution mechanism is designed.
When the mobile robot tracks the planned track, the mobile robot may deviate from the predicted track when executing the control command due to factors such as system modeling error, sensor positioning error, external interference, etc., and the predicted track state is assumed to be at the planning time kRepresenting the predicted output state in the range of Np at the current time k, the actual state of the mobile robot in tracking the predicted trajectory is +.>Indicating the actual traveling state of the mobile robot within the range of Np under the prediction at the current time k, N x Calculating an accumulated error between the mobile robot and the predicted trajectory for the number of time steps actually travelled:
when the accumulated error is higher than the set threshold tau or when the mobile robot tracks to the end point of the predicted trackEnter next optimization and update predicted track stateAnd the mobile robot actual state +.>The aperiodic event triggering mechanism aims to reduce the calculation load and improve the solving efficiency.
The application also provides an embodiment of the mobile robot local track planning system based on the adaptive model predictive control, which comprises a positioning and mapping module, a control module and a storage module, wherein the positioning and mapping module is arranged on the mobile robot and used for acquiring a global map and a local map containing obstacles, the positioning and mapping module is respectively in communication connection with the control module, the control module is in communication connection with the storage module, the storage module is used for storing at least one executable instruction, and the executable instruction enables the control module to execute the operation corresponding to the mobile robot local track planning method based on the adaptive model predictive control, so that the local track planning of the mobile robot is realized. In this embodiment, the positioning and mapping module is preferably but not limited to a lidar and IMU, or a depth camera and GNSS.
In the description of the present specification, a description referring to terms "one embodiment," "some embodiments," "examples," "specific examples," or "some examples," etc., means that a particular feature, structure, material, or characteristic described in connection with the embodiment or example is included in at least one embodiment or example of the present application. In this specification, schematic representations of the above terms do not necessarily refer to the same embodiments or examples. Furthermore, the particular features, structures, materials, or characteristics described may be combined in any suitable manner in any one or more embodiments or examples.
While embodiments of the present application have been shown and described, it will be understood by those of ordinary skill in the art that: many changes, modifications, substitutions and variations may be made to the embodiments without departing from the spirit and principles of the application, the scope of which is defined by the claims and their equivalents.