Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: Fixed wing control API #24056

Open
wants to merge 15 commits into
base: main
Choose a base branch
from
Open

WIP: Fixed wing control API #24056

wants to merge 15 commits into from

Conversation

RomanBapst
Copy link
Contributor

@RomanBapst RomanBapst commented Nov 29, 2024

Solved Problem

Implement fixed wing control API for lateral and longitudinal control.

fw_control_arch drawio

Changelog Entry

For release notes:

Feature/Bugfix XYZ
New parameter: XYZ_Z
Documentation: Need to clarify page ... / done, read docs.px4.io/...

Alternatives

We could also ...

Test coverage

Context

Related links, screenshot before/after, video

Copy link

github-actions bot commented Dec 20, 2024

🔎 FLASH Analysis

px4_fmu-v5x [Total VM Diff: 5844 byte (0.28 %)]
    FILE SIZE        VM SIZE    
--------------  -------------- 
+0.3% +5.70Ki  +0.3% +5.70Ki    .text
  [NEW] +7.76Ki  [NEW] +7.76Ki    ../../src/modules/fw_lateral_longitudinal_control/FwLateralLongitudinalControl.cpp
  [NEW] +1.57Ki  [NEW] +1.57Ki    ../../src/lib/npfg/DirectionalGuidance.cpp
  +3.6% +1.20Ki  +3.6% +1.20Ki    ../../src/modules/uxrce_dds_client/uxrce_dds_client.cpp
  +0.4% +1.03Ki  +0.4% +1.03Ki    [section .text]
  [NEW]    +468  [NEW]    +468    ../../src/lib/npfg/CourseToAirspeedRefMapper.cpp
  [NEW]    +140  [NEW]    +140    ../../src/lib/npfg/AirspeedReferenceController.cpp
  +2.1%    +108  +2.1%    +108    ../../src/modules/logger/logged_topics.cpp
  [NEW]     +32  [NEW]     +32    msg/topics_sources/fw_lateral_control_setpoint.cpp
  [NEW]     +32  [NEW]     +32    msg/topics_sources/fw_longitudinal_control_setpoint.cpp
  [NEW]     +32  [NEW]     +32    msg/topics_sources/longitudinal_control_limits.cpp
  +2.0%     +24  +2.0%     +24    msg/topics_sources/uORBTopics.cpp
  +0.0%     +22  +0.0%     +22    ROMFS/nsh_romfsimg.c
  +0.4%     +16  +0.4%     +16    ../../src/modules/gimbal/input_mavlink.cpp
  +0.7%     +16  +0.7%     +16    builtin_list.c
  [NEW]     +16  [NEW]     +16    msg/topics_sources/lateral_control_limits.cpp
   +75%     +12   +75%     +12    msg/topics_sources/navigator_mission_item.cpp
 -100.0%      +4 -100.0%      +4    [6 Others]
 -27.3%     -12 -27.3%     -12    msg/topics_sources/normalized_unsigned_setpoint.cpp
 -50.0%     -16 -50.0%     -16    msg/topics_sources/logger_status.cpp
  [DEL] -2.61Ki  [DEL] -2.61Ki    ../../src/lib/npfg/npfg.cpp
 -14.9% -4.12Ki -14.9% -4.12Ki    ../../src/modules/fw_pos_control/FixedwingPositionControl.cpp
+0.2%      +8  +0.2%      +8    .data
  [NEW]      +4  [NEW]      +4    ../../src/modules/fw_lateral_longitudinal_control/FwLateralLongitudinalControl.cpp
  +100%      +4  +100%      +4    ../../src/modules/manual_control/ManualControl.cpp
+1.0%      +4  +1.0%      +4    .init_section
+0.5% +10.7Ki  [ = ]       0    .debug_abbrev
  [NEW] +1.48Ki  [ = ]       0    ../../src/lib/npfg/AirspeedReferenceController.cpp
  [NEW] +1.85Ki  [ = ]       0    ../../src/lib/npfg/CourseToAirspeedRefMapper.cpp
  [NEW] +2.05Ki  [ = ]       0    ../../src/lib/npfg/DirectionalGuidance.cpp
  [DEL] -2.18Ki  [ = ]       0    ../../src/lib/npfg/npfg.cpp
   +11%     +56  [ = ]       0    ../../src/lib/version/version.c
  [NEW] +4.10Ki  [ = ]       0    ../../src/modules/fw_lateral_longitudinal_control/FwLateralLongitudinalControl.cpp
  -4.2%    -190  [ = ]       0    ../../src/modules/fw_pos_control/FixedwingPositionControl.cpp
  -0.6%     -15  [ = ]       0    ../../src/modules/fw_pos_control/runway_takeoff/RunwayTakeoff.cpp
  [NEW]    +900  [ = ]       0    msg/topics_sources/fw_lateral_control_setpoint.cpp
  [NEW]    +900  [ = ]       0    msg/topics_sources/fw_longitudinal_control_setpoint.cpp
  [NEW]    +900  [ = ]       0    msg/topics_sources/lateral_control_limits.cpp
  [NEW]    +900  [ = ]       0    msg/topics_sources/longitudinal_control_limits.cpp
+0.4%    +712  [ = ]       0    .debug_aranges
  [NEW]     +40  [ = ]       0    ../../src/lib/npfg/AirspeedReferenceController.cpp
  [NEW]     +96  [ = ]       0    ../../src/lib/npfg/CourseToAirspeedRefMapper.cpp
  [NEW]    +184  [ = ]       0    ../../src/lib/npfg/DirectionalGuidance.cpp
  [DEL]    -272  [ = ]       0    ../../src/lib/npfg/npfg.cpp
  -5.0%      -8  [ = ]       0    ../../src/lib/version/version.c
  [NEW]    +520  [ = ]       0    ../../src/modules/fw_lateral_longitudinal_control/FwLateralLongitudinalControl.cpp
  -5.0%     -64  [ = ]       0    ../../src/modules/fw_pos_control/FixedwingPositionControl.cpp
   +15%     +88  [ = ]       0    ../../src/modules/uxrce_dds_client/uxrce_dds_client.cpp
  [NEW]     +32  [ = ]       0    msg/topics_sources/fw_lateral_control_setpoint.cpp
  [NEW]     +32  [ = ]       0    msg/topics_sources/fw_longitudinal_control_setpoint.cpp
  [NEW]     +32  [ = ]       0    msg/topics_sources/lateral_control_limits.cpp
  [NEW]     +32  [ = ]       0    msg/topics_sources/longitudinal_control_limits.cpp
