Commit 767df014 authored by yoogx's avatar yoogx
Browse files

* New example: paparazzi, updated by G. Brau, based on example

          by IRIT
parent f46a8738
......@@ -94,7 +94,8 @@ AC_OUTPUT([
examples/mixin/Makefile
examples/mosart/Makefile
examples/multicore/Makefile
examples/pathfinder_system/Makefile
examples/paparazzi/Makefile
examples/pathfinder_system/Makefile
examples/perseus/Makefile
examples/producer_consumer/Makefile
examples/radar/Makefile
......
SUBDIRS= adiru ahrs_discovery aocs aram ardupilot arinc653_annex asl behavior_annex \
car data_modeling_annex fcs flow_analysis fms isr \
line_follower mixin memory mosart multicore \
pathfinder_system perseus producer_consumer ravenscar radar \
rap redundancy rma robot round_robin time_triggered units \
uxv voter satellite
SUBDIRS= adiru ahrs_discovery aocs aram ardupilot arinc653_annex asl \
behavior_annex car data_modeling_annex fcs flow_analysis \
fms isr line_follower mixin memory mosart multicore \
paparazzi pathfinder_system perseus producer_consumer \
ravenscar radar rap redundancy rma robot round_robin \
time_triggered units uxv voter satellite
#mjpeg
EXTRA_DIST=$(srcdir)/Makefile.common
......
AADL_SOURCES = $(srcdir)/paparazzi_system.aadl
AADL_ROOT =
OTHER_FILES = $(srcdir)/flybywire_hard.aadl \
$(srcdir)/paparazzi_hard.aadl $(srcdir)/autopilot_hard.aadl \
$(srcdir)/flybywire_soft.aadl $(srcdir)/autopilot_soft.aadl \
$(srcdir)/flybywire_subsys.aadl $(srcdir)/subprograms.aadl \
$(srcdir)/autopilot_subsys.aadl $(srcdir)/papa_types.aadl
CLEANDIRS =
CLEANFILES =
include $(srcdir)/../Makefile.common
AVAILABLE_TARGETS= parse-aadl
package autopilot_hard
public
with Papa_Types;
with Base_Types;
with paparazzi_hard;
--buses
-- relie le systeme MCU0 a la station sol
--ce qui permet la transmission de donnes
bus Modem
end Modem;
-- bus that links processors and devices
bus Device_Bus
end Device_Bus;
bus implementation Device_Bus.MCU0
end Device_Bus.MCU0;
-- bus that links processors and memories
bus Mem_Bus_MCU0
end Mem_Bus_MCU0;
--devices
--determine la pression
device Pression
features
P_Output : out data port Base_Types::Float_32;
Dev_Bus : requires bus access Device_Bus.MCU0;
end Pression;
--determine la tension
device Tension -- Alimentation
features
T_Output : out data port Base_Types::Integer_8;
Dev_Bus : requires bus access Device_Bus.MCU0;
end Tension;
device Compas
features
Compas_Output : out data port Base_Types::Float_32;
Dev_Bus : requires bus access Device_Bus.MCU0;
end compas;
--determine la vitesse de l'air
device Vitesse_Air
features
V_Air_Output : out data port Base_Types::Integer_8;
Dev_Bus : requires bus access Device_Bus.MCU0;
end Vitesse_Air;
--filme le trajet de la mission
device Camera_Video
features
Video_Output : out data port Papa_Types::Unknown; -- new data type?
Dev_Bus : requires bus access Device_bus.MCU0;
end Camera_Video;
-- transmet les donnees a la station sol
device Emetteur
features
Video_Input : in data port Papa_Types::Unknown;--data type?
Trans_Data_Input : in event data port Papa_Types::Inter_mcu_msg.Generic;
Trans_Data_Output : out data port Papa_Types::Unknown;
Video_Output : out data port Papa_Types::Unknown;
Modem_Bus : requires bus access Modem;
Dev_Bus : requires bus access Device_Bus.MCU0;
end Emetteur;
-- determine la position du drone
device GPS
features
Error_Output : out event port;
GPS_Output : out event data port Papa_Types::Stream_Element.Generic;
Dev_Bus : requires bus access Device_Bus.MCU0;
end GPS;
device InfraRed
features
Error_Output : out event port;
IR_Output : out data port Papa_Types::Stream_Element.Generic;
Dev_Bus : requires bus access Device_Bus.MCU0;
end InfraRed;
--processor
processor Proc_MCU0
features
Mem_Bus : requires bus access Mem_Bus_MCU0;
Dev_Bus : requires bus access Device_Bus.MCU0;
SPI : requires bus access paparazzi_hard::SPI;
end Proc_MCU0;
processor implementation Proc_MCU0.Impl
end Proc_MCU0.Impl;
--memory
memory Ram_MCU0
features
Mem_Bus : requires bus access Mem_Bus_MCU0;
end Ram_MCU0;
end autopilot_hard;
package autopilot_soft
public
with Papa_Types;
with Base_Types;
--Taches MCU0
--radio command task
--navigation
--climb control
--altitude control
--Receive GPS position
--stabilisation
--Send message to MCU1
--Receive Message from MCU1
--Send Data to ground station
--Interruptions
--Send/Receive via SPI
--Modem Interruption
-- Task 6
thread radio_control_task
end radio_control_task;
thread implementation radio_control_task.Impl
properties
Dispatch_Protocol=>periodic;
Period=> 100 ms;
Compute_Execution_Time => 15600 us .. 21100 us;
Source_Text => ("autopilot/main.c");
Compute_Entrypoint_Source_Text => "radio_control_task";
end radio_control_task.Impl;
-- Task 7
-- Controle la stabilisation et transmet les donnees a MCU1
thread stabilisation_task
features
IR_Input : in data port Papa_Types::Stream_Element.Generic;
end stabilisation_task;
thread implementation stabilisation_task.Impl
properties
Dispatch_Protocol=>periodic;
Period => 100 ms;
Compute_Execution_Time => 5681 us .. 6654 us;
Source_Text => ("autopilot/main.c");
Compute_Entrypoint_Source_Text => "stabilisation_task";
end stabilisation_task.Impl;
-- Task 8
thread link_fbw_send
features
MCU0_Send_Output : out event data port Papa_Types::Inter_mcu_msg.Generic;
end link_fbw_send;
--ce thread se declenche toujours apres la Stabilisation d'ou sa periode
thread implementation link_fbw_send.Impl
properties
Dispatch_Protocol=>periodic;
Period => 250 ms;
Compute_Execution_Time => 233 us .. 471 us;
Source_Text => ("autopilot/link_fbw.c");
Compute_Entrypoint_Source_Text => "link_fbw_send";
end link_fbw_send.Impl;
-- Task 9
thread receive_gps_data_task
features
GPS_Output : out event data port Papa_Types::Position.GPS;
end receive_gps_data_task;
thread implementation receive_gps_data_task.Impl
properties
Dispatch_Protocol=>periodic;
period => 250 ms;
Compute_Execution_Time => 5987 us .. 6659 us;
Source_Text => ("autopilot/main.c");
Compute_Entrypoint_Source_Text => "receive_gps_data_task";
end receive_gps_data_task.Impl;
-- Task 10
--controle la navigation de l'avion
thread navigation_task
features
GPS_Data_Input : in event data port Papa_Types::Position.GPS;
Altitude_Desiree_Output: out event data port Base_Types::Float_32;
end navigation_task;
--Ce thread est declenche a la frequence des informations delivrees
--par le GPS 4Hz, sa periode est de 250 ms
thread implementation navigation_task.Impl
properties
Dispatch_Protocol=>periodic;
Period=> 250 ms;
Compute_Execution_Time => 44420 us .. 53350 us;
Source_Text => ("autopilot/main.c");
Compute_Entrypoint_Source_Text => "navigation_task";
end navigation_task.Impl;
-- Task 11
--Controle l'altitude
thread altitude_control_task
features
Altitude_Desiree_Input : in event data port Base_Types::Float_32;--fourni par navigation
Montee_Desiree_Output : out event data port Base_Types::Float_32;
end altitude_control_task;
--le thread Navigation est toujours suivi, dans cet ordre,
-- par les threads Altitude_Control et Climb_Controle d'ou leur Periode
thread implementation altitude_control_task.Impl
properties
Dispatch_Protocol=>periodic;
Period => 250 ms;
Compute_Execution_Time => 1478 us .. 1660 us;
Source_Text => ("autopilot/main.c");
Compute_Entrypoint_Source_Text =>"altitude_control_task";
end altitude_control_task.Impl;
-- Task 12
--controle la montee
thread climb_control_task
features
Montee_Desiree_Input: in event data port Base_Types::Float_32;--fourni par Altitude_Ctrl
end climb_control_task;
thread implementation climb_control_task.Impl
properties
Dispatch_Protocol=>periodic;
Period => 250 ms;
Compute_Execution_Time => 5429 us .. 6241 us;
Source_Text => ("autopilot/main.c");
Compute_Entrypoint_Source_Text => "climb_control_task";
end climb_control_task.Impl;
-- Task 13
thread reporting_task
features
Data_Output : out data port Papa_Types::Inter_mcu_msg.Generic;
end reporting_task;
thread implementation reporting_task.Impl
properties
Dispatch_Protocol=>periodic;
Period=> 100 ms;
Compute_Execution_Time => 5000 us .. 12220 us;
Source_Text => ("autopilot/main.c");
Compute_Entrypoint_Source_Text => "reporting_task";
end reporting_task.Impl;
-- Interrupt 4
thread Interruption_SPI_MCU0_1
features
Evt_Rec_SPI_Input : in event data port Papa_Types::Inter_mcu_msg.Generic;
Data_Rec_MCU0_Output: out event data port Papa_Types::Inter_mcu_msg.Generic;
Data_Send_SPI_Output: out event data port Papa_Types::Inter_mcu_msg.Generic;
Evt_Send_SPI_Input: in event data port Papa_Types::Inter_mcu_msg.Generic;
end Interruption_SPI_MCU0_1;
thread implementation Interruption_SPI_MCU0_1.Impl
properties
-- Period => 50 ms;
Compute_Execution_Time => 251 us .. 447 us;
Source_Text => ("autopilot/spi.c/SIGNAL");
Compute_Entrypoint_Source_Text => "__vector_17";
end Interruption_SPI_MCU0_1.Impl;
-- Interrupt 4 bis?
thread Interruption_SPI_MCU0_2
features
Data_Rec_MCU0_Output: out event data port Papa_Types::Inter_mcu_msg.Generic;--fourni a MCU0
Data_Send_SPI_Output: out event data port Papa_Types::Inter_mcu_msg.Generic;
Data_Send_SPI_Input : in event data port Papa_Types::Inter_mcu_msg.Generic;
Data_Rec_MCU0_Input: in event data port Papa_Types::Inter_mcu_msg.Generic;
end Interruption_SPI_MCU0_2;
thread implementation Interruption_SPI_MCU0_2.Impl
properties
-- Period => 50 ms;
Compute_Execution_Time => 151 us .. 228 us;
Source_Text => ("autopilot/linf_fbw.c/SIGNAL");
Compute_Entrypoint_Source_Text => "__vector_12";
end Interruption_SPI_MCU0_2.Impl;
-- Interupt 5
thread Interruption_Modem
features
Data_Input : in data port Papa_Types::Inter_mcu_msg.Generic;
Data_Output : out event data port Papa_Types::Inter_mcu_msg.Generic;
end Interruption_Modem;
thread implementation Interruption_Modem.Impl
properties
-- Period => 100 ms;
Compute_Execution_Time=> 303 us .. 520 us;
Source_Text => ("autopilot/modem.c/SIGNAL");
Compute_Entrypoint_Source_Text => "__vector_5";
end Interruption_Modem.Impl;
-- Interrupt 6
-- Ce thread recoit les sigaux GPS et les transforme
-- en donnees utilisables
thread Interruption_GPS
features
GPS_Input : in event data port Papa_Types::Stream_Element.Generic;
end Interruption_GPS;
thread implementation Interruption_GPS.Impl
properties
-- Period => 250 ms;
Compute_Execution_Time => 283 us .. 493 us;
Source_Text => ("autopilot/gps_ubx.c/parse_ubx");
Compute_Entrypoint_Source_Text => "__vector_30";
end Interruption_GPS.Impl;
-- Autopilot process
process Nav_Stab_Control_Proc
features
MCU1_Data_Input : in event data port Papa_Types::Inter_mcu_msg.Generic;--Param Radio_Cde (mode manuel)
GPS_Input : in event data port Papa_Types::Stream_Element.Generic;
GPS_Evt_Input : in event port;
IR_Input : in data port Papa_Types::Stream_Element.Generic;
P_Input : in data port Base_Types::Float_32;
T_Input : in data port Base_Types::Integer_8;
Compas_Input : in data port Base_Types::Float_32;
V_Air_Input : in data port Base_Types::Integer_8;
-- donnees transmies a MCU1
Trans_MCU0_Output: out event data port Papa_Types::Inter_mcu_msg.Generic;
-- donnees transmies a la station sol
Trans_Sol_Output : out event data port Papa_Types::Inter_mcu_msg.Generic;
end Nav_Stab_Control_Proc;
process implementation Nav_Stab_Control_Proc.Impl
subcomponents
Data_Acq_Filt_Th : thread receive_gps_data_task.Impl;
Alt_Ctrl_Th : thread altitude_control_task.Impl;
Nav_Th : thread navigation_task.Impl;
Climb_Ctrl_Th : thread climb_control_task.Impl;
Stab_Th : thread stabilisation_task.Impl;
Send_MCU1_Th : thread link_fbw_send.Impl;
Send_Grd_Station_Th : thread reporting_task.Impl;
Interrupt_SPI_Th1:thread Interruption_SPI_MCU0_1.Impl;
Interrupt_SPI_Th2:thread Interruption_SPI_MCU0_2.Impl;
Interrupt_Modem_Th: thread Interruption_Modem.Impl;
Interrupt_GPS_Th: thread Interruption_GPS.Impl;
Ctrl_By_RC_Th: thread radio_control_task.Impl;
--save the autopilot settings
AP_Data : data Papa_Types::Inter_mcu_msg.Generic;
connections
c1: port GPS_Input->Interrupt_GPS_Th.GPS_Input;
c2: port Data_Acq_Filt_Th.GPS_Output->Nav_Th.GPS_Data_Input;
c3: port Nav_Th.Altitude_Desiree_Output->Alt_Ctrl_Th.Altitude_Desiree_Input in modes (auto, home);
c4: port Alt_Ctrl_Th.Montee_Desiree_Output->Climb_Ctrl_Th.Montee_Desiree_Input in modes (auto, home);
c5: port IR_Input->Stab_Th.IR_Input;
c6: port Send_MCU1_Th.MCU0_Send_Output->Interrupt_SPI_Th1.Evt_Send_SPI_Input in modes(auto,home,manual);
c7: port Interrupt_SPI_Th1.Data_Send_SPI_Output->Interrupt_SPI_Th2.Data_Send_SPI_Input in modes(auto,home,manual);
c8: port Interrupt_SPI_Th2.Data_Send_SPI_Output->Trans_MCU0_Output in modes(auto,home,manual);
c9: port MCU1_Data_Input->Interrupt_SPI_Th1.Evt_Rec_SPI_Input in modes(manual);
c10: port Interrupt_SPI_Th1.Data_Rec_MCU0_Output->Interrupt_SPI_Th2.Data_Rec_MCU0_Input in modes(manual);
c11: port Send_Grd_Station_Th.Data_Output->Interrupt_Modem_Th.Data_Input in modes (auto,manual,home);
c12: port Interrupt_Modem_Th.Data_Output->Trans_Sol_Output in modes (auto,manual,home);
modes
manual : initial mode;
auto : mode;
home : mode;
properties
Source_Text => ("autopilot/mainloop.c");
end Nav_Stab_Control_Proc.Impl;
end autopilot_soft;
package autopilot_subsys
public
with Papa_Types;
with autopilot_soft;
with autopilot_hard;
with paparazzi_hard;
-- MCU0 est charge de la Stabilisation,
-- la navigation, la communication avec MCU1
-- et la transmission des parametres de vol
system MCU0
features
D_MCU1_Input : in event data port Papa_Types::Inter_mcu_msg.Generic;--updated
--E_MCU1_Input : in event port;--updated
D_MCU0_Output : out event data port Papa_Types::Inter_mcu_msg.Generic;--updated
--E_MCU0_Output : out event port;--updated
SPI_Con : requires bus access paparazzi_hard::SPI;
end MCU0;
system implementation MCU0.Impl
subcomponents
Proc_0 : processor autopilot_hard::Proc_MCU0.Impl;
Ram : memory autopilot_hard::Ram_MCU0;
Mem_Bus: bus autopilot_hard::Mem_Bus_MCU0;
P_dv : device autopilot_hard::Pression;
T_dv : device autopilot_hard::Tension;
Compas_dv : device autopilot_hard::Compas;
V_Air_dv : device autopilot_hard::Vitesse_Air;
Cam_dv : device autopilot_hard::Camera_Video;
Emet_dv : device autopilot_hard::Emetteur;
GPS_dv : device autopilot_hard::GPS;
IR_dv : device autopilot_hard::InfraRed;
Dev_Bus : bus autopilot_hard::Device_Bus.MCU0;
Modem_Bus : bus autopilot_hard::Modem;
N_S_C_proc : process autopilot_soft::Nav_Stab_Control_Proc.Impl;
connections
-- bus connections
acc1: bus access Mem_Bus->Proc_0.Mem_Bus;
acc2: bus access Mem_Bus->Ram.Mem_Bus;
acc3: bus access Dev_Bus->Proc_0.Dev_Bus;
acc4: bus access Dev_Bus->P_dv.Dev_Bus;
acc5: bus access Dev_Bus->T_dv.Dev_Bus;
acc6: bus access Dev_Bus->Compas_dv.Dev_Bus;
acc7: bus access Dev_Bus->V_Air_dv.Dev_Bus;
acc8: bus access Dev_Bus->Cam_dv.Dev_Bus;
acc9: bus access Dev_Bus->Emet_dv.Dev_Bus;
acc10: bus access Modem_Bus->Emet_dv.Modem_Bus;
acc11: bus access Dev_Bus->GPS_dv.Dev_Bus;
acc12: bus access Dev_Bus->IR_dv.Dev_Bus;
--ports connections
c1: port P_dv.P_Output->N_S_C_proc.P_Input;
c2: port T_dv.T_Output->N_S_C_proc.T_Input;
c3: port Compas_dv.Compas_Output->N_S_C_proc.Compas_Input;
c4: port V_Air_dv.V_Air_Output->N_S_C_proc.V_Air_Input;
c5: port GPS_dv.GPS_Output->N_S_C_proc.GPS_Input;
c6: port GPS_dv.Error_Output->N_S_C_proc.GPS_Evt_Input;
c7: port N_S_C_proc.Trans_Sol_Output->Emet_dv.Trans_Data_Input;--updated
c8: port Cam_dv.Video_Output->Emet_dv.Video_Input;
c9: port D_MCU1_Input->N_S_C_proc.MCU1_Data_Input;--updated
--event port E_MCU1_Input->N_S_C_proc.MCU1_Evt_Input; --updated
c10: port N_S_C_proc.Trans_MCU0_Output->D_MCU0_Output;--updated
--event port GPS_dv.Error_Output->E_MCU0_Output; --updated
properties
-- pour relier le processus a la memoire et au processeur
Actual_Processor_Binding => (reference (Proc_0)) applies to N_S_C_Proc;
Actual_Memory_Binding => (reference (Ram)) applies to N_S_C_Proc;
end MCU0.Impl;
end autopilot_subsys;
\ No newline at end of file
package flyByWire_hard
public
with Papa_Types;
with Base_Types;
with paparazzi_hard;
-- buses
-- bus that links processors and devices
bus Device_Bus
end Device_Bus;
bus implementation Device_Bus.MCU1
end Device_Bus.MCU1;
-- bus that links processors and memories
bus Mem_Bus_MCU1
end Mem_Bus_MCU1;
-- devices
device Compteur
features
Data_Elev_Input : in data port Base_Types::Integer_16;
Data_AilL_Input : in data port Base_Types::Integer_16;
Data_AilR_Input : in data port Base_Types::Integer_16;
Data_MotorL_Input : in data port Base_Types::Integer_16;
Data_MotorR_Input : in data port Base_Types::Integer_16;
Data_Rudder_Input : in data port Base_Types::Integer_16;
Data_Elev_Output : out data port Base_Types::Integer_16;
Data_AilL_Output : out data port Base_Types::Integer_16;
Data_AilR_Output : out data port Base_Types::Integer_16;
Data_MotorL_Output : out data port Base_Types::Integer_16;
Data_MotorR_Output : out data port Base_Types::Integer_16;
Data_Rudder_Output : out data port Base_Types::Integer_16;
Dev_Bus : requires bus access Device_Bus.MCU1;
end Compteur;
device Servo
features
Data_Input : in data port Base_Types::Integer_16;
Dev_bus : requires bus access Device_Bus.MCU1;
end Servo;
device Recepteur
features
RC_Input : in event data port Papa_Types::Unknown;
RC_Output : out event data port Papa_Types::Unknown;
RC_Evt_Output : out event port;
Dev_Bus : requires bus access Device_Bus.MCU1;
end Recepteur;
--processor
processor Proc_MCU1
features
Mem_Bus : requires bus access Mem_Bus_MCU1;
Dev_Bus : requires bus access Device_Bus.MCU1;
SPI : requires bus access paparazzi_hard::SPI;
end Proc_MCU1;
-- AADL processor = microprocessor + scheduler
processor implementation Proc_MCU1.Impl
end Proc_MCU1.Impl;
-- memory
memory Ram_MCU1
features
Mem_Bus : requires bus access Mem_Bus_MCU1;
end Ram_MCU1;
end flyByWire_hard;
\ No newline at end of file
package flyByWire_soft
public
with Papa_Types;
with Base_Types;
-- software architecture of fly-by-ware system
-- Note: initially proposed calls to subprograms have been commented
-- according to AADLv2 subprograms cannot be part of data definitions
--tasks MCU1:
--Reception Radio Command
--Send Servos Commands
--Send Message to MCU0
--Interrupts:
--Receive/Send Data via SPI
--Servos Interrupts (6 interrupts)
--les taches sont soit periodiques
--et les interruptions sont periodiques
-- Task 1?
thread test_ppm_task
end test_ppm_task;
thread implementation test_ppm_task.Impl