Main Content

Cuboid到3D模拟

将演员从长方体坐标转换为3D模拟坐标

  • 图书馆:
  • 自动驾驶工具箱 /驾驶场景和传感器建模

  • Cuboid到3D模拟block

Description

Cuboid到3D模拟block converts a cuboid actor pose in world coordinates to theX,,,,y,,,,and偏航coordinates used by the仿真3D车辆与地面关注堵塞。Use the converted values to set vehicle positions within the 3D simulation environment for actors created using theDriving Scenario Designerapp. The ground terrain of the scene determines the roll (X- 轴旋转),音高(y- 轴旋转)和高程(z车辆的轴位置)。

you can specify a bus containing a single actor pose or multiple actor poses. By default, the block converts the pose of the first actor in the bus. To specify the actor whose pose you want to convert, specify theActorid那个演员。

在长方体和3 d仿真驾驶情况下,coordinate systems are the same, but the origins of vehicles differ. In cuboid driving scenarios, the vehicle origin is on the ground, under the center of the rear axle. The block transforms this origin to the origin used in the 3D simulation environment, which is under the geometric center of the vehicle. The table shows the origin difference between the two environments.

Cuboid车辆起源 3D模拟车辆起源

Cuboid vehicle in blue with origin at the center of the rear axle

3D simulation vehicle in red with origin at the geometric center of the vehicle

Ports

在put

expand all

长方体演员在世界坐标中摆姿势,指定为包含MATLAB结构的Simulink总线。万博1manbetx

要获得此结构输入,请使用方案阅读器block to read actors from a scenario. By default, the方案阅读器阻止自我车辆坐标中的演员。要将这些姿势从自我车辆转换为世界坐标,请使用Vehicle To World堵塞。

该总线中的结构可以包含单个演员姿势或多个演员姿势。

Single-Pose Structure

要指定单个演员姿势,该结构必须包含这些字段。

场地 Description
Actorid

场景定义的参与者标识符,指定为正整数。

Position

演员的位置,被指定为表格的实价矢量[Xyz]。单位为米。

Velocity

速度 (v) of actor in theX-y-, 和z- 指导,指定为表格的实价向量[vXvyvz]。单位为每秒米。

演员的侧角,指定为实值标量。单位为程度。

Pitch

演员的音调角,指定为实值标量。单位为程度。

偏航

演员的偏航角,指定为实值标量。单位为程度。

角速度

角速度 (ω) of actor in theX-,,,,y-, 和z- 指导,指定为表格的实价向量[ωXωyωz]。单位以每秒程度为单位。

Multiple-Pose Structure

要指定多个演员姿势,该结构必须包含这些字段。

场地 Description Type
NumActors Number of actors Nonnegative integer
时间 当前的仿真时间 Real-valued scalar
演员s 演员摆姿势 NumActors-length array of actor pose structures

每个演员在演员s必须有这些字段。

场地 Description
Actorid

场景定义的参与者标识符,指定为正整数。

Position

演员的位置,被指定为表格的实价矢量[Xyz]。单位为米。

Velocity

速度 (v) of actor in theX-y-, 和z- 指导,指定为表格的实价向量[vXvyvz]。单位为每秒米。

演员的侧角,指定为实值标量。单位为程度。

Pitch

演员的音调角,指定为实值标量。单位为程度。

偏航

演员的偏航角,指定为实值标量。单位为程度。

角速度

角速度 (ω) of actor in theX-,,,,y-, 和z- 指导,指定为表格的实价向量[ωXωyωz]。单位以每秒程度为单位。

块仅转换一个姿势演员s大批。要指定要转换的姿势,请选择指定Actor ID,,,,and then specify theActorid通过使用Actoridused for conversion范围。

输出

expand all

演员在3D模拟坐标中的纵向位置,作为数字标量返回。单位为米。

在此坐标系中,当朝着积极方向看X-axis, the positivey-axis points left, and thez- 轴指向。

To specify theX-position of a vehicle in the 3D simulation environment, connect this port to theX输入端口仿真3D车辆与地面关注堵塞。

Lateral position of the actor in 3D simulation coordinates, returned as a numeric scalar. Units are in meters.

在此坐标系中,当朝着积极方向看X-axis, the positivey-axis points left, and thez- 轴指向。

To specify they-position of a vehicle in the 3D simulation environment, connect this port to they输入端口仿真3D车辆与地面关注堵塞。

偏航orientation angle of the actor about thez3D模拟坐标中的轴作为数字标量返回。单位为程度。

在此坐标系中,当朝着积极方向看z-axis, yaw is clockwise-positive. However, if you view the simulation from a 2D top-down perspective, then yaw is counterclockwise-positive, because you are viewing the scene along the negativez-轴。

To specify the yaw orientation angle of a vehicle in the 3D simulation environment, connect this port to the偏航输入端口仿真3D车辆与地面关注堵塞。

参数

expand all

选择此参数以启用Actoridused for conversion参数,您可以指定ActoridCuboid Actor的姿势姿势转换为3D模拟坐标。

If you clear this parameter, then the block converts the first actor pose in the input演员bus.

Actoridvalue of the cuboid actor to convert to 3D simulation coordinates, specified as a positive integer. This parameter must be a validActoridfrom the input演员bus.

依赖性

要启用此参数,请选择指定Actor ID

  • 在terpreted execution- 使用MATLAB解释器模拟模型。此选项缩短启动时间。在在terpreted executionmode, you can debug the source code of the block.

  • Code generation- 使用生成的C/C ++代码模拟模型。首次运行模拟时,Simulink会为该块生成C/C ++代码。万博1manbetx只要模型不更改,就可以重复使用C代码以进行后续模拟。此选项需要额外的启动时间。

扩展功能

C/C++ Code Generation
使用Simulink®Coder™生成C和C ++代码。万博1manbetx

版本历史记录

在R2020a中引入