+0.4% +1.85Ki  [ = ]       0    .debug_frame
+0.7%  +192Ki  [ = ]       0    .debug_info
  +0.4%     +42  [ = ]       0    ../../platforms/common/uORB/Subscription.cpp
  +0.3%     +42  [ = ]       0    ../../platforms/common/uORB/SubscriptionInterval.cpp
  +0.1%     +42  [ = ]       0    ../../platforms/common/uORB/uORB.cpp
  +0.2%     +42  [ = ]       0    ../../platforms/common/uORB/uORBDeviceMaster.cpp
  +0.2%     +42  [ = ]       0    ../../platforms/common/uORB/uORBDeviceNode.cpp
  +0.2%     +42  [ = ]       0    ../../platforms/common/uORB/uORBManager.cpp
  +0.2%     +42  [ = ]       0    ../../platforms/nuttx/src/px4/common/gpio/mcp23009/mcp23009.cpp
  +0.2%     +42  [ = ]       0    ../../src/drivers/adc/ads1115/ads1115_main.cpp
  +0.2%     +42  [ = ]       0    ../../src/drivers/adc/board_adc/ADC.cpp
  +0.2%     +42  [ = ]       0    ../../src/drivers/barometer/bmp388/bmp388.cpp
  +0.2%     +42  [ = ]       0    ../../src/drivers/barometer/ms5611/ms5611.cpp
  +0.2%     +42  [ = ]       0    ../../src/drivers/camera_capture/camera_capture.cpp
  +0.1%     +42  [ = ]       0    ../../src/drivers/camera_trigger/camera_trigger.cpp
  +0.1%     +42  [ = ]       0    ../../src/drivers/cdcacm_autostart/cdcacm_autostart.cpp
  +0.2%     +42  [ = ]       0    ../../src/drivers/differential_pressure/ms4525do/MS4525DO.cpp
  +0.2%     +42  [ = ]       0    ../../src/drivers/differential_pressure/ms5525dso/MS5525DSO.cpp
  +0.2%     +42  [ = ]       0    ../../src/drivers/differential_pressure/sdp3x/SDP3X.cpp
  +0.2%     +42  [ = ]       0    ../../src/drivers/distance_sensor/cm8jl65/CM8JL65.cpp
  +0.1%     +42  [ = ]       0    ../../src/drivers/distance_sensor/lightware_laser_i2c/lightware_laser_i2c.cpp
  +0.2%     +42  [ = ]       0    ../../src/drivers/distance_sensor/lightware_laser_serial/lightware_laser_serial.cpp
 -98.9%  +191Ki  [ = ]       0    [485 Others]
+0.4% +19.4Ki  [ = ]       0    .debug_line
  [NEW] +1.30Ki  [ = ]       0    ../../src/lib/npfg/AirspeedReferenceController.cpp
  [NEW] +2.23Ki  [ = ]       0    ../../src/lib/npfg/CourseToAirspeedRefMapper.cpp
  [NEW] +3.84Ki  [ = ]       0    ../../src/lib/npfg/DirectionalGuidance.cpp
  [DEL] -5.75Ki  [ = ]       0    ../../src/lib/npfg/npfg.cpp
  -1.3%     -25  [ = ]       0    ../../src/lib/version/version.c
  [NEW] +19.3Ki  [ = ]       0    ../../src/modules/fw_lateral_longitudinal_control/FwLateralLongitudinalControl.cpp
 -17.1% -9.21Ki  [ = ]       0    ../../src/modules/fw_pos_control/FixedwingPositionControl.cpp
  -0.2%      -6  [ = ]       0    ../../src/modules/fw_pos_control/runway_takeoff/RunwayTakeoff.cpp
  +0.6%     +37  [ = ]       0    ../../src/modules/logger/logged_topics.cpp
  +0.0%      +8  [ = ]       0    ../../src/modules/logger/logger.cpp
  +4.3% +2.29Ki  [ = ]       0    ../../src/modules/uxrce_dds_client/uxrce_dds_client.cpp
  [NEW] +1.31Ki  [ = ]       0    msg/topics_sources/fw_lateral_control_setpoint.cpp
  [NEW] +1.32Ki  [ = ]       0    msg/topics_sources/fw_longitudinal_control_setpoint.cpp
  [NEW] +1.30Ki  [ = ]       0    msg/topics_sources/lateral_control_limits.cpp
  [NEW] +1.31Ki  [ = ]       0    msg/topics_sources/longitudinal_control_limits.cpp
  +2.3%    +132  [ = ]       0    msg/topics_sources/uORBTopics.cpp
+0.3% +15.8Ki  [ = ]       0    .debug_loc
  -0.5%     -15  [ = ]       0    ../../src/drivers/camera_capture/camera_capture.cpp
  +0.2%     +15  [ = ]       0    ../../src/drivers/distance_sensor/lightware_laser_i2c/lightware_laser_i2c.cpp
  -0.1%     -15  [ = ]       0    ../../src/drivers/px4io/px4io.cpp
  +0.2%     +15  [ = ]       0    ../../src/drivers/rc/crsf_rc/CrsfRc.cpp
  +1.2%     +15  [ = ]       0    ../../src/drivers/rc/ghst_rc/ghst_telemetry.cpp
  +0.3%     +13  [ = ]       0    ../../src/drivers/rc_input/crsf_telemetry.cpp
  +0.2%     +15  [ = ]       0    ../../src/drivers/telemetry/bst/bst.cpp
  +0.7%     +30  [ = ]       0    ../../src/drivers/telemetry/frsky_telemetry/sPort_data.cpp
  +0.0%     +15  [ = ]       0    ../../src/drivers/uavcan/uavcan_main.cpp
  +0.1%     +46  [ = ]       0    ../../src/drivers/uavcan/uavcan_servers.cpp
  +2.8%    +396  [ = ]       0    ../../src/lib/avoidance/ObstacleAvoidance.cpp
  +1.5%    +383  [ = ]       0    ../../src/lib/collision_prevention/CollisionPrevention.cpp
   +26% +1.78Ki  [ = ]       0    ../../src/lib/fw_performance_model/PerformanceModel.cpp
  [NEW] +1.25Ki  [ = ]       0    ../../src/lib/npfg/AirspeedReferenceController.cpp
  [NEW] +4.87Ki  [ = ]       0    ../../src/lib/npfg/CourseToAirspeedRefMapper.cpp
  [NEW] +9.07Ki  [ = ]       0    ../../src/lib/npfg/DirectionalGuidance.cpp
  [DEL] -14.9Ki  [ = ]       0    ../../src/lib/npfg/npfg.cpp
  +6.0%    +398  [ = ]       0    ../../src/lib/rtl/rtl_time_estimator.cpp
  -0.2%     -13  [ = ]       0    ../../src/lib/weather_vane/WeatherVane.cpp
  -0.1%     -15  [ = ]       0    ../../src/modules/airspeed_selector/airspeed_selector_main.cpp
 -99.4% +12.5Ki  [ = ]       0    [49 Others]
