Simulation 3D Motorcycle
Implement motorcycle in 3D environment
- Library:
Vehicle Dynamics Blockset / Vehicle Scenarios / Sim3D / Sim3D Vehicle / Components
Description
TheSimulation 3D Motorcycleblock implements a motorcycle with two wheels in the 3D simulation environment.
To use this block, ensure that theSimulation 3D Scene Configurationblock is in your model. If you set theSample timeparameter of this block to-1
, the block uses the sample time specified in theSimulation 3D Scene Configurationblock.
The block input uses the vehicle Z-downright-handed(RH)Cartesiancoordinate system defined in SAE J6701. The coordinate system is inertial and initially aligned with the vehicle geometric center:
X-axis — Along vehicle longitudinal axis, points forward
Y-axis — Along vehicle lateral axis, points to the right
Z-axis — Points downward
Tip
Verify that theSimulation 3D Motorcycleblock executes before theSimulation 3D Scene Configurationblock. That way,Simulation 3D Motorcycleprepares the signal data before the Unreal Engine®3D visualization environment receives it. To check the block execution order, right-click each block and selectProperties. On theGeneraltab, confirm thesePrioritysettings:
Simulation 3D Scene Configuration—
0
Simulation 3D Motorcycle—
-1
For more information about execution order, seeControl and Display Execution Order.
Ports
Input
Translation
— Motorcycle translation
5
-by-3
array
Motorcycle and component translation, in m. Array dimensions are5
-by-3
.
Translation(1,1)
,Translation(1,2)
, and翻译(1、3)
— Motorcycle translation along the inertial vehicle Z-downX-,Y-, andZ- axes, respectively.Translation(...,1)
,Translation(...,2)
, andTranslation(...,3)
— Motorcycle component translation relative to vehicle, along the vehicle Z-downX-,Y-, andZ- axes, respectively.
“社会党国际”gnal contains translation information according to the locations.
Translation | Array Element | Translation Axis |
---|---|---|
Motorcycle,Xv |
Translation(1,1) |
Inertial vehicle Z-downX-axis |
Motorcycle,Yv |
Translation(1,2) |
Inertial vehicle Z-downY-axis |
Motorcycle,Zv |
翻译(1、3) |
Inertial vehicle Z-downZ-axis |
Handlebars,XH |
Translation(2,1) |
Vehicle Z-downX-axis |
Handlebars,YH |
Translation(2,2) |
Vehicle Z-downY-axis |
Handlebars,ZH |
Translation(2,3) |
Vehicle Z-downZ-axis |
Swing arm,XSA |
Translation(3,1) |
Vehicle Z-downX-axis |
Swing arm,YSA |
Translation(3,2) |
Vehicle Z-downY-axis |
Swing arm,ZSA |
Translation(3,3) |
Vehicle Z-downZ-axis |
Front wheel,XF |
Translation(4,1) |
Vehicle Z-downX-axis |
Front wheel,YF |
Translation(4,2) |
Vehicle Z-downY-axis |
Front wheel,ZF |
Translation(4,3) |
Vehicle Z-downZ-axis |
Rear wheel,XR |
Translation(5,1) |
Vehicle Z-downX-axis |
Rear wheel,YR |
Translation(5,2) |
Vehicle Z-downY-axis |
Rear wheel,ZR |
Translation(5,3) |
Vehicle Z-downZ-axis |
Rotation
— Motorcycle rotation
5
-by-3
array
Vehicle and component rotation, in rad. Array dimensions are5
-by-3
.
Rotation(1,1)
,Rotation(1,2)
, andRotation(1,3)
— Motorcycle rotation about the inertial vehicle Z-downX-,Y-, andZ- axes, respectively.Rotation(...,1)
,Rotation(...,2)
, andRotation(...,3)
— Motorcycle component rotation relative to vehicle, about the vehicle Z-downX-,Y-, andZ- axes, respectively.
“社会党国际”gnal contains rotation information according to the locations.
Rotation | Array Element | Rotation Axis |
---|---|---|
Vehicle,Rollv |
Rotation(1,1) |
Inertial vehicle Z-downX-axis |
Vehicle,Pitchv |
Rotation(1,2) |
Inertial vehicle Z-downY-axis |
Vehicle,Yawv |
Rotation(1,3) |
Inertial vehicle Z-downZ-axis |
Handlebar,RollH |
Rotation(2,1) |
Vehicle Z-downX-axis |
Handlebar,PitchH |
Rotation(2,2) |
Vehicle Z-downY-axis |
Handlebar,YawH |
Rotation(2,3) |
Vehicle Z-downZ-axis |
Swing arm,RollSA |
Rotation(3,1) |
Vehicle Z-downX-axis |
Swing arm,PitchSA |
Rotation(3,2) |
Vehicle Z-downY-axis |
Swing arm,YawSA |
Rotation(3,3) |
Vehicle Z-downZ-axis |
Front wheel,RollF |
Rotation(4,1) |
Vehicle Z-downX-axis |
Front wheel,PitchF |
Rotation(4,2) |
Vehicle Z-downY-axis |
Front wheel,YawF |
Rotation(4,3) |
Vehicle Z-downZ-axis |
Rear wheel,RollR |
Rotation(5,1) |
Vehicle Z-downX-axis |
Rear wheel,PitchR |
Rotation(5,2) |
Vehicle Z-downY-axis |
Rear wheel,YawR |
Rotation(5,3) |
Vehicle Z-downZ-axis |
Light controls
——汽车灯打开或关闭
1-by-5 vector
Light controls input signal, specified as a 1-by-5 Boolean vector. Each element of the vector turns a specific vehicle light on or off, as indicated in this table. A value of 1 turns the light on; a value of 0 turns the light off
Vector Element | Vehicle Light |
---|---|
(1,1) |
Headlight high beam |
(1,2) |
Headlight low beam |
(1,3) |
Brake |
(1,4) |
Left signal |
(1,5) |
Right signal |
Dependencies
To create this port, on theLight Controlstab, selectEnable light controls.
Data Types:Boolean
Parameters
Vehicle Parameters
Type
— Type
Sports bike
(default) |Motor bike
|Scooter
Use theTypeparameter to specify the motorcycle type. This table provides links to the motorcycle dimensions.
Vehicle TypeSetting | Vehicle Dimensions |
---|---|
Sports bike |
|
Motor bike |
|
Scooter |
Color
— Color of vehicle
Red
(default) |Orange
|Yellow
|Green
|Blue
|Black
|White
|Silver
Select the color of the vehicle.
Name
— Name of motorcycle
SimulinkVehicle1
(default) | character vector
Name of motorcycle. By default, when you use the block in your model, the block sets theNameparameter toSimulinkVehicle
. The value ofX
depends on the number of 3D simulation blocks that you have in your model.X
Sample time
— Sample time
-1
(default) |标量
Sample time,Ts. The graphics frame rate is the inverse of the sample time.
Light Controls
Enable light controls, VehLightsControl
— Control vehicle lights
off
(default) |on
Select whether to control the vehicle headlights. Use the enabled parameters to set the light parameters, including headlight intensity.
Dependencies
Selecting this parameter:
Creates the input port
Light controls
Enables these light parameters.
Lights Light Parameters Headlights Headlight color
High beam intensity
Low beam intensity
High beam cone half angle
Low beam cone half angle
Left headlight beam orientation
Right headlight beam orientation
Brake lights Brake light intensity
Turn signal lights Turn signal light intensity
Period
Pulse width
Headlight color [R,G,B], HeadlightColor
— Headlight color
[1,1,1]
(default) | 1-by-3 vector of RGB triplet values
Headlight color, specified as a normalized 1-by-3 vector of RGB triplet values.
Dependencies
To enable this parameter, selectEnable light controls.
Data Types:int8
|uint8
High beam intensity, HighBeamIntensity
— High beam intensity
100000
(default) | positive scalar
High beam intensity, in cd.
Dependencies
To enable this parameter, selectEnable light controls.
Data Types:double
Low beam intensity, LowBeamIntensity
— Low beam intensity
60000
(default) | positive scalar
Low beam intensity, in cd.
Dependencies
To enable this parameter, selectEnable light controls.
Data Types:double
High beam cone half angle, HighBeamConeAngle
— High beam cone half angle
1.22
(default) | positive scalar less than pi/2
High beam cone half angle, in rad.
Dependencies
To enable this parameter, selectEnable light controls.
Data Types:double
Low beam cone half angle, LowBeamConeAngle
— Low beam cone half angle
1.22
(default) | positive scalar less than pi/2
Low beam cone half angle, in rad.
Dependencies
To enable this parameter, selectEnable light controls.
Data Types:double
Left headlight beam orientation [Pitch, Yaw], LeftHeadlightOrientation
— Left headlight beam orientation
[0,0]
(default) | 1-by-2 vector greater with values between -pi and pi
Pitch and yaw orientation of the left headlight beam orientation in theZ-down coordinate system, specified as a 1-by-2 vector, in rad. The first element of the vector,[1,1]
, is the pitch angle. The second element of the vector,[1,2]
is the yaw angle.
Dependencies
To enable this parameter, selectEnable light controls.
Data Types:double
Right headlight beam orientation [Pitch, Yaw], RightHeadlightOrientation
— Right headlight beam orientation
[0,0]
(default) | 1-by-2 vector greater with values between -pi and pi
Pitch and yaw orientation of the right headlight beam orientation in theZ-down coordinate system, specified as a 1-by-2 vector, in rad. The first element of the vector,[1,1]
, is the pitch angle. The second element of the vector,[1,2]
is the yaw angle.
Dependencies
To enable this parameter, selectEnable light controls.
Brake light intensity, BrakelightIntensity
— Intensity
500
(default) | positive scalar
Brake light intensity, in cd/m^2.
Dependencies
To enable this parameter, selectEnable light controls.
Data Types:double
Turn signal light intensity, SignallightIntensity
— Intensity
500
(default) | positive scalar
Turn signal light intensity, in cd/m^2.
Dependencies
To enable this parameter, selectEnable light controls.
Data Types:double
Period, SignallightPeriod
— Turn signal light period
1
(default) | positive scalar
Turn signal light period, in s.
Dependencies
To enable this parameter, selectEnable light controls.
Data Types:double
Pulse width, SignalPulseWidth
— Pulse width
50
(default) | positive scalar less than 100
Turn signal light pulse width, as a percent of the period.
Dependencies
To enable this parameter, selectEnable light controls.
Data Types:double
Initial Values
Initial array values to translate vehicle per part, Translation
— Motorcycle initial translation
zeros( 3, 3 ) (default) |3
-by-3
array
最初的摩托车和组件的翻译,在m. Array dimensions are5
-by-3
.
Translation(1,1)
,Translation(1,2)
, and翻译(1、3)
— Initial vehicle translation along the inertial vehicle Z-down coordinate systemX-,Y-, andZ- axes, respectively.Translation(...,1)
,Translation(...,2)
, andTranslation(...,3)
— Initial motorcycle component translation relative to vehicle, along the vehicle Z-downX-,Y-, andZ- axes, respectively.
The parameter contains translation information according to the locations.
Translation | Array Element | Translation Axis |
---|---|---|
Motorcycle,Xv |
Translation(1,1) |
Inertial vehicle Z-downX-axis |
Motorcycle,Yv |
Translation(1,2) |
Inertial vehicle Z-downY-axis |
Motorcycle,Zv |
翻译(1、3) |
Inertial vehicle Z-downZ-axis |
Handlebars,XH |
Translation(2,1) |
Vehicle Z-downX-axis |
Handlebars,YH |
Translation(2,2) |
Vehicle Z-downY-axis |
Handlebars,ZH |
Translation(2,3) |
Vehicle Z-downZ-axis |
Swing arm,XSA |
Translation(3,1) |
Vehicle Z-downX-axis |
Swing arm,YSA |
Translation(3,2) |
Vehicle Z-downY-axis |
Swing arm,ZSA |
Translation(3,3) |
Vehicle Z-downZ-axis |
Front wheel,XF |
Translation(4,1) |
Vehicle Z-downX-axis |
Front wheel,YF |
Translation(4,2) |
Vehicle Z-downY-axis |
Front wheel,ZF |
Translation(4,3) |
Vehicle Z-downZ-axis |
Rear wheel,XR |
Translation(5,1) |
Vehicle Z-downX-axis |
Rear wheel,YR |
Translation(5,2) |
Vehicle Z-downY-axis |
Rear wheel,ZR |
Translation(5,3) |
Vehicle Z-downZ-axis |
Initial array values to rotate vehicle per part, Rotation
— Motorcycle initial rotation
zeros( 5, 3 ) (default) |5
-by-3
array
Initial motorcycle and component rotation, about the vehicle Z-downX-,Y-, andZ- axes.
Array dimensions are5
-by-3
.
Rotation(1,1)
,Rotation(1,2)
, andRotation(1,3)
— Initial motorcycle rotation about the inertial vehicle Z-down coordinate systemX-,Y-, andZ- axes, respectively.Rotation(...,1)
,Rotation(...,2)
, andRotation(...,3)
— Initial motorcycle component rotation relative to vehicle, about the vehicle Z-downX-,Y-, andZ- axes, respectively.
The parameter contains rotation information according to the location.
Rotation | Array Element | Rotation Axis |
---|---|---|
Vehicle,Rollv |
Rotation(1,1) |
Inertial vehicle Z-downX-axis |
Vehicle,Pitchv |
Rotation(1,2) |
Inertial vehicle Z-downY-axis |
Vehicle,Yawv |
Rotation(1,3) |
Inertial vehicle Z-downZ-axis |
Handlebar,RollH |
Rotation(2,1) |
Vehicle Z-downX-axis |
Handlebar,PitchH |
Rotation(2,2) |
Vehicle Z-downY-axis |
Handlebar,YawH |
Rotation(2,3) |
Vehicle Z-downZ-axis |
Swing arm,RollSA |
Rotation(3,1) |
Vehicle Z-downX-axis |
Swing arm,PitchSA |
Rotation(3,2) |
Vehicle Z-downY-axis |
Swing arm,YawSA |
Rotation(3,3) |
Vehicle Z-downZ-axis |
Front wheel,RollF |
Rotation(4,1) |
Vehicle Z-downX-axis |
Front wheel,PitchF |
Rotation(4,2) |
Vehicle Z-downY-axis |
Front wheel,YawF |
Rotation(4,3) |
Vehicle Z-downZ-axis |
Rear wheel,RollR |
Rotation(5,1) |
Vehicle Z-downX-axis |
Rear wheel,PitchR |
Rotation(5,2) |
Vehicle Z-downY-axis |
Rear wheel,YawR |
Rotation(5,3) |
Vehicle Z-downZ-axis |
Model Examples
References
[1] Vehicle Dynamics Standards Committee.Vehicle Dynamics Terminology J670. Warrendale, PA: SAE International, 2008.
Version History
MATLAB Command
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select:.
You can also select a web site from the following list:
How to Get Best Site Performance
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Americas
- América Latina(Español)
- Canada(English)
- United States(English)
Europe
- Belgium(English)
- Denmark(English)
- Deutschland(Deutsch)
- España(Español)
- Finland(English)
- France(Français)
- Ireland(English)
- Italia(Italiano)
- Luxembourg(English)
- Netherlands(English)
- Norway(English)
- Österreich(Deutsch)
- Portugal(English)
- Sweden(English)
- Switzerland
- United Kingdom(English)