自动驾驶云服务 OCTOPUS-参数声明(Parameter Declarations):具体场景(Concrete scenario)

时间:2024-10-30 16:07:46

具体场景(Concrete scenario)

具体场景的参数声明支持基础类型标量(scalar)类型枚举(enum)类型,和结构(struct)类型

  • 基础类型包含int、float、bool,和string类型。可以直接在等号后赋值。
  • scalar类型包含speed、acceleration、length、time,和angle类型。赋值时需要在值后加上OSC2.0支持的单位(见附录Scalar units)。
  • enum类型包含side_left_right、distance_direction、distance_mode、 lane_change_side、 dynamics_shape和catalog。赋值时必须使用枚举列表内的值(见附录Enum list) 。
  • struct类型包含odr_point、xyz_point、position_3d、road_point、orientation_3d和pose_3d等,可以使用keep创建。此外,odr_point、xyz_point,和road_point分别可以使用map的成员函数create_odr_point 、 create_xyz_point和create_road_point来创建(OSC2.0支持的struct类型详见附录Struct)。
  • 给bool型赋值时必须使用“true”和“false”,如果使用“True”或“False”或拼写错误将使语句无效。

例1:基础类型

m_road_id: string = '0'
Ego_name: string = "Audi_A3_2009_black"
m_lateral: bool = true

例2:scalar类型

v: speed = 5mps
delay: time = 40s
distance: length = 30.0m
m_a: acceleration = 0.01mpss

例3:enum类型

m_side: side_left_right = right
m_direction: distance_direction = longitudinal

例4:struct类型,keep创建

my_odr: odr_point with:
    keep(it.road_id == 0)
    keep(it.lane_id == -1)
    keep(it.s == 3.0m)
    keep(it.t == 0.0m)

my_pos: position_3d with:
    keep(it.x == 1.0m)
    keep(it.y == 2.0m)
    keep(it.z == 3.0m)

my_xyz: xyz_point with:
    keep(it.position == my_pos)

my_road: road_point with:
    keep(it.road_id == '1')
    keep(it.s == 3.0m)
    keep(it.t == 0.0m)

my_orientation: orientation_3d with:
    keep(it.roll == 1.0rad)
    keep(it.pitch == 2.0rad)
    keep(it.yaw == 3.0rad)

my_pose: pose_3d with:
    keep(it.xyz_point == my_xyz)
    keep(it.orientation == m_orientation)

m_trajectory: trajectory with:
    keep(it.points == [my_pose1, my_pose2, my_pose3])
    keep(it.time_stamps == [0s, 5s, 20s] )

例5:struct类型,map创建

my_odr: odr_point = map.create_odr_point(road_id: m_road_id,lane_id:'-4',s: 5.0m, t: 0.0m) 
my_xyz: xyz_point = map.create_xyz_point(x: 2.5m, y: 10.0m ,z: 0.0m)
my_point: road_point = map.create_road_point(road_id: '1', s: 5.0m, t: 0.0m)
support.huaweicloud.com/usermanual-octopus/octopus-13-0007.html