1.local_planner_behavior.py介绍:
该模块主要逻辑就是基于pid控制建立一个简单的规划
2.代码位置以及引用
代码位于carla.agent.navigation
主要在我发布过的一篇文章里面被引用到:Carla模块介绍之BehaviorAgent类_sea_lichenglin的博客-优快云博客
3.重要代码片段解读
(1)RoadOption(enum)
主要记录自车从一段路到另外一条车道的配置。
class RoadOption(Enum):
"""
RoadOption represents the possible topological configurations
when moving from a segment of lane to other.
"""
(2)LocalPlanner(object):
LocalPlanner实现跟踪轨迹的基本行为,动态生成的航路点。车辆的低水平运动通过使用两个PID控制器进行计算,一个用于横向控制另一个用于纵向控制(巡航速度)。当有多条路径可用时(交叉点)会进行一个随机选择。
class LocalPlanner(object):
"""
LocalPlanner implements the basic behavior of following a trajectory
of waypoints that is generated on-the-fly.
The low-level motion of the vehicle is computed by using two PID controllers,
one is used for the lateral control
and the other for the longitudinal control (cruise speed).
When multiple paths are available (intersections)
this local planner makes a random choice.
"""
(3)def __init__(self, agent):
为LocalPlanner里面的初始化函数,定义了一些参数
def __init__(self, agent):
"""
:param agent: agent that regulates the vehicle
:param vehicle: actor to apply to local planner logi

本文详细介绍Carla中local_planner_behavior.py模块的功能与实现原理,包括基于PID控制的路径跟踪逻辑、关键代码解读及参数设置等内容。
最低0.47元/天 解锁文章
1614





