Skip to content

Commit

Permalink
[modules][ocaml] implement module dependency (paparazzi#2669)
Browse files Browse the repository at this point in the history
- support depends, conflicts and provides nodes, all under a 'dep' node
- autoload are kept for now and are not moved yet
- modules are updated for new dep format
- it is now required that module's name and filename are the same
  • Loading branch information
gautierhattenberger committed Mar 16, 2021
1 parent 97fa1d7 commit e4d9e10
Show file tree
Hide file tree
Showing 149 changed files with 589 additions and 284 deletions.
6 changes: 3 additions & 3 deletions conf/airframes/ENAC/fixed-wing/tawaki.xml
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,9 @@
</module>

<!--configure name="SDLOG_USE_RTC" value="FALSE"/-->
<module name="tlsf"/>
<!--module name="tlsf"/>
<module name="pprzlog"/>
<module name="logger" type="sd_chibios"/>
<module name="logger" type="sd_chibios"/-->
<module name="flight_recorder"/>
</firmware>

Expand Down Expand Up @@ -216,7 +216,7 @@
<section name="SIMULATOR" prefix="NPS_">
<define name="JSBSIM_LAUNCHSPEED" value="15"/>
<define name="JSBSIM_MODEL" value="easystar" type="string"/>
<define name="SENSORS_PARAMS" value="nps_sensors_params_wind_estimator.h" type="string"/>
<define name="SENSORS_PARAMS" value="nps_sensors_params_default.h" type="string"/>
<define name="JS_AXIS_MODE" value="4"/>
</section>

Expand Down
4 changes: 3 additions & 1 deletion conf/modules/AOA_pwm.xml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,9 @@
</dl_settings>
</settings>

<depends>pwm_meas</depends>
<dep>
<depends>pwm_meas</depends>
</dep>
<header>
<file name="aoa_pwm.h" />
</header>
Expand Down
2 changes: 1 addition & 1 deletion conf/modules/ahrs_float_cmpl_rmat.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<!DOCTYPE module SYSTEM "module.dtd">

<module name="ahrs_flat_cmpl_rmat" dir="ahrs">
<module name="ahrs_float_cmpl_rmat" dir="ahrs">
<doc>
<description>
AHRS using complementary filter in floating point.
Expand Down
2 changes: 1 addition & 1 deletion conf/modules/ahrs_float_invariant.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<!DOCTYPE module SYSTEM "module.dtd">

<module name="ahrs_float_dcm" dir="ahrs">
<module name="ahrs_float_invariant" dir="ahrs">
<doc>
<description>
AHRS using invariant filter.
Expand Down
4 changes: 3 additions & 1 deletion conf/modules/ahrs_infrared.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,9 @@
- ADC channels can be used for gyros.
</description>
</doc>
<depends>infrared_adc</depends>
<dep>
<depends>infrared_adc</depends>
</dep>
<header>
<file name="ahrs_infrared.h"/>
</header>
Expand Down
2 changes: 1 addition & 1 deletion conf/modules/auto1_commands.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<!DOCTYPE module SYSTEM "module.dtd">

<module name="auto1_cmd" dir="switching">
<module name="auto1_commands" dir="switching">
<doc>
<description>AUTO1 FLAPS/HATCH COMMANDS.
Enable RC controlled HATCH and BRAKE/FLAPS in both MANUAL and AUTO1, while automatic in AUTO2.
Expand Down
4 changes: 3 additions & 1 deletion conf/modules/baro_MS5534A.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,16 @@
<header>
<file name="baro_MS5534A.h"/>
</header>
<dep>
<depends>spi_master</depends>
</dep>
<init fun="baro_MS5534A_init()"/>
<periodic fun="baro_MS5534A_send()" freq="20"/>
<event fun="baro_MS5534A_event()"/>
<makefile target="ap">
<file name="baro_MS5534A.c"/>
<define name="USE_BARO_MS5534A"/>
<define name="USE_SPI_SLAVE0"/>
<define name="SPI_MASTER"/>
<configure name="BARO_MS5534A_W1" value="0xAC20"/>
<configure name="BARO_MS5534A_W2" value="0x87D9"/>
<configure name="BARO_MS5534A_W3" value="0x8D9C"/>
Expand Down
2 changes: 1 addition & 1 deletion conf/modules/baro_bmp280_i2c.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<!DOCTYPE module SYSTEM "module.dtd">

<module name="baro_bmp280" dir="sensors">
<module name="baro_bmp280_i2c" dir="sensors">
<doc>
<description>
Bosch-Sensortech BMP280xx pressure sensor
Expand Down
6 changes: 3 additions & 3 deletions conf/modules/baro_ms5611_spi.xml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@
<configure name="MS5611_SLAVE_IDX" value="SPI_SLAVE0" description="SPI slave select index"/>
<define name="SENSOR_SYNC_SEND" description="flag to enable sending BARO_MS5611 message on every new measurement"/>
</doc>
<dep>
<depends>spi_master</depends>
</dep>
<header>
<file name="baro_ms5611_spi.h"/>
</header>
Expand All @@ -20,9 +23,6 @@
<makefile target="ap">
<configure name="MS5611_SPI_DEV" default="spi1" case="upper|lower"/>
<configure name="MS5611_SLAVE_IDX" default="spi_slave0" case="upper|lower"/>
<raw>
include $(CFG_SHARED)/spi_master.makefile
</raw>
<define name="USE_$(MS5611_SPI_DEV_UPPER)" />
<define name="USE_$(MS5611_SLAVE_IDX_UPPER)" />
<define name="MS5611_SPI_DEV" value="$(MS5611_SPI_DEV_LOWER)" />
Expand Down
5 changes: 3 additions & 2 deletions conf/modules/baro_scp.xml
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,14 @@
<header>
<file name="baro_scp.h"/>
</header>
<dep>
<depends>spi_master</depends>
</dep>
<init fun="baro_scp_init()"/>
<periodic fun="baro_scp_periodic()" freq="1.8"/>
<event fun="baro_scp_event()"/>
<makefile target="ap">
<file name="baro_scp.c"/>
<define name="SPI_MASTER"/>
<define name="USE_SPI"/>
</makefile>
</module>

4 changes: 3 additions & 1 deletion conf/modules/bebop_cam.xml
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,9 @@
</dl_settings>
</settings>

<autoload name="video_thread"/>
<dep>
<depends>video_thread</depends>
</dep>

<header>
<file name="mt9v117.h"/>
Expand Down
6 changes: 3 additions & 3 deletions conf/modules/board_matek_f405_wing.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@
Normal up of the board is on STM32F405 side.
</description>
</doc>
<dep>
<depends>spi_master,osd_max7456,baro_bmp280_i2c</depends>
</dep>
<autoload name="imu" type="mpu6000"/>
<autoload name="spi" type="master"/>
<autoload name="osd_max7456" />
<autoload name="baro_bmp280_i2c" />

<makefile target="!sim|nps|fbw">
<!-- IMU CONFIGURATION -->
Expand Down
7 changes: 3 additions & 4 deletions conf/modules/board_matek_f765_wing.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,10 @@
</description>
<configure name="BOARD_MATEK_ROTATED" value="FALSE|TRUE" description="if TRUE, the board is not using is default orientation and axis can be redefined by hand"/>
</doc>
<dep>
<depends>spi_master,osd_max7456,baro_bmp280_i2c,current_sensor</depends>
</dep>
<autoload name="imu" type="mpu6000"/>
<autoload name="spi" type="master"/>
<autoload name="osd_max7456"/>
<autoload name="baro_bmp280_i2c"/>
<autoload name="current_sensor"/>

<makefile target="!sim|nps|fbw">
<!-- IMU CONFIGURATION -->
Expand Down
5 changes: 3 additions & 2 deletions conf/modules/board_tawaki.xml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,10 @@
</description>
<configure name="BOARD_TAWAKI_ROTATED" value="FALSE|TRUE" description="if TRUE, the board is not using is default orientation and axis can be redefined by hand"/>
</doc>
<dep>
<depends>baro_bmp3,mag_lis3mdl</depends>
</dep>
<autoload name="imu" type="mpu6000"/>
<autoload name="baro" type="bmp3"/>
<autoload name="mag" type="lis3mdl"/>
<makefile target="!sim|nps|fbw">
<define name="IMU_MPU_GYRO_RANGE" value="MPU60X0_GYRO_RANGE_1000"/>
<define name="IMU_MPU_ACCEL_RANGE" value="MPU60X0_ACCEL_RANGE_8G"/>
Expand Down
4 changes: 3 additions & 1 deletion conf/modules/cam_segment.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@
<doc>
<description>Camera control to point a segment</description>
</doc>
<depends>cam_point</depends>
<dep>
<depends>cam_point</depends>
</dep>
<header>
<file name="cam_segment.h"/>
</header>
Expand Down
2 changes: 1 addition & 1 deletion conf/modules/configure_actuators_mkk_v2.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<!DOCTYPE module SYSTEM "module.dtd">

<module name="config">
<module name="configure_actuators_mkk_v2" dir="config">
<doc>
<description>Configure Mikrokopter MKK v2.0 BLDC motor controllers (requires subsystem actuators_mkk_v2)</description>
</doc>
Expand Down
5 changes: 3 additions & 2 deletions conf/modules/control.xml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@
- guidance_basic_fw
</description>
</doc>
<autoload name="stabilization_attitude_fw"/>
<autoload name="guidance_basic_fw"/>
<dep>
<depends>stabilization_attitude_fw,guidance_basic_fw</depends>
</dep>
<makefile target="ap|sim|nps" firmware="fixedwing"/>
</module>
7 changes: 4 additions & 3 deletions conf/modules/control_adaptive.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<!DOCTYPE module SYSTEM "module.dtd">

<module name="control" dir="control">
<module name="control_adaptive" dir="control">
<doc>
<description>
Adaptive control for fixed-wing aircraft.
Expand All @@ -9,7 +9,8 @@
- guidance_basic_fw
</description>
</doc>
<autoload name="stabilization_adaptive_fw"/>
<autoload name="guidance_basic_fw"/>
<dep>
<depends>stabilization_adaptive_fw,guidance_basic_fw</depends>
</dep>
<makefile target="ap|sim|nps" firmware="fixedwing"/>
</module>
7 changes: 4 additions & 3 deletions conf/modules/control_energy.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<!DOCTYPE module SYSTEM "module.dtd">

<module name="control" dir="control">
<module name="control_energy" dir="control">
<doc>
<description>
Energy control for fixed-wing aircraft.
Expand All @@ -9,7 +9,8 @@
- guidance_energy
</description>
</doc>
<autoload name="stabilization_attitude_fw"/>
<autoload name="guidance_energy"/>
<dep>
<depends>stabilization_attitude_fw,guidance_energy</depends>
</dep>
<makefile target="ap|sim|nps" firmware="fixedwing"/>
</module>
7 changes: 4 additions & 3 deletions conf/modules/control_energyadaptive.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<!DOCTYPE module SYSTEM "module.dtd">

<module name="control" dir="control">
<module name="control_energyadaptive" dir="control">
<doc>
<description>
Energy control for fixed-wing aircraft with adaptive stabilization.
Expand All @@ -9,7 +9,8 @@
- guidance_energy
</description>
</doc>
<autoload name="stabilization_adaptive_fw"/>
<autoload name="guidance_energy"/>
<dep>
<depends>stabilization_adaptive_fw,guidance_energy</depends>
</dep>
<makefile target="ap|sim|nps" firmware="fixedwing"/>
</module>
7 changes: 4 additions & 3 deletions conf/modules/control_new.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<!DOCTYPE module SYSTEM "module.dtd">

<module name="control" dir="control">
<module name="control_new" dir="control">
<doc>
<description>
Full PID control for fixed-wing aircraft.
Expand All @@ -9,7 +9,8 @@
- guidance_full_pid_fw
</description>
</doc>
<autoload name="stabilization_adaptive_fw"/>
<autoload name="guidance_full_pid_fw"/>
<dep>
<depends>stabilization_adaptive_fw,guidance_full_pid_fw</depends>
</dep>
<makefile target="ap|sim|nps" firmware="fixedwing"/>
</module>
4 changes: 3 additions & 1 deletion conf/modules/copilot.xml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@
</doc>


<depends>extra_dl</depends>
<dep>
<depends>extra_dl</depends>
</dep>
<header>
<file name="copilot.h"/>
</header>
Expand Down
2 changes: 1 addition & 1 deletion conf/modules/ctrl_module_innerloop_demo.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<!DOCTYPE module SYSTEM "module.dtd">

<module name="ctrl_module_demo" dir="ctrl">
<module name="ctrl_module_innerloop_demo" dir="ctrl">
<doc>
<description>
Demo Control Module.
Expand Down
4 changes: 3 additions & 1 deletion conf/modules/cv_blob_locator.xml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@
</dl_settings>
</settings>

<depends>video_thread</depends>
<dep>
<depends>video_thread</depends>
</dep>

<header>
<file name="cv_blob_locator.h"/>
Expand Down
6 changes: 4 additions & 2 deletions conf/modules/cv_colorfilter.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<!DOCTYPE module SYSTEM "module.dtd">

<module name="ColorFilter" dir="computer_vision">
<module name="cv_colorfilter" dir="computer_vision">
<doc>
<description>ColorFilter</description>
<define name="COLORFILTER_CAMERA" value="front_camera|bottom_camera" description="Video device to use"/>
Expand All @@ -20,7 +20,9 @@
</dl_settings>
</settings>

<depends>video_thread</depends>
<dep>
<depends>video_thread</depends>
</dep>

<header>
<file name="colorfilter.h"/>
Expand Down
4 changes: 3 additions & 1 deletion conf/modules/cv_detect_color_object.xml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,9 @@
</dl_settings>
</settings>

<depends>video_thread</depends>
<dep>
<depends>video_thread</depends>
</dep>

<header>
<file name="cv_detect_color_object.h"/>
Expand Down
4 changes: 3 additions & 1 deletion conf/modules/cv_detect_gate.xml
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,9 @@
</dl_settings>
</settings>

<depends>video_thread</depends>
<dep>
<depends>video_thread</depends>
</dep>

<header>
<file name="detect_gate.h"/>
Expand Down
2 changes: 1 addition & 1 deletion conf/modules/cv_detect_window.xml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<!DOCTYPE module SYSTEM "module.dtd">

<module name="detect_window" dir="computer_vision">
<module name="cv_detect_window" dir="computer_vision">
<doc>
<description>
Detect window
Expand Down
6 changes: 3 additions & 3 deletions conf/modules/cv_opticflow.xml
Original file line number Diff line number Diff line change
Expand Up @@ -180,9 +180,9 @@
</dl_settings>
</settings>

<depends>video_thread</depends>
<autoload name="agl_dist"/>
<autoload name="pose_history"/>
<dep>
<depends>video_thread,agl_dist,pose_history</depends>
</dep>

<header>
<file name="opticflow_module.h"/>
Expand Down
Loading

0 comments on commit e4d9e10

Please sign in to comment.