|
|
|
|
// CP: 65001
|
|
|
|
|
// SimulationX Version: 3.8.2.45319 x64
|
|
|
|
|
within AIDAModelica;
|
|
|
|
|
model ProSIVICToSimXInterface "Pro-SIVIC to Simulation X Interface"
|
|
|
|
|
Modelica.Blocks.Interfaces.RealInput roll(
|
|
|
|
|
quantity="Mechanics.Rotation.Angle",
|
|
|
|
|
displayUnit="rad") "IMU roll" annotation(Placement(
|
|
|
|
|
transformation(extent={{-140,15},{-100,55}}),
|
|
|
|
|
iconTransformation(
|
|
|
|
|
origin={-275,-100},
|
|
|
|
|
extent={{-20,-20},{20,20}},
|
|
|
|
|
rotation=90)));
|
|
|
|
|
Modelica.Blocks.Interfaces.RealInput pitch(
|
|
|
|
|
quantity="Mechanics.Rotation.Angle",
|
|
|
|
|
displayUnit="rad") "IMU pitch" annotation(Placement(
|
|
|
|
|
transformation(extent={{-105,15},{-65,55}}),
|
|
|
|
|
iconTransformation(
|
|
|
|
|
origin={-175,-100},
|
|
|
|
|
extent={{-20,-20},{20,20}},
|
|
|
|
|
rotation=90)));
|
|
|
|
|
Modelica.Blocks.Interfaces.RealInput yaw(
|
|
|
|
|
quantity="Mechanics.Rotation.Angle",
|
|
|
|
|
displayUnit="rad") "IMU yaw" annotation(Placement(
|
|
|
|
|
transformation(extent={{-135,-10},{-95,30}}),
|
|
|
|
|
iconTransformation(
|
|
|
|
|
origin={-225,-100},
|
|
|
|
|
extent={{-20,-20},{20,20}},
|
|
|
|
|
rotation=90)));
|
|
|
|
|
Modelica.Blocks.Interfaces.RealInput rollRate(
|
|
|
|
|
quantity="Mechanics.Rotation.RotVelocity",
|
|
|
|
|
displayUnit="rad/s") "IMU roll rate" annotation(Placement(
|
|
|
|
|
transformation(extent={{-70,15},{-30,55}}),
|
|
|
|
|
iconTransformation(
|
|
|
|
|
origin={-125,-100},
|
|
|
|
|
extent={{-20,-20},{20,20}},
|
|
|
|
|
rotation=90)));
|
|
|
|
|
Modelica.Blocks.Interfaces.RealInput pitchRate(
|
|
|
|
|
quantity="Mechanics.Rotation.RotVelocity",
|
|
|
|
|
displayUnit="rad/s") "IMU pitch rate" annotation(Placement(
|
|
|
|
|
transformation(extent={{-35,15},{5,55}}),
|
|
|
|
|
iconTransformation(
|
|
|
|
|
origin={-75,-100},
|
|
|
|
|
extent={{-20,-20},{20,20}},
|
|
|
|
|
rotation=90)));
|
|
|
|
|
Modelica.Blocks.Interfaces.RealInput yawRate(
|
|
|
|
|
quantity="Mechanics.Rotation.RotVelocity",
|
|
|
|
|
displayUnit="rad/s") "IMU yaw rate" annotation(Placement(
|
|
|
|
|
transformation(extent={{-65,-10},{-25,30}}),
|
|
|
|
|
iconTransformation(
|
|
|
|
|
origin={-25,-100},
|
|
|
|
|
extent={{-20,-20},{20,20}},
|
|
|
|
|
rotation=90)));
|
|
|
|
|
Modelica.Blocks.Interfaces.RealInput accelerationX(
|
|
|
|
|
quantity="Mechanics.Translation.Accel",
|
|
|
|
|
displayUnit="m/s²") "IMU acceleration X" annotation(Placement(
|
|
|
|
|
transformation(extent={{5,-15},{45,25}}),
|
|
|
|
|
iconTransformation(
|
|
|
|
|
origin={25,-100},
|
|
|
|
|
extent={{-20,-20},{20,20}},
|
|
|
|
|
rotation=90)));
|
|
|
|
|
Modelica.Blocks.Interfaces.RealInput accelerationY(
|
|
|
|
|
quantity="Mechanics.Translation.Accel",
|
|
|
|
|
displayUnit="m/s²") "IMU acceleration Y" annotation(Placement(
|
|
|
|
|
transformation(extent={{35,-15},{75,25}}),
|
|
|
|
|
iconTransformation(
|
|
|
|
|
origin={75,-100},
|
|
|
|
|
extent={{-20,-20},{20,20}},
|
|
|
|
|
rotation=90)));
|
|
|
|
|
Modelica.Blocks.Interfaces.RealInput accelerationZ(
|
|
|
|
|
quantity="Mechanics.Translation.Accel",
|
|
|
|
|
displayUnit="m/s²") "IMU acceleration Z" annotation(Placement(
|
|
|
|
|
transformation(extent={{15,-40},{55,0}}),
|
|
|
|
|
iconTransformation(
|
|
|
|
|
origin={125,-100},
|
|
|
|
|
extent={{-20,-20},{20,20}},
|
|
|
|
|
rotation=90)));
|
|
|
|
|
Modelica.Blocks.Interfaces.RealInput accurateLatitude(
|
|
|
|
|
quantity="Geometry.Angle",
|
|
|
|
|
displayUnit="deg") "GPS accurate latitude" annotation(Placement(
|
|
|
|
|
transformation(extent={{70,-15},{110,25}}),
|
|
|
|
|
iconTransformation(
|
|
|
|
|
origin={175,-100},
|
|
|
|
|
extent={{-20,-20},{20,20}},
|
|
|
|
|
rotation=90)));
|
|
|
|
|
Modelica.Blocks.Interfaces.RealInput accurateLongitude(
|
|
|
|
|
quantity="Geometry.Angle",
|
|
|
|
|
displayUnit="deg") "GPS accurate longitude" annotation(Placement(
|
|
|
|
|
transformation(extent={{100,-40},{140,0}}),
|
|
|
|
|
iconTransformation(
|
|
|
|
|
origin={225,-100},
|
|
|
|
|
extent={{-20,-20},{20,20}},
|
|
|
|
|
rotation=90)));
|
|
|
|
|
Modelica.Blocks.Interfaces.RealInput distance(
|
|
|
|
|
quantity="Geometry.Length",
|
|
|
|
|
displayUnit="m") "Lidar distance" annotation(Placement(
|
|
|
|
|
transformation(extent={{110,-15},{150,25}}),
|
|
|
|
|
iconTransformation(
|
|
|
|
|
origin={275,-100},
|
|
|
|
|
extent={{-20,-20},{20,20}},
|
|
|
|
|
rotation=90)));
|
|
|
|
|
Modelica.Blocks.Interfaces.RealOutput Attitude[3](
|
|
|
|
|
quantity="Mechanics.Rotation.Angle",
|
|
|
|
|
displayUnit="rad") "'output Real' as connector" annotation(Placement(
|
|
|
|
|
transformation(extent={{-80,70},{-60,90}}),
|
|
|
|
|
iconTransformation(
|
|
|
|
|
origin={-225,100},
|
|
|
|
|
extent={{-10,-10},{10,10}},
|
|
|
|
|
rotation=90)));
|
|
|
|
|
Modelica.Blocks.Interfaces.RealOutput AngularVelocities[3](
|
|
|
|
|
quantity="Mechanics.Rotation.RotVelocity",
|
|
|
|
|
displayUnit="rad/s") "'output Real' as connector" annotation(Placement(
|
|
|
|
|
transformation(extent={{-10,70},{10,90}}),
|
|
|
|
|
iconTransformation(
|
|
|
|
|
origin={-75,100},
|
|
|
|
|
extent={{-10,-10},{10,10}},
|
|
|
|
|
rotation=90)));
|
|
|
|
|
Modelica.Blocks.Interfaces.RealOutput Speed[3](
|
|
|
|
|
quantity="Mechanics.Translation.Velocity",
|
|
|
|
|
displayUnit="m/s") "'output Real' as connector" annotation(Placement(
|
|
|
|
|
transformation(extent={{50,70},{70,90}}),
|
|
|
|
|
iconTransformation(
|
|
|
|
|
origin={225,100},
|
|
|
|
|
extent={{-10,-10},{10,10}},
|
|
|
|
|
rotation=90)));
|
|
|
|
|
Modelica.Blocks.Interfaces.RealOutput Position[3](
|
|
|
|
|
quantity="Mechanics.Translation.Displace",
|
|
|
|
|
displayUnit="m") "'output Real' as connector" annotation(Placement(
|
|
|
|
|
transformation(extent={{150,70},{170,90}}),
|
|
|
|
|
iconTransformation(
|
|
|
|
|
origin={75,100},
|
|
|
|
|
extent={{-10,-10},{10,10}},
|
|
|
|
|
rotation=90)));
|
|
|
|
|
AccelerationToSpeed accelerationToSpeed1 annotation(Placement(transformation(extent={{40,30},{60,50}})));
|
|
|
|
|
PositionConvector positionConvector1 annotation(Placement(transformation(extent={{110,30},{130,50}})));
|
|
|
|
|
equation
|
|
|
|
|
connect(roll,Attitude[1]) annotation(
|
|
|
|
|
Line(
|
|
|
|
|
points={{-120,35},{-115,35},{-100,35},{-100,80},{-70,80}},
|
|
|
|
|
color={0,0,127},
|
|
|
|
|
thickness=0.0625));
|
|
|
|
|
connect(pitch,Attitude[2]) annotation(
|
|
|
|
|
Line(
|
|
|
|
|
points={{-85,35},{-80,35},{-90,35},{-90,80},{-70,80}},
|
|
|
|
|
color={0,0,127},
|
|
|
|
|
thickness=0.0625));
|
|
|
|
|
connect(yaw,Attitude[3]) annotation(
|
|
|
|
|
Line(
|
|
|
|
|
points={{-115,10},{-110,10},{-95,10},{-95,80},{-70,80}},
|
|
|
|
|
color={0,0,127},
|
|
|
|
|
thickness=0.0625));
|
|
|
|
|
connect(rollRate,AngularVelocities[1]) annotation(
|
|
|
|
|
Line(
|
|
|
|
|
points={{-50,35},{-45,35},{-30,35},{-30,80},{0,80}},
|
|
|
|
|
color={0,0,127},
|
|
|
|
|
thickness=0.0625));
|
|
|
|
|
connect(pitchRate,AngularVelocities[2]) annotation(
|
|
|
|
|
Line(
|
|
|
|
|
points={{-15,35},{-10,35},{-20,35},{-20,80},{0,80}},
|
|
|
|
|
color={0,0,127},
|
|
|
|
|
thickness=0.0625));
|
|
|
|
|
connect(yawRate,AngularVelocities[3]) annotation(
|
|
|
|
|
Line(
|
|
|
|
|
points={{-45,10},{-40,10},{-25,10},{-25,80},{0,80}},
|
|
|
|
|
color={0,0,127},
|
|
|
|
|
thickness=0.0625));
|
|
|
|
|
connect(accelerationToSpeed1.Speed[:],Speed[:]) annotation(Line(
|
|
|
|
|
points={{50,50},{50,55},{50,80},{55,80},{60,80}},
|
|
|
|
|
color={0,0,127},
|
|
|
|
|
thickness=0.0625));
|
|
|
|
|
connect(accelerationX,accelerationToSpeed1.Acceleration[1]) annotation(Line(
|
|
|
|
|
points={{25,5},{30,5},{49.3,5},{49.3,25},{49.3,30}},
|
|
|
|
|
color={0,0,127},
|
|
|
|
|
thickness=0.0625));
|
|
|
|
|
connect(accelerationY,accelerationToSpeed1.Acceleration[2]) annotation(Line(
|
|
|
|
|
points={{55,5},{50,5},{50,25},{50,30}},
|
|
|
|
|
color={0,0,127},
|
|
|
|
|
thickness=0.0625));
|
|
|
|
|
connect(accelerationZ,accelerationToSpeed1.Acceleration[3]) annotation(Line(
|
|
|
|
|
points={{35,-20},{40,-20},{50.3,-20},{50.3,25},{50.3,30}},
|
|
|
|
|
color={0,0,127},
|
|
|
|
|
thickness=0.0625));
|
|
|
|
|
connect(accurateLatitude,positionConvector1.Latitude) annotation(Line(
|
|
|
|
|
points={{90,5},{95,5},{115,5},{115,25},{115,30}},
|
|
|
|
|
color={0,0,127},
|
|
|
|
|
thickness=0.0625));
|
|
|
|
|
connect(accurateLongitude,positionConvector1.Longitude) annotation(Line(
|
|
|
|
|
points={{120,-20},{125,-20},{125,25},{125,30}},
|
|
|
|
|
color={0,0,127},
|
|
|
|
|
thickness=0.0625));
|
|
|
|
|
connect(positionConvector1.XCoordinate,Position[1]) annotation(Line(
|
|
|
|
|
points={{115,50},{115,55},{115,80},{155,80},{160,80}},
|
|
|
|
|
color={0,0,127},
|
|
|
|
|
thickness=0.0625));
|
|
|
|
|
connect(positionConvector1.YCoordinate,Position[2]) annotation(Line(
|
|
|
|
|
points={{125,50},{125,55},{125,80},{155,80},{160,80}},
|
|
|
|
|
color={0,0,127},
|
|
|
|
|
thickness=0.0625));
|
|
|
|
|
connect(distance,Position[3]) annotation(
|
|
|
|
|
Line(
|
|
|
|
|
points={{130,5},{150,5},{150,42.3},{150,80},{160,80}},
|
|
|
|
|
color={0,0,127},
|
|
|
|
|
thickness=0.0625));
|
|
|
|
|
annotation(
|
|
|
|
|
roll(flags=2),
|
|
|
|
|
pitch(flags=2),
|
|
|
|
|
yaw(flags=2),
|
|
|
|
|
rollRate(flags=2),
|
|
|
|
|
pitchRate(flags=2),
|
|
|
|
|
yawRate(flags=2),
|
|
|
|
|
accelerationX(flags=2),
|
|
|
|
|
accelerationY(flags=2),
|
|
|
|
|
accelerationZ(flags=2),
|
|
|
|
|
accurateLatitude(flags=2),
|
|
|
|
|
accurateLongitude(flags=2),
|
|
|
|
|
distance(flags=2),
|
|
|
|
|
Attitude(flags=2),
|
|
|
|
|
AngularVelocities(flags=2),
|
|
|
|
|
Speed(flags=2),
|
|
|
|
|
Position(flags=2),
|
|
|
|
|
accelerationToSpeed1(
|
|
|
|
|
Acceleration(flags=2),
|
|
|
|
|
Speed(flags=2)),
|
|
|
|
|
Icon(
|
|
|
|
|
coordinateSystem(extent={{-325,-100},{325,100}}),
|
|
|
|
|
graphics={
|
|
|
|
|
Rectangle(
|
|
|
|
|
fillColor={255,255,255},
|
|
|
|
|
fillPattern=FillPattern.Solid,
|
|
|
|
|
extent={{-326,100},{326.7,-100}})}),
|
|
|
|
|
experiment(
|
|
|
|
|
StopTime=1,
|
|
|
|
|
StartTime=0,
|
|
|
|
|
Interval=0.001));
|
|
|
|
|
end ProSIVICToSimXInterface;
|