+0.2% +2.73Ki  [ = ]       0    .debug_ranges
  +0.9%     +24  [ = ]       0    ../../src/lib/avoidance/ObstacleAvoidance.cpp
  +0.4%     +24  [ = ]       0    ../../src/lib/collision_prevention/CollisionPrevention.cpp
   +27%    +400  [ = ]       0    ../../src/lib/fw_performance_model/PerformanceModel.cpp
  [NEW]    +176  [ = ]       0    ../../src/lib/npfg/AirspeedReferenceController.cpp
  [NEW]    +728  [ = ]       0    ../../src/lib/npfg/CourseToAirspeedRefMapper.cpp
  [NEW] +1.34Ki  [ = ]       0    ../../src/lib/npfg/DirectionalGuidance.cpp
  [DEL] -2.10Ki  [ = ]       0    ../../src/lib/npfg/npfg.cpp
  +1.6%     +24  [ = ]       0    ../../src/lib/rtl/rtl_time_estimator.cpp
  -2.6%      -8  [ = ]       0    ../../src/lib/version/version.c
  +3.8%     +24  [ = ]       0    ../../src/modules/commander/HealthAndArmingChecks/checks/windCheck.cpp
  +0.3%     +24  [ = ]       0    ../../src/modules/flight_mode_manager/tasks/Auto/FlightTaskAuto.cpp
  +0.4%     +24  [ = ]       0    ../../src/modules/flight_mode_manager/tasks/AutoFollowTarget/FlightTaskAutoFollowTarget.cpp
  +1.1%     +24  [ = ]       0    ../../src/modules/flight_mode_manager/tasks/ManualAltitude/FlightTaskManualAltitude.cpp
  +0.9%     +24  [ = ]       0    ../../src/modules/flight_mode_manager/tasks/ManualPosition/FlightTaskManualPosition.cpp
  +0.4%     +24  [ = ]       0    ../../src/modules/flight_mode_manager/tasks/Orbit/FlightTaskOrbit.cpp
  +0.6%     +24  [ = ]       0    ../../src/modules/flight_mode_manager/tasks/Utility/StickAccelerationXY.cpp
  [NEW] +8.40Ki  [ = ]       0    ../../src/modules/fw_lateral_longitudinal_control/FwLateralLongitudinalControl.cpp
 -27.1% -6.33Ki  [ = ]       0    ../../src/modules/fw_pos_control/FixedwingPositionControl.cpp
  -0.6%      -8  [ = ]       0    ../../src/modules/logger/logged_topics.cpp
  +0.1%      +8  [ = ]       0    ../../src/modules/logger/logger.cpp
 -100.1%     -73  [ = ]       0    [10 Others]
+0.3% +10.0Ki  [ = ]       0    .debug_str
  +0.7%    +402  [ = ]       0    
  +1.0%    +169  [ = ]       0    ../../src/drivers/adc/ads1115/ads1115_main.cpp
  -4.4%     -11  [ = ]       0    ../../src/lib/airspeed/airspeed.cpp
  -1.8%     -36  [ = ]       0    ../../src/lib/battery/battery.cpp
  -0.1%      -1  [ = ]       0    ../../src/lib/control_allocation/control_allocation/ControlAllocation.cpp
   +13%     +78  [ = ]       0    ../../src/lib/geo/geo.cpp
  [NEW]     +98  [ = ]       0    ../../src/lib/npfg/AirspeedReferenceController.cpp
  [NEW]     +73  [ = ]       0    ../../src/lib/npfg/CourseToAirspeedRefMapper.cpp
  [NEW]    +463  [ = ]       0    ../../src/lib/npfg/DirectionalGuidance.cpp
  [DEL]    -561  [ = ]       0    ../../src/lib/npfg/npfg.cpp
  -1.9%     -60  [ = ]       0    ../../src/modules/ekf2/EKF/yaw_estimator/EKFGSF_yaw.cpp
 -22.7%    -239  [ = ]       0    ../../src/modules/flight_mode_manager/tasks/Transition/FlightTaskTransition.cpp
  [NEW] +50.0Ki  [ = ]       0    ../../src/modules/fw_lateral_longitudinal_control/FwLateralLongitudinalControl.cpp
 -36.3% -40.8Ki  [ = ]       0    ../../src/modules/fw_pos_control/FixedwingPositionControl.cpp
 -15.4%     -44  [ = ]       0    ../../src/modules/fw_pos_control/runway_takeoff/RunwayTakeoff.cpp
  -7.8%     -33  [ = ]       0    ../../src/modules/landing_target_estimator/LandingTargetEstimator.cpp
  -0.0%     -11  [ = ]       0    ../../src/modules/logger/logger.cpp
  -0.1%      -7  [ = ]       0    ../../src/modules/mc_att_control/mc_att_control_main.cpp
  -0.9%      -7  [ = ]       0    ../../src/modules/mc_pos_control/PositionControl/ControlMath.cpp
   +19%      +7  [ = ]       0    ../../src/modules/mc_pos_control/Takeoff/Takeoff.cpp
 -99.9%    +590  [ = ]       0    [10 Others]
