drivingScenario实例

roadCenters = [-150, -150; 150,150; -150, 150; 150, -150; -150, -150]

添加道路:道路上有中心点、车道(车道规格、车道宽)road(scenario, roadCenters, 'Lanes', lanespec([4, 4]))

绘制场景(及其道路中心点、中心线、路由点)plot(scenario, 'RoadCenters', 'on', 'Centerline', 'on',  'Waypoints', 'on')

道路边界 roadBoundaries = roadBoundaries(scenario)

trajectory(vehicle, waypoints, speed)

1.1

绘制场景(及其道路中心点、中心线、路由点)plot(scenario, 'RoadCenters', 'on', 'Centerline', 'on',  'Waypoints', 'on')

scenario = drivingScenario;

设置道路中心

>> roadCenters = [-150, -150; 150,150; -150, 150; 150, -150; -150, -150]

>> road(scenario, roadCenters)
>> plot(scenario)
>> plot(scenario, 'Centerline', 'on')
>> plot(scenario, 'RoadCenters', 'on')
>> plot(scenario, 'Centerline', 'on', 'RoadCenters', 'on')

1.2

添加道路:道路上有中心点、车道(车道规格、车道宽)

road(scenario, roadCenters, 'Lanes', lanespec([4, 4]))

1.3

添加车辆

car = vehicle(scenario, 'ClassID', 1, 'Position', [1, 1.8, 0])

car = 

  Vehicle - 属性:

               ActorID: 1
               ClassID: 1
             PlotColor: [0 0.4470 0.7410]
              Position: [1 1.8000 0]
              Velocity: [0 0 0]
                   Yaw: 0
                 Pitch: 0
                  Roll: 0
       AngularVelocity: [0 0 0]
                Length: 4.7000
                 Width: 1.8000
                Height: 1.4000
                  Mesh: [1×1 extendedObjectMesh]
            RCSPattern: [2×2 double]
      RCSAzimuthAngles: [-180 180]
    RCSElevationAngles: [-90 90]
         FrontOverhang: 0.9000
          RearOverhang: 1
             Wheelbase: 2.8000

1.4

有路由点和车速,就可以记录车辆轨迹

trajectory(vehicle, waypoints, speed)

while advance(scenario)

    pause(0.1)

end

  • 0
    点赞
  • 4
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值