Main Content

控制器PurePursuit

创建控制器以遵循一组航点

描述

控制器PurePursuit系统对象™ creates a controller object used to make a differential-drive vehicle follow a set of waypoints. The object computes the linear and angular velocities for the vehicle given the current pose. Successive calls to the object with updated poses provide updated velocity commands for the vehicle. Use theMaxAngularVelocityandDesiredlinearlecity根据车辆的性能更新速度的属性。

lookaheaddistanceproperty computes a look-ahead point on the path, which is a local goal for the vehicle. The angular velocity command is computed based on this point. Changinglookaheaddistance对算法的性能有重大影响。较高的距离距离导致车辆的轨迹更平滑,但可能导致车辆沿着路径弯曲。较低的前景距离可能会导致跟踪路径的振荡,从而导致行为不稳定。有关纯追求算法的更多信息,请参阅纯粹的追击控制器

笔记

从R2016b开始,而不是使用执行由系统对象定义的操作的方法,您可以用参数调用对象,就好像它是函数一样。例如,y = step(obj,x)andy = obj(x)执行等效操作。

To compute linear and angular velocity control commands:

  1. 创建控制器PurePursuit对象并设置其属性。

  2. 用参数调用对象,就好像它是一个函数一样。

要了解有关系统对象如何工作的更多信息,请参阅什么是系统对象?

创建

描述

例子

控制器= ControllerPurePursuit创建一个纯粹的追击物体,该对象使用纯粹的追击算法来计算差速器驱动车辆的线性和角速度输入。

控制器= ControllerPurePursuit(Name,Value)creates a pure pursuit object with additional options specified by one or more名称,价值pairs. Name is the property name and Value is the corresponding value. Name must appear inside single quotes ('')。您可以按任何顺序指定几个名称值对参数Name1,Value1,...,NameN,ValueN。未指定的属性保留其默认值。

Example:控制器= controllerpurepursuit('Desiredlinearvelocity',0.5)

特性

展开全部

所需的恒定线性速度,以每秒为单位的标量指定为标量。控制器假设车辆以恒定的线性速度行驶,并且计算的角速度与线性速度无关。

数据类型:双倍的

看距离,,,,specified as a scalar in meters. The look-ahead distance changes the response of the controller. A vehicle with a higher look-ahead distance produces smooth paths but takes larger turns at corners. A vehicle with a smaller look-ahead distance follows the path closely and takes sharp turns, but potentially creating oscillations in the path.

数据类型:双倍的

最大角速度,指定标量为弧度每秒。控制器在给定值处饱和绝对角速度输出。

数据类型:双倍的

Waypoints, specified as ann-by-2阵列[[Xy]对,在哪里n是路点的数量。您可以从Mobilerobotprm课程或其他来源。

数据类型:双倍的

Usage

描述

例子

[[vel,,,,痛苦] = controller(姿势processes the vehicle's position and orientation,姿势,并输出线性速度,vel,,,,and angular velocity,痛苦

[[vel,,,,痛苦,,,,lookaheadpoint] = controller(姿势返回查看点,这是用于计算速度命令的路径上的位置。使用该路径上的该位置使用lookaheaddistanceproperty on the控制器目的。

输入参数

展开全部

车辆的位置和方向,,,,specified as a 3-by-1 vector in the form[x y theta]。车辆姿势是Xandy用角取向θ(以弧度为单位)的位置X-轴。

输出参数

展开全部

Linear velocity, specified as a scalar in meters per second.

数据类型:双倍的

Angular velocity, specified as a scalar in radians per second.

数据类型:双倍的

在小路上的观察点,回到了[[Xy]向量。该值是根据lookaheaddistance财产。

对象功能

要使用对象函数,请将系统对象指定为第一个输入参数。例如,释放名称的系统对象的系统资源OBJ,,,,use this syntax:

发行版(obj)

展开全部

信息 Characteristic information about控制器PurePursuit目的
系统对象算法
发布 释放资源并允许更改系统对象属性值和输入特征
重置 Reset internal states of系统对象

例子

全部收缩

使用信息获取有关A的更多信息的方法控制器PurePursuit目的。这信息function returns two fields,RobotPoseandlookaheadpoint,,,,which correspond to the current position and orientation of the robot and the point on the path used to compute outputs from the last call of the object.

创建一个控制器PurePursuit目的。

pp= ControllerPurePursuit;

Assign waypoints.

pp。Waypoints = [0 0;1 1];

使用pp目的with the initial pose[x y theta]作为输入。

[v,w] = pp([0 0 0]);

Get additional information.

s = info(pp)
s =带有字段的结构:Robotpose:[0 0 0] lookaheadpoint:[0.7071 0.7071]

扩展功能

版本历史记录

在R2019b中引入