+0.5% +3.29Ki  [ = ]       0    .strtab
  [NEW]    +128  [ = ]       0    ../../src/lib/npfg/AirspeedReferenceController.cpp
  [NEW]    +386  [ = ]       0    ../../src/lib/npfg/CourseToAirspeedRefMapper.cpp
  [NEW]    +670  [ = ]       0    ../../src/lib/npfg/DirectionalGuidance.cpp
  [DEL]    -762  [ = ]       0    ../../src/lib/npfg/npfg.cpp
  -1.9%     -35  [ = ]       0    ../../src/lib/tecs/TECS.cpp
  -8.1%     -32  [ = ]       0    ../../src/lib/version/version.c
  [NEW] +2.47Ki  [ = ]       0    ../../src/modules/fw_lateral_longitudinal_control/FwLateralLongitudinalControl.cpp
  -6.5%    -540  [ = ]       0    ../../src/modules/fw_pos_control/FixedwingPositionControl.cpp
  -0.2%      -1  [ = ]       0    ../../src/modules/fw_pos_control/runway_takeoff/RunwayTakeoff.cpp
  +1.6%     +40  [ = ]       0    ../../src/modules/gimbal/input_mavlink.cpp
   +11%    +369  [ = ]       0    ../../src/modules/uxrce_dds_client/uxrce_dds_client.cpp
  +0.5%    +413  [ = ]       0    [section .strtab]
  [NEW]     +66  [ = ]       0    msg/topics_sources/fw_lateral_control_setpoint.cpp
  [NEW]     +76  [ = ]       0    msg/topics_sources/fw_longitudinal_control_setpoint.cpp
  [NEW]     +29  [ = ]       0    msg/topics_sources/lateral_control_limits.cpp
  [NEW]     +34  [ = ]       0    msg/topics_sources/longitudinal_control_limits.cpp
+0.4% +2.17Ki  [ = ]       0    .symtab
 -16.7%     -16  [ = ]       0    ../../platforms/nuttx/src/px4/common/board_fat_dma_alloc.c
  -1.9%     -16  [ = ]       0    ../../src/drivers/barometer/bmp388/bmp388_spi.cpp
  +0.9%     +16  [ = ]       0    ../../src/drivers/distance_sensor/vl53l1x/vl53l1x.cpp
  -2.1%     -16  [ = ]       0    ../../src/drivers/gps/devices/src/nmea.cpp
  +0.7%     +16  [ = ]       0    ../../src/drivers/gps/gps.cpp
  -1.5%     -16  [ = ]       0    ../../src/drivers/imu/invensense/icm20948/ICM20948_I2C_Passthrough.cpp
  +1.4%     +16  [ = ]       0    ../../src/drivers/power_monitor/ina238/ina238.cpp
  +0.1%     +16  [ = ]       0    ../../src/drivers/uavcan/uavcan_main.cpp
  -0.4%     -16  [ = ]       0    ../../src/drivers/uavcan/uavcan_servers.cpp
  [NEW]    +128  [ = ]       0    ../../src/lib/npfg/AirspeedReferenceController.cpp
  [NEW]    +208  [ = ]       0    ../../src/lib/npfg/CourseToAirspeedRefMapper.cpp
  [NEW]    +560  [ = ]       0    ../../src/lib/npfg/DirectionalGuidance.cpp
  [DEL]    -832  [ = ]       0    ../../src/lib/npfg/npfg.cpp
  -2.8%     -32  [ = ]       0    ../../src/lib/tecs/TECS.cpp
  -7.0%     -64  [ = ]       0    ../../src/lib/version/version.c
  +1.9%     +16  [ = ]       0    ../../src/modules/commander/HealthAndArmingChecks/HealthAndArmingChecks.cpp
  +3.6%     +16  [ = ]       0    ../../src/modules/control_allocator/VehicleActuatorEffectiveness/ActuatorEffectivenessTilts.cpp
  +1.4%     +16  [ = ]       0    ../../src/modules/esc_battery/EscBattery.cpp
  [NEW] +2.12Ki  [ = ]       0    ../../src/modules/fw_lateral_longitudinal_control/FwLateralLongitudinalControl.cpp
  -9.5%    -576  [ = ]       0    ../../src/modules/fw_pos_control/FixedwingPositionControl.cpp
 -99.5%    +624  [ = ]       0    [12 Others]
-48.3% -5.70Ki  [ = ]       0    [Unmapped]
+0.5%  +259Ki  +0.3% +5.71Ki    TOTAL

px4_fmu-v6x [Total VM Diff: 5852 byte (0.3 %)]
    FILE SIZE        VM SIZE    
--------------  -------------- 
+0.3% +5.71Ki  +0.3% +5.71Ki    .text
  [NEW] +7.76Ki  [NEW] +7.76Ki    ../../src/modules/fw_lateral_longitudinal_control/FwLateralLongitudinalControl.cpp
  [NEW] +1.57Ki  [NEW] +1.57Ki    ../../src/lib/npfg/DirectionalGuidance.cpp
  +3.6% +1.20Ki  +3.6% +1.20Ki    ../../src/modules/uxrce_dds_client/uxrce_dds_client.cpp
  +0.4% +1.04Ki  +0.4% +1.04Ki    [section .text]
  [NEW]    +468  [NEW]    +468    ../../src/lib/npfg/CourseToAirspeedRefMapper.cpp
  [NEW]    +140  [NEW]    +140    ../../src/lib/npfg/AirspeedReferenceController.cpp
  +2.1%    +108  +2.1%    +108    ../../src/modules/logger/logged_topics.cpp
  [NEW]     +32  [NEW]     +32    msg/topics_sources/fw_lateral_control_setpoint.cpp
  [NEW]     +32  [NEW]     +32    msg/topics_sources/fw_longitudinal_control_setpoint.cpp
  [NEW]     +32  [NEW]     +32    msg/topics_sources/longitudinal_control_limits.cpp
  +2.0%     +24  +2.0%     +24    msg/topics_sources/uORBTopics.cpp
  +0.0%     +22  +0.0%     +22    ROMFS/nsh_romfsimg.c
  +0.4%     +16  +0.4%     +16    ../../src/modules/gimbal/input_mavlink.cpp
  +0.8%     +16  +0.8%     +16    builtin_list.c
  [NEW]     +16  [NEW]     +16    msg/topics_sources/lateral_control_limits.cpp
   +75%     +12   +75%     +12    msg/topics_sources/navigator_mission_item.cpp
 -100.0%      +7 -100.0%      +7    [7 Others]
 -27.3%     -12 -27.3%     -12    msg/topics_sources/normalized_unsigned_setpoint.cpp
 -50.0%     -16 -50.0%     -16    msg/topics_sources/logger_status.cpp
  [DEL] -2.61Ki  [DEL] -2.61Ki    ../../src/lib/npfg/npfg.cpp
 -14.9% -4.12Ki -14.9% -4.12Ki    ../../src/modules/fw_pos_control/FixedwingPositionControl.cpp
