within AIDAModelica; model ControlDroneNavigation "[SF4] Control drone navigation" // CP: 65001 // SimulationX Version: 3.8.2.45319 x64 Modelica.Blocks.Interfaces.RealOutput YawConsign(each quantity = "Mechanics.Rotation.Angle", each displayUnit = "rad") "Yaw consign" annotation( Placement(transformation(origin = {56, 6}, extent = {{45, -15}, {65, 5}}), iconTransformation(origin = {260, 0}, extent = {{90, -10}, {110, 10}}))); Modelica.Blocks.Interfaces.RealOutput DronPositionConsign[3](each quantity = "Mechanics.Translation.Displace", each displayUnit = "m") "Dron position consign" annotation( Placement(transformation(origin = {100, 50}, extent = {{0, 20}, {20, 40}}), iconTransformation(origin = {260, 24}, extent = {{90, 40}, {110, 60}}))); Modelica.Blocks.Interfaces.BooleanInput APEngagement "'input Boolean' as connector" annotation( Placement(transformation(origin = {-28, -38}, extent = {{-113, -63}, {-73, -23}}), iconTransformation(origin = {-24, 30}, extent = {{-120, 30}, {-80, 70}}))); Modelica.Blocks.Interfaces.BooleanOutput SelectedControlMode "'output Boolean' as connector" annotation( Placement(transformation(origin = {90, -46}, extent = {{10, -45}, {30, -25}}), iconTransformation(origin = {260, -24}, extent = {{90, -60}, {110, -40}}))); Modelica.Blocks.Interfaces.BooleanInput IndicatorYawConsign "'input Boolean' as connector" annotation( Placement(transformation(origin = {-22, 54}, extent = {{-118, 5}, {-78, 45}}), iconTransformation(origin = {-24, 0}, extent = {{-120, -20}, {-80, 20}}))); Modelica.Blocks.Interfaces.RealInput Yaw "'input Real' as connector" annotation( Placement(transformation(origin = {-20, 14}, extent = {{-120, -35}, {-80, 5}}), iconTransformation(origin = {-24, -28}, extent = {{-120, -70}, {-80, -30}}))); AIDAModelica.RunFlightPlan runFlightPlan1 annotation( Placement(transformation(extent = {{-42, 19}, {-22, 39}}))); Modelica.Blocks.Logical.Switch SelectYawConsign annotation( Placement(transformation(extent = {{10, -15}, {30, 5}}))); AIDAModelica.YawConsignProducing yawConsignProducing1 annotation( Placement(transformation(extent = {{-48, -20}, {-28, 0}}))); equation connect(yawConsignProducing1.YRC, APEngagement) annotation( Line(points = {{-48, -4}, {-80, -4}, {-80, -81}, {-121, -81}}, color = {255, 0, 255})); connect(SelectYawConsign.u2, APEngagement) annotation( Line(points = {{8, -5}, {-22, -5}, {-22, -81}, {-121, -81}}, color = {255, 0, 255})); connect(APEngagement, SelectedControlMode) annotation( Line(points = {{-121, -81}, {110, -81}}, color = {255, 0, 255})); connect(yawConsignProducing1.Yaw, Yaw) annotation( Line(points = {{-48, -15}, {-87, -15}, {-87, -1}, {-120, -1}}, color = {0, 0, 127}, thickness = 0.0625)); connect(runFlightPlan1.DronPositionConsign[:], DronPositionConsign[:]) annotation( Line(points = {{-22, 34}, {-4, 34}, {-4, 30}, {10, 30}}, color = {0, 0, 127}, thickness = 0.0625)); connect(SelectYawConsign.y, YawConsign) annotation( Line(points = {{31, -5}, {71, -5}, {71, 1}, {111, 1}}, color = {0, 0, 127}, thickness = 0.0625)); connect(yawConsignProducing1.DesiredYaw, SelectYawConsign.u3) annotation( Line(points = {{-28, -10}, {3, -10}, {3, -13}, {8, -13}}, color = {0, 0, 127}, thickness = 0.0625)); connect(SelectYawConsign.u1, runFlightPlan1.YawConsign) annotation( Line(points = {{8, 3}, {3, 3}, {-17, 3}, {-17, 24}, {-22, 24}}, color = {0, 0, 127})); annotation( selectControlMode1(SelectedControlMode(flags = 2), APEngagement(flags = 2), Main_State(flags = 2)), YawConsign(flags = 2), DronPositionConsign(flags = 2), APEngagement(flags = 2), SelectedControlMode(flags = 2), IndicatorYawConsign(flags = 2), Yaw(flags = 2), runFlightPlan1(DronPositionConsign(flags = 2), YawConsign(flags = 2), X_coordinate_map(u(flags = 2), y(flags = 2)), timeSource1(TimeOutput(flags = 2)), Y_coordinate_map(u(flags = 2), y(flags = 2)), Z_coordinate_map(u(flags = 2), y(flags = 2)), YawAngle(u(flags = 2), y(flags = 2))), SelectYawConsign(u1(flags = 2), u2(flags = 2), u3(flags = 2), y(flags = 2)), yawConsignProducing1(Yaw(flags = 2), DesiredYaw(flags = 2), YRC(flags = 2), YawOld(flags = 2)), Icon(graphics = {Rectangle(origin = {127, 0},fillColor = {255, 255, 255}, fillPattern = FillPattern.Solid, extent = {{-230, 100}, {223, -100}}), Text(origin = {120, 7}, extent = {{-220, 13}, {220, -13}}, textString = "%name", fontSize = 18)}, coordinateSystem(initialScale = 0.1)), experiment(StopTime = 1, StartTime = 0, Interval = 0.002, MaxInterval = "0.001")); end ControlDroneNavigation;