华为云用户手册

  • 基于样例的拓展 本章的场景样例可以结合第一章介绍的各模块代码样例进行修改和拓展.以straigh场景的osc为例,设定初始位置时,除了使用st坐标系(odr_point,即osc1.0中的LanePosition)还可以使用xyz坐标系(xyz_point,即osc1.0中的WorldPosition)来替代: st坐标系(odr_point)写法: Ego_InitPosition_LaneId: string = ['-1', '-2'] Ego_InitPosition_s: length = [0m..30m] Ego_Odr: odr_point = map.create_odr_point(road_id: '10', lane_id: Ego_InitPosition_LaneId, s: Ego_InitPosition_s, t: 0.0m) Ego_InitPosition: pose_3d with: keep(it.odr_point == Ego_Odr) 对应xyz坐标系(xyz_point)写法,其中y值-1.5m和-4.5m分别对应车道宽度为3m时的'-1'和'-2'车道的中心位置: y: length = [-1.5m, -4.5m] x: length = [0m..30m] Ego_xyz: xyz_point = map.create_xyz_point(x: x, y: y, z: 0.0m) Ego_InitPosition: pose_3d with: keep(it.xyz_point == Ego_xyz) 以上对等替换仅存在于odr_point的road_id固定的情形,当road_id(仿真器A中的TrackId)是一个可泛化的值时,起点可以出现在多条道路上,对应多段x和y值的组合区间,无法使用一个xyz_point直接对等泛化.此时可以使用多个动态场景来实现同等的泛化,例如: 假设地图上存在多条road,且对odr_point的road_id进行了泛化: Ego_InitPosition_Road_id: string = ['10', '1'] Ego_InitPosition_LaneId: string = ['-1', '-2'] Ego_InitPosition_s: length = [0m..30m] Ego_Odr: odr_point = map.create_odr_point(road_id: Ego_InitPosition_Road_id, lane_id: Ego_InitPosition_LaneId, s: Ego_InitPosition_s, t: 0.0m) Ego_InitPosition: pose_3d with: keep(it.odr_point == Ego_Odr) 可以在两个动态场景文件中分别使用一组xyz_point来替代,例如: 第一组对应road_id为'10'的情况(同前例): y: length = [-1.5m, -4.5m] x: length = [0m..30m] Ego_xyz: xyz_point = map.create_xyz_point(x: x, y: y, z: 0.0m) Ego_InitPosition: pose_3d with: keep(it.xyz_point == Ego_xyz) 第二组对应road_id为'1'的情况,该道路与road_id为'10'的道路垂直,x值的101.5m和104.5m分别对应车道宽度为3m时的'-1'和'-2'车道的中心位置: y: length = [-40m..-10m] x: length = [101.5m, 104.5m] Ego_xyz: xyz_point = map.create_xyz_point(x: x, y: y, z: 0.0m) Ego_InitPosition: pose_3d with: keep(it.xyz_point == Ego_xyz) 父主题: 种子地图的逻辑场景样例(仿真器A)
  • 种子地图的逻辑场景样例(仿真器A) 配合静态场景的种子场景,在本节提供了对应的适配仿真器A的逻辑场景样例.同样,考虑到仿真器A的支持程度,建议在转换时选择osc1.0版本. 使用仿真器A打开osc1.0场景时,由于编辑器显示问题,车辆会在道路初始位置重叠,但这不会影响场景运行,运行场景后车辆会从场景文件设置的初始位置开始行驶. straight merge split junction one way junction 基于样例的拓展 父主题: 动静态配套样例
  • ALKS样例 根据官方提供的ALKS样例,提供了一些osc2.0的场景(osc文件)及其适用于仿真器A的转化结果(xosc文件)。考虑到仿真器A的支持程度,建议在转换时选择osc1.0版本. FreeDriving FullyBlockingTarget PartiallyBlockingTarget FollowLeadVehicleEmergencyBrake CutInNoCollision CutInUnavoidableCollision CutOutFullyBlocking CutOutMultipleBlockingTargets ForwardDetectionRange 逻辑场景(以CutOutMultipleBlockingTargets为例) 父主题: 附录 Appendix
  • pose_3d 定义:三维空间的复合位置,包含位置点(odr_point或position_3d或road_point)和方向(orientation_3d)两个参数 用途:设置实体的初始位置(assign_init_speed动作)、目标位置(acquire_position动作) 参数:参数如下表. 表1 pose_3d参数 Parameter Type Mandatory Description xyz_point xyz_point no a pose in space specified in Cartesian (XYZ) coordinates. odr_point odr_point no a point expressed in ASAM OpenDRIVE coordinates. road_point road_point no a point on route network specified in S-T coordinates. orientation orientation_3d no three-dimensional orientation xyz_point、odr_point和road_point必须设置且仅设置一个,用以提供位置信息. orientation非必选项,当不设置orientation时,对应roll、pitch、yaw均为0时的方向 使用xyz_point、设置orientation my_xyz: xyz_point = map.create_xyz_point(x: 150.0m, y: 200.0m ,z: 0.0m) m_orientation: orientation_3d with: keep(it.roll == 0.0rad) keep(it.pitch == 0.0rad) keep(it.yaw == 1.57rad) my_pose: pose_3d with: keep(it.xyz_point == my_xyz) keep(it.orientation == m_orientation) 使用odr_point、不设置orientation my_odr: odr_point = map.create_odr_point(road_id: '1',lane_id:'-2',s: 3.0m, t: 0.0m) my_pose: pose_3d with: keep(it.odr_point == my_odr) 使用road_point、不设置orientation my_road: road_point with keep(it.road_id == '1') keep(it.s == 5.0m) keep(it.t == 0.0m) my_pose: pose_3d with: keep(it.road_point == my_road) 父主题: Struct
  • orientation_3d 定义:由Tait–Bryan角度的三个参数roll(横滚角,围绕x轴的角度)、pitch(俯仰角,围绕y轴的角度)和yaw(偏航角,围绕z轴的角度)定义的三维角度. 用途:设置实体的朝向角度、用于构成pose_3d. 参数:参数如下表. 表1 orientation_3d参数 Parameter Type Mandatory Description roll angle yes rotation angle around the x-axis. pitch angle yes rotation angle around the y-axis. yaw angle yes rotation angle around the z-axis. 根据ISO 8855的定义,角度旋转的顺序是:首先进行yaw(围绕z轴)、接着pitch(围绕新y轴),最后roll(围绕新x轴). 当实体的朝向与road0的方向相同时,无需设置orientation_3d. angle的单位一般为rad(弧度)而非degree(角度),rad = degree*pi/180, 1rad约等于57.3度(详见scalar units中的angle units一节) 与road 0的方向相反(相差180°) m_orientation: orientation_3d with: keep(it.roll == 0.0rad) keep(it.pitch == 0.0rad) keep(it.yaw == 3.14rad) 父主题: Struct
  • odr_point 定义:ASAM OpenDRIVE坐标系中的位置点(point). 用途:设置实体位置,用于构成pose_3d. 参数:参数如下表. 表1 odr_point参数 Parameter Type Mandatory Description road_id string yes ASAM OpenDRIVE identifier for the road lane_id string yes ASAM OpenDRIVE identifier for the lane s length yes Coordinate along the ASAM OpenDRIVE s-axis t length yes Coordinate along the ASAM OpenDRIVE t-axis, the t-coordinate is measured from the lane centerline keep创建 my_odr: odr_point with: keep(it.road_id == '1') keep(it.lane_id == '-2') keep(it.s == 3.0m) keep(it.t == 0.0m) create创建 my_odr: odr_point = map.create_odr_point(road_id: '1',lane_id:'-2',s: 3.0m, t: 0.0m) 父主题: Struct
  • road_point 定义:路网s-t坐标系中的特定位置点(point). 用途:设置实体位置,用于构成pose_3d. 参数:参数如下表. 表1 road_point参数 Parameter Type Mandatory Description road_id string yes identifier for the road in which this point is located s length yes Coordinate along the s-axis of the corresponding road t length yes Coordinate along the t-axis of the corresponding road keep创建 my_road: road_point with keep(it.road_id == '1') keep(it.s == 5.0m) keep(it.t == 0.0m) create创建 my_point: road_point = map.create_road_point(road_id: '1', s: 5.0m, t: 0.0m) 父主题: Struct
  • xyz_point 定义:笛卡尔(XYZ)坐标系中的特定位置点(point). 用途:设置实体位置,用于构成pose_3d. 参数:参数如下表. 表1 xyz_point参数 Parameter Type Mandatory Description position position_3d yes Position in Cartesian (XYZ) coordinates keep创建 my_pos: position_3d with: keep(it.x == 150.0m) keep(it.y == 200.0m) keep(it.z == 0.0m) my_xyz: xyz_point with: keep(it.position == my_pos) create创建 my_xyz: xyz_point = map.create_xyz_point(x: 150.0m, y: 200.0m ,z: 0.0m) 父主题: Struct
  • position_3d 定义:笛卡尔(XYZ)坐标系中的三维位置(position). 用途:设置坐标系中的三维位置,用于构成xyz_point. 参数:参数如下表. 表1 position_3d参数 Parameter Type Mandatory Description x length yes position on the x-axis. y length yes position on the y-axis. z length yes position on the z-axis. 代码样例 my_position: position_3d with: keep(it.x == 150.0m) keep(it.y == 200.0m) keep(it.z == 0.0m) 父主题: Struct
  • catalog 目录catalog可使一些元素得以重复使用,在目录catalog中参数化类型是可维护的,并且可以在场景文件中 被引用仿真器A尚未支持使用catalog. catalog list ENUM_CATA LOG = ("vehicle_catalog", "controller_catalog", "pedestrian_catalog", "misc_object_catalog") vehicle_catalog:场景中可复用的车辆类型列表. controller_catalog:场景中可复用的控制器类型列表. pedestrian_catalog:场景中可复用的行人类型列表. misc_object_catalog:场景中可复用的杂项对象类型列表. 父主题: Enum Lists
  • dynamics_shape 表示给定变量随时间或距离的变化.用于动作change_speed, change_lane. dynamics_shape list ENUM_DYNAMI CS _SHAPE = ("linear", "cubic", "sinusoidal", "step") linear:变化曲线是一个线性linear 函数f(x) = f_0 +变化速率*x. cubic:变化曲线是一个三次变迁Cubical transition 函数f(x)=Ax3+B*x2+Cx+D,约束梯度在开始和结束时必须为零. sinusoidal:变化曲线是一个正弦变迁Sinusoidal transition 函数 f(x)=A*正弦(x)+B,约束梯度在开始和结束时必须为零. step:变化曲线是一个阶段变迁Step transition 函数 父主题: Enum Lists
  • lane_change_side 用于动作change_lane. lane_change_side list ENUM_LANE_CHANGE_SIDE = ("left", "right", "inside", "outside", "same") left:参考实体左侧的车道 right:参考实体右侧的车道 inside:参考实体内侧的车道 outside:参考实体外侧的车道 same:与参考实体相同的车道 父主题: Enum Lists
  • distance_mode 用于触发条件object_distance和point_distance. distance_mode list ENUM_DISTANCE_MODE = ("reference_points", "bounding_boxes") reference_points:测量参考点之间的距离. bounding_boxes:测量边界框之间的距离. 父主题: Enum Lists
  • distance_direction 用于触发条件object_distance和point_distance. distance_direction list ENUM_DISTANCE_DIRECTION = ("longitudinal", "lateral", "euclidianDistance") longitudinal:在x坐标中测量距离.正表示引用位于参考实体的前面. lateral:在y坐标中测量距离.正表示引用位于参考实体的左侧. euclidianDistance:欧氏距离. 父主题: Enum Lists
  • 修饰器 position 用途:设定动作主体actor 所处的车道.可以修饰初始动作assign_init_position . 参数: 表1 position参数 Parameter Type Mandatory Description distance length no A target length value including a length unit. The distance is calculated using the route-based s-coordinate. ahead_of entity no specified by the lane-parameter. behind entity no When behind is specified, the actor must be behind the entity by the specified value. 代码样例 cut_in_vehicle.assign_init_position() with: lane(lane: raletive_lane_id, side_of: ego, side: left) position(distance: 85.0m, behind: ego) 父主题: 修饰器 Modifiers
  • 修饰器 lane 用途:设定动作主体actor 所处的车道.可以修饰初始动作assign_init_position. 参数: 表1 lane参数 Parameter Type Mandatory Description lane int no Relative value of the target lane_id. same_as entity no Option to specify that the vehicle must be in the same lane as the referenced vehicle. side_of entity no Option to specify that the vehicle must be in another lane than the referenced vehicle. side side_left_right no Depending on the value the actor shall be on the right or left side of the referenced entity. How many lanes right or left of that entity is specified by the lane-parameter. offset length no Lateral offset to the target lane. side_of和same_as必须设置且仅设置一个. 使用side_of来设置车道时,必须同时使用lane和side. 使用lane+side_of m_left: side_left_right = left cut_in_vehicle.assign_init_position() with: lane(lane: 1, side_of: Ego, side: m_left) position(distance: 85.0m, behind: ego) 使用same_as m_left: side_left_right = left cut_in_vehicle.assign_init_position() with: lane(same_as: Ego) position(distance: 85.0m, behind: ego) 父主题: 修饰器 Modifiers
  • 修饰器 speed 用途:设定动作主体actor 在当前阶段的速度. 可以修饰初始动作assign_init_speed . 参数: 表1 speed参数 Parameter Type Mandatory Description speed speed no A target speed value, including a speed unit. faster_than entity no set the speed target faster than another entity. slower_than entity no set the speed target slower than another entity. same_as entity no set the speed target same as another entity. faster_than、slower_than和same_as必须设置且仅设置一个. 使用faster_than和slower_than时配合speed来设置相对速度. 使用speed+faster_than cut_in_vehicle.assign_init_speed() with: speed(speed: 5mps, faster_than: Ego) 使用speed+slower_than cut_in_vehicle.assign_init_speed() with: speed(speed: 5mps, slower_than: Ego) 使用same_as cut_in_vehicle.assign_init_speed() with: speed(same_as: Ego) 父主题: 修饰器 Modifiers
  • 动作 acquire_position 动作主体:车辆vehicle或行人pedestrian 结束时间:当动作主体actor 获取目标位置position 时,动作结束. 是否支持modifier:否 参数表: 参数如下表,pose_3d是point和orientation的组合结构, point可以使用xyz_point或 odr_point或road_point中的任意一个,orientation非必选项. 表1 acquire_position参数 Parameter Type Mandatory Description target pose_3d yes target position. acquire_position与acquire_position_init的使用方法相同,但由于不是初始动作,可以设置触发条件. 仿真器A对于acquire_position_init的支持程度更好,如无需设置触发条件,建议使用acquire_position_init. 仿真器B尚未支持acquire_position动作. 代码样例见acquire_position_init. 父主题: 动作 Actions
  • 动作 lane_offset 动作主体:车辆vehicle 结束时间:当动作主体actor 到达目标偏移offset 处时,动作结束. 是否支持modifier:否 参数:参数如下表,支持位置参数和关键字参数.参数target 非必选项,不设置target 时采用绝对偏移,设置target 时采用相对偏移. 表1 lane_offset参数 Parameter Type Mandatory Description offset length yes Signed number in meters the vehicle should respect as an offset from the center of the current lane. rate_peak speed yes Target value for the peak lateral velocity that must be achieved during the action. dynamics_shape dynamics_shape yes Geometrical shape of the LaneOffsetAction's dynamics. target entity no Reference entity. offset值不能超出当前所在lane的宽度范围. 绝对偏移 m_shape: dynamics_shape = step Ego.lane_offset(0.8m, 0.5mps, m_shape) 相对偏移 m_shape: dynamics_shape = linear side_vehicle.lane_offset(offset:1.0m, rate_peak: 1.5mps, dynamics_shape:m_shape, target: Ego) 父主题: 动作 Actions
  • 动作 activate_controller 动作主体:车辆vehicle 结束时间:激活或停用控制器controller后,动作结束. 是否支持modifier:否 参数:参数如下表,支持位置参数和关键字参数. 表1 activate_controller参数 Parameter Type Mandatory Description lateral bool yes In lateral domain: Activate or deactivate controller defined (e.g. automated, autonomous) behavior. longitudinal bool yes In longitudinal domain: Activate or deactivate autonomous behavior. 代码样例: Ego.activate_controller(lateral:true, longitudinal:true) 父主题: 动作 Actions
  • 动作 change_lane 动作主体:车辆vehicle 结束时间:当动作主体actor 位于目标车道lane 中、目标偏移offset 处时,动作结束. 是否支持modifier:否 参数:参数如下表,支持关键字参数. rate_peak 和rate_profile 是必选项,用于设置osc1中的dynamics . target 和reference 必须设置且只设置其中之一,前者用于指定绝对车道,后者用于指定相对车道. 表1 change_lane参数 Parameter Type Mandatory Description number_of_lanes uint no The target lane is "num_of_lanes" to the side of the reference entity. Use in conjunction with "side". side lane_change_side no Select on which side of the reference entity. reference entity no Default=it.actor. Reference to the entity that is used to determine the target lane. If this argument is omitted, the actor itself is used as reference. offset length no Default=0.0. Target offset from center of the target lane that the actor follows at the end of the action. rate_profile dynamics_shape yes Assign a shape for the change of the lateral position variable (t-axis). This profile affects the lateral velocity during action execution. rate_peak speed yes Target value for the peak lateral velocity that must be achieved during the action. target lane_id(uint) no The actor starts and finishes the action in the target lane. 目标lane必须在地图上。 中心线左侧的lane_id为正,如'1','2'.右侧的lane_id为负,如'-1','-3'.绝对值越大,距离中心线越远。 offset值不能超出当前所在lane的宽度范围。 使用相对位置时,参考对象reference必须是车辆,否则仿真器A无法支持。 rate_profile只能选择linear或step。 绝对车道1 my_lane: lane with: keep(it.lane_id == '1') m_profile: dynamics_shape = linear side_vehicle.change_lane(target: my_lane, rate_profile: m_profile, rate_peak: 0.3mps) 绝对车道2 my_lane: lane with: keep(it.lane_id == '-1') m_profile: dynamics_shape = linear side_vehicle.change_lane(target: my_lane, offset: -0.2m, rate_profile: m_profile, rate_peak: 0.4mps) 相对车道1 m_profile: dynamics_shape = step m_side: lane_change_side = left m_profile: dynamics_shape = step Ego.change_lane(number_of_lanes: 2, side: m_side, reference: side_vehicle, offset: 0.8m, rate_profile: m_profile, rate_peak: 0.3mps) 相对车道2 m_profile: dynamics_shape = step m_side: lane_change_side = same m_profile: dynamics_shape = step Ego.change_lane(number_of_lanes: 1, reference: side_vehicle, side:m_side, rate_profile: m_profile, rate_peak: 0.3mps) 父主题: 动作 Actions
  • 动作 change_speed 动作主体:车辆vehicle 或行人pedestrian . 结束时间:当动作主体actor 达到目标速度target ,动作结束 是否支持modifier:否 参数:参数如下表,支持位置参数和关键字参数. 表1 change_speed参数 Parameter Type Mandatory Description reference entity no Default=it.actor. Reference to the entity that is used to determine the target speed. If this argument is omitted, the actor itself is used as reference. target speed yes Target value for the speed at the end of the action. rate_profile dynamics_shape yes Assign a shape for the change of the speed variable. This profile affects the acceleration during action execution. rate_peak acceleration yes Target value for the peak acceleration that must be achieved during the action. 目标速度不能超出所在道路的限速值. 当rate_profile为step时,瞬间达到目标速度,不会受到rate_peak值的影响 样例 m_profile: dynamics_shape = sinusoidal Ego.change_speed(reference: lead_vehicle, target: -5.0mps, rate_profile: m_profile, rate_peak: 2mpss) 父主题: 动作 Actions
  • 初始动作 acquire_position_init 动作主体:车辆vehicle或行人pedestrian 结束时间:当动作主体actor 获取目标位置position 时,动作结束. 是否支持modifier:否 参数表: 参数如下表,pose_3d是point和orientation的组合结构, point可以使用xyz_point或 odr_point或road_point中的任意一个,orientation非必选项. 表1 acquire_position_init参数 Parameter Type Mandatory Description target pose_3d yes target position. 目标位置必须在地图设定的道路上,且是可达的. xyz_point,有方向要求 m_x: length = 0.0m m_xyz: xyz_point = map.create_xyz_point(x: m_x, y: 10.0m ,z: 0.0m) m_heading: angle = 1.57rad m_orientation: orientation_3d with: keep(it.roll == 0.0rad) keep(it.pitch == 0.0rad) keep(it.yaw == m_heading) m_position: pose_3d with: keep(it.xyz_point == m_xyz) keep(it.orientation == m_orientation) Ego.acquire_position_init(target: m_position) odr_point,无方向要求 m_odr: odr_point = map.create_odr_point(road_id: '0', lane_id: '-4', s: 5.0m, t: 0.0m) m_position: pose_3d with: keep(it.odr_point == m_odr) Ego.acquire_position_init(target: m_position) road_point,无方向要求 m_road: road_point = map.create_road_point(road_id: '0', s: 5.0m, t: 0.0m) m_position: pose_3d with: keep(it.road_point == m_road) Ego.acquire_position_init(target: m_position) 父主题: 动作 Actions
  • 初始动作 assign_init_position 动作主体:车辆vehicle 或行人pedestrian . 结束时间:当动作主体actor 到达指定的位置坐标时,动作结束. 是否支持modifier:是 参数:参数如下表. 表1 assign_init_position参数 Parameter Type Mandatory Description position pose_3d no Desired position assigned by the user. assign_init_position支持设置绝对位置和相对位置,设置相对位置时使用 修饰器position和修饰器lane来给出相对值. 当初始位置需要车辆转换朝向时,通过设置pose_3d的orientation来设定朝向,以与所在车道朝向一致,例如车辆所在车道和road0呈90°夹角时,设置orientation的yaw为1.57rad,否则车辆启动后会有转向行为,影响场景的正常执行. 设置初始位置时所采用的地图元素必须是对应的地图中有的元素,比如设置绝对位置create_odr_point('0', '-4', 5.0m, 0.0m)时,地图上必须有id为'0'的road,该road上必须有lane_id为 '-4'的lane,该lane至少有5.0m以上的长度.如果设置的初始位置找不到地图中的对应元素,将泛化出无效的场景. 绝对位置 m_odr: odr_point = map.create_odr_point('0', '-4', 5.0m, 0.0m) m_orientation: orientation_3d with: keep(it.roll == 0.0rad) keep(it.pitch == 0.0rad) keep(it.yaw == 1.57rad) init_position: pose_3d with: keep(it.odr_point == m_odr) keep(it.orientation == m_orientation) Ego.assign_init_position(position: init_position) 相对位置 cut_in_vehicle.assign_init_position() with: lane(lane: raletive_lane_id, side_of: Ego, side: left) position(distance: 85.0m, behind: Ego) 父主题: 动作 Actions
  • 初始动作 assign_init_speed 动作主体:车辆vehicle 或行人pedestrian . 结束时间:当动作主体actor 达到指定的速度speed 时,动作结束. 是否支持modifier:是 参数:参数如下表. 表1 assign_init_speed参数 Parameter Type Mandatory Description target speed yes Desired (scalar) speed assigned by the user. assign_init_speed支持设置绝对速度和相对速度,设置相对速度时使用 修饰器speed来给出相对值. 设置初始速度时,初始速度不能超过该主体所在道路的限速. 如果所需场景起始速度为0,无需使用assign_init_speed动作. 绝对速度 init_speed: speed = 10.0mps Ego.assign_init_speed(init_speed) 相对速度 cut_in_vehicle.assign_init_speed() with: speed(speed: 5mps, faster_than: Ego) 父主题: 动作 Actions
  • 触发器与触发条件 Trigger and condition 用户可以使用wait+触发条件的方式来设置动作的触发条件condition ,可以使用的触发条件有: elapsed 、 object_distance、 point_distance 、time_to_collision、 time_headway 、 speed ,和acceleration . 如果不满足等待时长或触发条件,后续动作将无法执行. 使用wait来设定触发条件condition时,必须在serial:下执行,否则wait无效. 触发条件 elapsed 触发条件 object_distance 触发条件 point_distance 触发条件 time_to_collision 触发条件 time_headway 触发条件 speed 触发条件 acceleration 父主题: 代码样例 Code Examples
  • 执行顺序 Execution sequence OSC2.0场景剧本StoryBoard 通过执行顺序Execution Sequence 和触发器Trigger 来支持用户 设计各种场景.StoryBoard 中有parallel 和serial 两种执行指令,最外层执行指令之前需要加上do 来 使场景剧本生效.其中: parallel :同步执行下方代码块内的动作action . serial :依次执行下方代码块内的动作act . 例如下方样例中, do parallel: 下的assign_init_speed , assign_init_position 和wait elapsed(10s) 是同步执行的.而serial: 下的lead_vehicle.change_speed 在Ego.activate_controller 完成之后执行. 由于初始动作InitAction内的action同步执行,且InitAction与story之间不涉及顺序 执行,建议场景最外层统一使用parallel. 样例 m_profile: dynamics_shape = linear do parallel: # InitAction Ego.assign_init_speed(15mps) Ego.assign_init_position(position: Ego_InitPosition) # Story serial: # act1 Ego.activate_controller(true, true) lead_vehicle.change_speed(target: 20mps, rate_profile: m_profile, rate_peak: 0.3mpss) serial: # act2 wait elapsed(10s) lead_vehicle.activate_controller(true, true) 父主题: 场景剧本 StoryBoard
  • 行人 Pedestrian 通过 行人名: person 的方式来为行人命名.通过 keep(it.name == 指定行人名称) 的方式来指定行人 类型.通过 keep(it. model == 指定行人特征) 的方式来指定行人的性别、年龄特征.行人的name 和 model 同样只能使用仿真器A自带的类型. 样例 Dude: person with: keep(it.name == "Christian") keep(it.model == "male_adult") 父主题: 实体设置 Entities
  • 车辆和控制器 Vehicle and controller 通过 车辆名: vehicle 的方式来为车辆命名.通过 keep(it.name == 指定车型名称) 的方式来指定车辆类型.通过 keep(it.initial_bm == 指定controller名称) 的方式来指定controller类型,目前均只能支持仿真器A或仿真器B内置的车辆和controller类型.生成文件会自动适配车辆信息. name, initial_bm等车辆属性需要在仿真器的catalog列表中定义,不同仿真器的预定义的catalog内容有所不同,需要在撰写场景文件时确认使用的车型、controller名称在仿真器catalog中已经存在. name为必选项,initial_bm非必选项. 主车必须命名为Ego,否则仿真器A/仿真器B将无法识别. 例1(仿真器A):主车,指定initial_bm Ego_name: string = "Audi_A3_2009_black" Ego_controller: string = "DefaultDriver" Ego: vehicle with: keep(it.name == Ego_name) keep(it.initial_bm == Ego_controller) 例2(仿真器A):非主车,不指定initial_bm cut_in_vehicle: vehicle with: keep(it.name == "Audi_A3_2009_red") 例3(仿真器B):主车,指定initial_bm cut_in_vehicle: vehicle with: keep(it.name == "Saimo") keep(it.initial_bm == "默认驾驶员") 例4(仿真器B):非主车,不指定initial_bm cut_in_vehicle: vehicle with: keep(it.name == "Saimo") 父主题: 实体设置 Entities
  • 逻辑场景 Logical scenario 逻辑场景的参数声明通过:范围型[最小值..最大值] 和枚举型[值1, 值2] 的方式来实现泛化: 范围型支持float和scalar类型 枚举型支持int, float, bool, str, enum和scalar类型,且需要保证枚举列表中的元素均为相同类型. 例1:范围型 m_value: float = [2.0..3.0] v: speed = [5mps..10mps] delay: time = [40s..60s] m_a: acceleration = [0.00mpss..0.03mpss] 例2:枚举型 m_ id: int = [-1, 2] m_value: float = [2.0, 3.0] m_on_road: bool = [true, false] Ego_name: string = ["Audi_A3_2009_black", "Audi_A3_2009_red"] m_shape: dynamics_shape = [linear, sinusoidal] m_side: side_left_right = [left, right] v: speed = [5mps, 7mps, 10mps] m_a: acceleration = [0.01mpss, 0.03mpss] delay: time = [40s, 60s, 100s] 通过泛化参数,可以实现实体entity 、动作act ,以及修饰器modifier 的泛化. Struct类型不能直接泛化,而是通过泛化参数来进行泛化. 例1:entity泛化 Ego_name: string = ["Audi_A3_2009_black", "Audi_A3_2009_red"] Ego_controller: string = "DefaultDriver" Ego: vehicle with: keep(it.name == Ego_name) keep(it.initial_bm == Ego_controller) 例2:act泛化 m_lateral: bool = [true, false] m_speed: speed = [5mps..15mps] m_rate_profile: dynamics_shape = linear Ego.activate_controller(m_lateral, true) Ego.change_speed(target: m_speed, rate_peak: 0.0mpss, rate_profile: m_rate_profile) 例3:modifier泛化 m_speed: speed = [5mps..15mps] Ego.assign_init_speed() with: speed(speed: m_speed) 例4:Struct类型泛化 m_lane_id: int = [-1, 2] m_odr: odr_point = map.create_odr_point(road_id: '0', lane_id:m_lane_id, s: 5.0m, t: 0.0m) m_x: distance = [2m..7.5m] m_position_3d: position_3d = map.create_xyz_point(x: m_x, y: 10.0m ,z: 0.0m) m_pose_3d: pose_3d with: keep(it.odr_point == m_odr) 父主题: 参数声明 Parameter Declarations
共100000条