+1.1%      +4  +1.1%      +4    .init_section
+0.6% +10.7Ki  [ = ]       0    .debug_abbrev
  [NEW] +1.48Ki  [ = ]       0    ../../src/lib/npfg/AirspeedReferenceController.cpp
  [NEW] +1.85Ki  [ = ]       0    ../../src/lib/npfg/CourseToAirspeedRefMapper.cpp
  [NEW] +2.05Ki  [ = ]       0    ../../src/lib/npfg/DirectionalGuidance.cpp
  [DEL] -2.18Ki  [ = ]       0    ../../src/lib/npfg/npfg.cpp
   +11%     +56  [ = ]       0    ../../src/lib/version/version.c
  [NEW] +4.10Ki  [ = ]       0    ../../src/modules/fw_lateral_longitudinal_control/FwLateralLongitudinalControl.cpp
  -4.2%    -190  [ = ]       0    ../../src/modules/fw_pos_control/FixedwingPositionControl.cpp
  -0.6%     -15  [ = ]       0    ../../src/modules/fw_pos_control/runway_takeoff/RunwayTakeoff.cpp
  [NEW]    +900  [ = ]       0    msg/topics_sources/fw_lateral_control_setpoint.cpp
  [NEW]    +900  [ = ]       0    msg/topics_sources/fw_longitudinal_control_setpoint.cpp
  [NEW]    +900  [ = ]       0    msg/topics_sources/lateral_control_limits.cpp
  [NEW]    +900  [ = ]       0    msg/topics_sources/longitudinal_control_limits.cpp
+0.4%    +712  [ = ]       0    .debug_aranges
  [NEW]     +40  [ = ]       0    ../../src/lib/npfg/AirspeedReferenceController.cpp
  [NEW]     +96  [ = ]       0    ../../src/lib/npfg/CourseToAirspeedRefMapper.cpp
  [NEW]    +184  [ = ]       0    ../../src/lib/npfg/DirectionalGuidance.cpp
  [DEL]    -272  [ = ]       0    ../../src/lib/npfg/npfg.cpp
  -5.0%      -8  [ = ]       0    ../../src/lib/version/version.c
  [NEW]    +520  [ = ]       0    ../../src/modules/fw_lateral_longitudinal_control/FwLateralLongitudinalControl.cpp
  -5.0%     -64  [ = ]       0    ../../src/modules/fw_pos_control/FixedwingPositionControl.cpp
   +15%     +88  [ = ]       0    ../../src/modules/uxrce_dds_client/uxrce_dds_client.cpp
  [NEW]     +32  [ = ]       0    msg/topics_sources/fw_lateral_control_setpoint.cpp
  [NEW]     +32  [ = ]       0    msg/topics_sources/fw_longitudinal_control_setpoint.cpp
  [NEW]     +32  [ = ]       0    msg/topics_sources/lateral_control_limits.cpp
  [NEW]     +32  [ = ]       0    msg/topics_sources/longitudinal_control_limits.cpp
+0.4% +1.85Ki  [ = ]       0    .debug_frame
+0.7%  +191Ki  [ = ]       0    .debug_info
  +0.4%     +42  [ = ]       0    ../../platforms/common/uORB/Subscription.cpp
  +0.3%     +42  [ = ]       0    ../../platforms/common/uORB/SubscriptionInterval.cpp
  +0.1%     +42  [ = ]       0    ../../platforms/common/uORB/uORB.cpp
  +0.2%     +42  [ = ]       0    ../../platforms/common/uORB/uORBDeviceMaster.cpp
  +0.2%     +42  [ = ]       0    ../../platforms/common/uORB/uORBDeviceNode.cpp
  +0.2%     +42  [ = ]       0    ../../platforms/common/uORB/uORBManager.cpp
  +0.2%     +42  [ = ]       0    ../../platforms/nuttx/src/px4/common/gpio/mcp23009/mcp23009.cpp
  +0.2%     +42  [ = ]       0    ../../src/drivers/adc/ads1115/ads1115_main.cpp
  +0.2%     +42  [ = ]       0    ../../src/drivers/adc/board_adc/ADC.cpp
  +0.2%     +42  [ = ]       0    ../../src/drivers/barometer/bmp388/bmp388.cpp
  +0.1%     +42  [ = ]       0    ../../src/drivers/barometer/invensense/icp201xx/ICP201XX.cpp
  +0.2%     +42  [ = ]       0    ../../src/drivers/barometer/ms5611/ms5611.cpp
  +0.2%     +42  [ = ]       0    ../../src/drivers/camera_capture/camera_capture.cpp
  +0.1%     +42  [ = ]       0    ../../src/drivers/camera_trigger/camera_trigger.cpp
  +0.1%     +42  [ = ]       0    ../../src/drivers/cdcacm_autostart/cdcacm_autostart.cpp
  +0.2%     +42  [ = ]       0    ../../src/drivers/differential_pressure/ms4525do/MS4525DO.cpp
  +0.2%     +42  [ = ]       0    ../../src/drivers/differential_pressure/ms5525dso/MS5525DSO.cpp
  +0.2%     +42  [ = ]       0    ../../src/drivers/differential_pressure/sdp3x/SDP3X.cpp
  +0.2%     +42  [ = ]       0    ../../src/drivers/distance_sensor/cm8jl65/CM8JL65.cpp
  +0.1%     +42  [ = ]       0    ../../src/drivers/distance_sensor/lightware_laser_i2c/lightware_laser_i2c.cpp
 -98.9%  +190Ki  [ = ]       0    [469 Others]
+0.4% +19.4Ki  [ = ]       0    .debug_line
  [NEW] +1.30Ki  [ = ]       0    ../../src/lib/npfg/AirspeedReferenceController.cpp
  [NEW] +2.23Ki  [ = ]       0    ../../src/lib/npfg/CourseToAirspeedRefMapper.cpp
  [NEW] +3.84Ki  [ = ]       0    ../../src/lib/npfg/DirectionalGuidance.cpp
  [DEL] -5.75Ki  [ = ]       0    ../../src/lib/npfg/npfg.cpp
  -1.3%     -25  [ = ]       0    ../../src/lib/version/version.c
  [NEW] +19.3Ki  [ = ]       0    ../../src/modules/fw_lateral_longitudinal_control/FwLateralLongitudinalControl.cpp
 -17.1% -9.21Ki  [ = ]       0    ../../src/modules/fw_pos_control/FixedwingPositionControl.cpp
  -0.2%      -6  [ = ]       0    ../../src/modules/fw_pos_control/runway_takeoff/RunwayTakeoff.cpp
  +0.6%     +37  [ = ]       0    ../../src/modules/logger/logged_topics.cpp
  +0.0%      +8  [ = ]       0    ../../src/modules/logger/logger.cpp
  +4.3% +2.29Ki  [ = ]       0    ../../src/modules/uxrce_dds_client/uxrce_dds_client.cpp
  [NEW] +1.31Ki  [ = ]       0    msg/topics_sources/fw_lateral_control_setpoint.cpp
  [NEW] +1.32Ki  [ = ]       0    msg/topics_sources/fw_longitudinal_control_setpoint.cpp
  [NEW] +1.30Ki  [ = ]       0    msg/topics_sources/lateral_control_limits.cpp
  [NEW] +1.31Ki  [ = ]       0    msg/topics_sources/longitudinal_control_limits.cpp
  +2.3%    +132  [ = ]       0    msg/topics_sources/uORBTopics.cpp
  -0.5%      -6  [ = ]       0    task/task_cancelpt.c
+0.3% +15.6Ki  [ = ]       0    .debug_loc
  +0.4%     +15  [ = ]       0    ../../src/drivers/adc/board_adc/ADC.cpp
  -0.2%     -15  [ = ]       0    ../../src/drivers/camera_trigger/camera_trigger.cpp
  +0.2%     +15  [ = ]       0    ../../src/drivers/distance_sensor/lightware_laser_i2c/lightware_laser_i2c.cpp
  +0.2%     +15  [ = ]       0    ../../src/drivers/osd/msp_osd/msp_osd.cpp
  -0.1%     -15  [ = ]       0    ../../src/drivers/px4io/px4io.cpp
  +1.2%     +13  [ = ]       0    ../../src/drivers/rc_input/ghst_telemetry.cpp
  -0.1%     -15  [ = ]       0    ../../src/drivers/uavcan/remoteid.cpp
  +0.0%     +13  [ = ]       0    ../../src/drivers/uavcan/uavcan_main.cpp
  -0.0%     -26  [ = ]       0    ../../src/drivers/uavcan/uavcan_servers.cpp
  +0.3%     +15  [ = ]       0    ../../src/lib/adsb/AdsbConflict.cpp
  +2.8%    +396  [ = ]       0    ../../src/lib/avoidance/ObstacleAvoidance.cpp
  +1.6%    +398  [ = ]       0    ../../src/lib/collision_prevention/CollisionPrevention.cpp
   +26% +1.78Ki  [ = ]       0    ../../src/lib/fw_performance_model/PerformanceModel.cpp
  +0.1%     +16  [ = ]       0    ../../src/lib/mixer_module/mixer_module.cpp
  [NEW] +1.25Ki  [ = ]       0    ../../src/lib/npfg/AirspeedReferenceController.cpp
  [NEW] +4.87Ki  [ = ]       0    ../../src/lib/npfg/CourseToAirspeedRefMapper.cpp
  [NEW] +9.07Ki  [ = ]       0    ../../src/lib/npfg/DirectionalGuidance.cpp
  [DEL] -14.9Ki  [ = ]       0    ../../src/lib/npfg/npfg.cpp
  +6.0%    +398  [ = ]       0    ../../src/lib/rtl/rtl_time_estimator.cpp
  -0.2%     -13  [ = ]       0    ../../src/lib/weather_vane/WeatherVane.cpp
 -99.4% +12.3Ki  [ = ]       0    [45 Others]
+0.2% +2.73Ki  [ = ]       0    .debug_ranges
  +0.9%     +24  [ = ]       0    ../../src/lib/avoidance/ObstacleAvoidance.cpp
  +0.4%     +24  [ = ]       0    ../../src/lib/collision_prevention/CollisionPrevention.cpp
   +27%    +400  [ = ]       0    ../../src/lib/fw_performance_model/PerformanceModel.cpp
  [NEW]    +176  [ = ]       0    ../../src/lib/npfg/AirspeedReferenceController.cpp
  [NEW]    +728  [ = ]       0    ../../src/lib/npfg/CourseToAirspeedRefMapper.cpp
  [NEW] +1.34Ki  [ = ]       0    ../../src/lib/npfg/DirectionalGuidance.cpp
  [DEL] -2.10Ki  [ = ]       0    ../../src/lib/npfg/npfg.cpp
  +1.6%     +24  [ = ]       0    ../../src/lib/rtl/rtl_time_estimator.cpp
  -2.6%      -8  [ = ]       0    ../../src/lib/version/version.c
  +3.8%     +24  [ = ]       0    ../../src/modules/commander/HealthAndArmingChecks/checks/windCheck.cpp
  +0.3%     +24  [ = ]       0    ../../src/modules/flight_mode_manager/tasks/Auto/FlightTaskAuto.cpp
  +0.4%     +24  [ = ]       0    ../../src/modules/flight_mode_manager/tasks/AutoFollowTarget/FlightTaskAutoFollowTarget.cpp
  +1.1%     +24  [ = ]       0    ../../src/modules/flight_mode_manager/tasks/ManualAltitude/FlightTaskManualAltitude.cpp
  +0.9%     +24  [ = ]       0    ../../src/modules/flight_mode_manager/tasks/ManualPosition/FlightTaskManualPosition.cpp
  +0.4%     +24  [ = ]       0    ../../src/modules/flight_mode_manager/tasks/Orbit/FlightTaskOrbit.cpp
  +0.6%     +24  [ = ]       0    ../../src/modules/flight_mode_manager/tasks/Utility/StickAccelerationXY.cpp
  [NEW] +8.40Ki  [ = ]       0    ../../src/modules/fw_lateral_longitudinal_control/FwLateralLongitudinalControl.cpp
 -27.1% -6.33Ki  [ = ]       0    ../../src/modules/fw_pos_control/FixedwingPositionControl.cpp
  -0.6%      -8  [ = ]       0    ../../src/modules/logger/logged_topics.cpp
  +0.1%      +8  [ = ]       0    ../../src/modules/logger/logger.cpp
 -100.1%     -73  [ = ]       0    [10 Others]
+0.3% +10.7Ki  [ = ]       0    .debug_str
  +0.7%    +402  [ = ]       0    
  +1.0%    +169  [ = ]       0    ../../src/drivers/adc/ads1115/ads1115_main.cpp
  -4.4%     -11  [ = ]       0    ../../src/lib/airspeed/airspeed.cpp
  -1.8%     -36  [ = ]       0    ../../src/lib/battery/battery.cpp
  -0.1%      -1  [ = ]       0    ../../src/lib/control_allocation/control_allocation/ControlAllocation.cpp
   +13%     +78  [ = ]       0    ../../src/lib/geo/geo.cpp
  [NEW]     +98  [ = ]       0    ../../src/lib/npfg/AirspeedReferenceController.cpp
  [NEW]     +73  [ = ]       0    ../../src/lib/npfg/CourseToAirspeedRefMapper.cpp
  [NEW]    +463  [ = ]       0    ../../src/lib/npfg/DirectionalGuidance.cpp
  [DEL]    -561  [ = ]       0    ../../src/lib/npfg/npfg.cpp
  -1.9%     -60  [ = ]       0    ../../src/modules/ekf2/EKF/yaw_estimator/EKFGSF_yaw.cpp
 -22.7%    -239  [ = ]       0    ../../src/modules/flight_mode_manager/tasks/Transition/FlightTaskTransition.cpp
  [NEW] +50.7Ki  [ = ]       0    ../../src/modules/fw_lateral_longitudinal_control/FwLateralLongitudinalControl.cpp
 -36.3% -40.8Ki  [ = ]       0    ../../src/modules/fw_pos_control/FixedwingPositionControl.cpp
 -15.4%     -44  [ = ]       0    ../../src/modules/fw_pos_control/runway_takeoff/RunwayTakeoff.cpp
  -7.8%     -33  [ = ]       0    ../../src/modules/landing_target_estimator/LandingTargetEstimator.cpp
  -0.0%     -11  [ = ]       0    ../../src/modules/logger/logger.cpp
  -0.1%      -7  [ = ]       0    ../../src/modules/mc_att_control/mc_att_control_main.cpp
  -0.9%      -7  [ = ]       0    ../../src/modules/mc_pos_control/PositionControl/ControlMath.cpp
   +19%      +7  [ = ]       0    ../../src/modules/mc_pos_control/Takeoff/Takeoff.cpp
 -99.9%    +590  [ = ]       0    [10 Others]
+0.5% +3.29Ki  [ = ]       0    .strtab
  [NEW]    +128  [ = ]       0    ../../src/lib/npfg/AirspeedReferenceController.cpp
  [NEW]    +386  [ = ]       0    ../../src/lib/npfg/CourseToAirspeedRefMapper.cpp
  [NEW]    +670  [ = ]       0    ../../src/lib/npfg/DirectionalGuidance.cpp
  [DEL]    -762  [ = ]       0    ../../src/lib/npfg/npfg.cpp
  -1.9%     -35  [ = ]       0    ../../src/lib/tecs/TECS.cpp
  -8.1%     -32  [ = ]       0    ../../src/lib/version/version.c
  [NEW] +2.47Ki  [ = ]       0    ../../src/modules/fw_lateral_longitudinal_control/FwLateralLongitudinalControl.cpp
  -6.5%    -540  [ = ]       0    ../../src/modules/fw_pos_control/FixedwingPositionControl.cpp
  -0.2%      -1  [ = ]       0    ../../src/modules/fw_pos_control/runway_takeoff/RunwayTakeoff.cpp
  +1.6%     +40  [ = ]       0    ../../src/modules/gimbal/input_mavlink.cpp
   +11%    +369  [ = ]       0    ../../src/modules/uxrce_dds_client/uxrce_dds_client.cpp
  +0.5%    +413  [ = ]       0    [section .strtab]
  [NEW]     +66  [ = ]       0    msg/topics_sources/fw_lateral_control_setpoint.cpp
  [NEW]     +76  [ = ]       0    msg/topics_sources/fw_longitudinal_control_setpoint.cpp
  [NEW]     +29  [ = ]       0    msg/topics_sources/lateral_control_limits.cpp
  [NEW]     +34  [ = ]       0    msg/topics_sources/longitudinal_control_limits.cpp
+0.4% +2.17Ki  [ = ]       0    .symtab
  -1.9%     -16  [ = ]       0    ../../src/drivers/barometer/bmp388/bmp388_spi.cpp
  -8.3%     -16  [ = ]       0    ../../src/drivers/barometer/invensense/icp201xx/icp201xx_main.cpp
  -2.1%     -16  [ = ]       0    ../../src/drivers/gps/devices/src/nmea.cpp
  +0.7%     +16  [ = ]       0    ../../src/drivers/gps/gps.cpp
  -1.3%     -16  [ = ]       0    ../../src/drivers/uavcan/sensors/baro.cpp
  +0.1%     +16  [ = ]       0    ../../src/drivers/uavcan/uavcan_main.cpp
  -0.4%     -16  [ = ]       0    ../../src/drivers/uavcan/uavcan_servers.cpp
  +2.7%     +16  [ = ]       0    ../../src/lib/motion_planning/PositionSmoothing.cpp
  [NEW]    +128  [ = ]       0    ../../src/lib/npfg/AirspeedReferenceController.cpp
  [NEW]    +208  [ = ]       0    ../../src/lib/npfg/CourseToAirspeedRefMapper.cpp
  [NEW]    +560  [ = ]       0    ../../src/lib/npfg/DirectionalGuidance.cpp
  [DEL]    -832  [ = ]       0    ../../src/lib/npfg/npfg.cpp
  -2.8%     -32  [ = ]       0    ../../src/lib/tecs/TECS.cpp
  -7.0%     -64  [ = ]       0    ../../src/lib/version/version.c
  +1.9%     +16  [ = ]       0    ../../src/modules/commander/HealthAndArmingChecks/HealthAndArmingChecks.cpp
 -10.0%     -16  [ = ]       0    ../../src/modules/commander/HealthAndArmingChecks/checks/navigatorCheck.cpp
  -0.9%     -16  [ = ]       0    ../../src/modules/fw_att_control/FixedwingAttitudeControl.cpp
  [NEW] +2.16Ki  [ = ]       0    ../../src/modules/fw_lateral_longitudinal_control/FwLateralLongitudinalControl.cpp
  -9.5%    -576  [ = ]       0    ../../src/modules/fw_pos_control/FixedwingPositionControl.cpp
  -2.9%     -16  [ = ]       0    ../../src/modules/fw_pos_control/runway_takeoff/RunwayTakeoff.cpp
 -99.4%    +688  [ = ]       0    [11 Others]
-8.2% -5.71Ki  [ = ]       0    [Unmapped]
+0.6%  +258Ki  +0.3% +5.71Ki    TOTAL

Updated: 2025-02-06T14:17:01

@RomanBapst RomanBapst force-pushed the pr-fw_ctrl_api branch 2 times, most recently from f14b301 to 8405fa3 Compare January 8, 2025 12:39
Copy link
Contributor

@KonradRudin KonradRudin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like the restructuring, having the fixed wing position control more separated into the mode and the actual control. As well as having more intermediate options.
I went through all of it. but not in the complete detail yet, just when i saw something i mentioned it.
Biggest issue for me is that we don't yet have a clear way to tell, that the longitudinal and lateral controller should be enabled or not. Should be in the vehicle control mode flags propably like _vcontrol_mode.flag_control_rates_enabled

ROMFS/px4fmu_common/init.d/rc.vtol_apps Show resolved Hide resolved
msg/FwLongitudinalControlSetpoint.msg Outdated Show resolved Hide resolved
msg/FwLongitudinalControlSetpoint.msg Outdated Show resolved Hide resolved
float32 height_rate_setpoint # NAN if not controlled directly, used as feeforward if altitude_setpoint is finite [m/s]
float32 altitude_setpoint # NAN if not controlled, MSL [m]
float32 equivalent_airspeed_setpoint # [m/s]
float32 pitch_sp # NAN if not controlled, overrides total energy controller [rad]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess you can't use those as feedforwards, right? So shouldn't we keep that separate as an alternative to the attitudeSetpoint message?

float32 lateral_acceleration_setpoint # NAN if not controlled directly, used as feedforward if either course setpoint or airspeed_reference_direction is finite, [m/s^2]
float32 roll_sp # TODO: remove, only for testing

float32 heading_sp_runway_takeoff # [-pi, pi] heading setpoint for runway takeoff
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we want that here? If we have that the lateral control is not enabled anyways. Keep it separate?

@@ -116,13 +116,13 @@ class __EXPORT RunwayTakeoff : public ModuleParams
* @param external_pitch_setpoint Externally commanded pitch angle setpoint (usually from TECS) [rad]
* @return Pitch angle setpoint (limited while plane is on runway) [rad]
*/
float getPitch(float external_pitch_setpoint);
float getPitch();

/**
* @param external_roll_setpoint Externally commanded roll angle setpoint (usually from path navigation) [rad]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove

src/modules/fw_pos_control/FixedwingPositionControl.cpp Outdated Show resolved Hide resolved
longitudinal_control_limits.throttle_max = (_landed
|| !_local_pos.v_z_valid) ? _param_fw_thr_min.get() : _param_fw_thr_max.get();

_longitudinal_ctrl_limits_pub.publish(longitudinal_control_limits);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ATM you publish the limits on every loop, thats not needed for every mode. Alternatively, we could just reset the limits to default each time the mode changes and if required only the mode publishes the adjusted limits

float tecs_fw_thr_max;
const float acc_rad = _directional_guidance.switchDistance(500.0f);
float throttle_min = _param_fw_thr_min.get();
float throttle_max = _param_fw_thr_max.get();

if (pos_sp_curr.gliding_enabled) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is currently not handled, right? Check comment about the uorb topic, would be nice to have in the long control a field where you can specify normal mode or like here thrust/speed mode

Copy link
Member

@Jaeyoung-Lim Jaeyoung-Lim left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry that I am late to comment on this PR. I think there would be a lot of value of creating a FW API.

The api proposed have separate messages for longitudinal and lateral gudiance. This seems to be built on the assumption that lateral and longitudinal control (TECS) would be controlled in a decoupled way.

However, it would have been nicer if the api would be designed for more "generic" fixed-wing tasks, rather than exposing configurations of the underlying interface. IMO, an api should fully define what the vehicle "should" do for a given task (e.g. path following), rather than expose the underlying implementation.

  • Lateral/longitudinal controller decoupling is a design choice for a specific implementation. This would make it hard for other controllers to share the API, if the controllers do not have such decoupling (e.g. 3D NDI acceleration-based control).

  • The decoupling is not only not necessary for the task of path following, but can even limit what kind of paths we can follow in 3D. For example, if you try to track an inclined loiter(or any complex 3D path of arbitrary shape) the height rate setpoint in the FwLongitudinalSetpoint.msg is no longer usable, since the information on the 3D geometry is already lost (e.g. height rate depends on the speed and direction of the vehicle to stay on the path).

Is there a good reason that we want to enforce the separation of lateral/longitudinal control on the API side?
@tstastny

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants