The PX4 Autopilot project has made notable strides in enhancing the EKF2 module, focusing on improving state estimation accuracy and reliability.
Enhanced Reliability of EKF2 Module: Daniel Agar's multiple updates to the EKF2 module indicate a focus on improving the accuracy and reliability of the state estimation process. This includes more conservative fault status checks and better logging controls.
Hardware Driver Improvements: Peter van der Perk's work on improving dshot timing accuracy reflects ongoing efforts to enhance hardware compatibility and performance.
Battery Status Optimization: Silvan Fuhrer's removal of unused fields from battery status messages suggests a focus on optimizing data handling for battery management systems.
Bug Fixes and Critical Updates: Claudio Chies' bug fixes in GitHub workflows highlight attention to critical issues that ensure system stability.
Collaboration Across Modules: The presence of co-authored commits indicates active collaboration among team members, particularly in areas like battery management and state estimation.
A critical bug where uploading an invalid mission during flight can cause a crash during Return-to-Launch (RTL), posing a significant safety risk. This issue (#23340) needs immediate attention to prevent potential loss of vehicle and ensure safety during emergency procedures.
The failure of VTOL SITL tests on every pull request is disrupting the CI process, delaying development and integration of new features (#23275). This issue needs urgent resolution to unblock the CI pipeline and maintain development velocity.
Multiple PRs being left open without resolution indicate a potential decline in team velocity. This accumulation of unresolved PRs can slow down development progress and indicate bottlenecks in the review process. Addressing this requires assigning dedicated reviewers and implementing stricter timelines for PR reviews (#23236, #23233).
Changes in PR #23236 regarding gimbal control logic adjustments suggest potential prolonged disagreements or complexities in achieving consensus on control mechanisms. Facilitating discussions among key stakeholders can help reach a consensus and ensure thorough testing.
Recent updates to EKF2 modules involve complex algorithms and state estimation logic, which may not be clearly defined (#23233, #23229). Clarifying specifications and engaging domain experts can help refine implementation details.
New PRs such as #23403 add terrain and distance-to-bottom reset deltas to EKF2, enhancing terrain estimation accuracy. These improvements reflect ongoing efforts to refine state estimation processes within the project.
Enhanced Reliability of EKF2 Module: Daniel Agar's multiple updates to the EKF2 module indicate a focus on improving the accuracy and reliability of the state estimation process. This includes more conservative fault status checks and better logging controls.
Hardware Driver Improvements: Peter van der Perk's work on improving dshot timing accuracy reflects ongoing efforts to enhance hardware compatibility and performance.
Battery Status Optimization: Silvan Fuhrer's removal of unused fields from battery status messages suggests a focus on optimizing data handling for battery management systems.
Bug Fixes and Critical Updates: Claudio Chies' bug fixes in GitHub workflows highlight attention to critical issues that ensure system stability.
Collaboration Across Modules: The presence of co-authored commits indicates active collaboration among team members, particularly in areas like battery management and state estimation.
Since the last report seven days ago, there has been significant activity in the PX4 Autopilot Software project:
EKF2 Module Enhancements:
Setup Tools Fixes:
requirements.txt
, ensuring that setup tools are using correct syntax.UAVCAN Driver Adjustments:
fix_type
instead of valid_pos_cov
, likely improving GNSS time synchronization accuracy.NuttX Backports for SoC Support:
Submodule Updates:
System Resource Checks:
DDS Client Topic Updates:
vehicle_land_detected
to DDS topics, enhancing communication capabilities within the DDS client module.Overall, the recent activities reflect a strong focus on enhancing system reliability through parameter management, improving hardware compatibility with optimized drivers, maintaining up-to-date dependencies, and expanding system checks for better resource management.
Issue #23379: [Bug] SITL plane does not return to home correctly with RTL_TYPE = 2
Issue #23357: The heading angle calculation of dual antenna GPS is incorrect
Issue #23261: [Bug] uXRCE client is busy when the agent is close
Issue #23255: Mavlink receiver handle_message_set_position_target_local_ned method treats acceleration and velocity inconsistently
Issue #23029: [Bug] Mode switch from hold mode to an unassigned mode triggers mode change
Issue #22821: Pixhawk 4 unable to complete serial connection with MicroXRCEAgent
Issue #23361: Load Monitoring Inconsistent Behavior - Proposed Solution
Issue #23347: [Bug] V1.14.3 Orange Cube switching from Offboard mode to Hold mode repeatedly
Issue #23343: [Bug] new-delete-type-mismatch bug in PX4
Issue #23336: [Bug] make px4_sitl gazebo is not working
make px4_sitl gazebo
with PX4 v1.14.0.Issue #23378: [Bug] Modules do not react on parameter updates anymore
The recent activity reflects ongoing efforts to enhance PX4's capabilities, address various bugs, and improve system stability and reliability. Notable improvements include better handling of IMU bias process noise, enhanced gimbal control reliability, improved innovation monitoring in EKF2, expanded hardware support with new board additions like MRO Control Zero H7 OEM USART6 support, and addressing critical security vulnerabilities.
Several critical bugs have been fixed, particularly those affecting continuous integration (CI) processes, ensuring that new changes do not introduce regressions or instability into the system. The project continues to show significant progress in expanding its capabilities across different domains, including new hardware support, marine vehicle integration, and space robotics applications.
Overall, these changes reflect an active maintenance effort aimed at improving PX4's versatility, reliability, and developer experience across various modules of the system.
This pull request addresses a significant flash memory issue in the PX4 Autopilot codebase by optimizing the SubscriptionInterval
class. Specifically, it moves the updated()
, update()
, and copy()
methods from being inline in the header file to a separate implementation file (.cpp
). This change results in a substantial reduction of 17.3 kilobytes of flash memory usage.
File Additions and Modifications:
Code Changes:
updated()
, update()
, and copy()
were moved from being inline in the header file (SubscriptionInterval.hpp
) to a new implementation file (SubscriptionInterval.cpp
).Memory Optimization:
Code Maintainability:
.cpp
file can improve code maintainability and readability. It separates the interface from the implementation, making it easier to manage changes and understand the code structure.Performance Considerations:
Potential Runtime Overhead:
Testing and Validation:
top
output) before and after the changes on different boards/configurations. More extensive testing might be required to ensure there are no edge cases or performance regressions.+ SubscriptionInterval.cpp
SubscriptionInterval.cpp
to the build system.updated()
, update()
, and copy()
methods.- bool updated()
- {
- if (advertised() && (hrt_elapsed_time(&_last_update) >= _interval_us)) {
- return _subscription.updated();
- }
- return false;
- }
+ bool updated();
- bool update(void *dst)
- {
- if (updated()) {
- return copy(dst);
- }
- return false;
- }
+ bool update(void *dst);
- bool copy(void *dst)
- {
- if (_subscription.copy(dst)) {
- const hrt_abstime now = hrt_absolute_time();
- if (now > _interval_us) {
- _last_update = math::constrain(_last_update + _interval_us, now - _interval_us, now);
- } else {
- _last_update = now;
- }
- return true;
- }
- return false;
- }
+ bool copy(void *dst);
The changes introduced in PR #23395 are well-targeted at addressing a critical flash memory usage issue without introducing significant performance drawbacks. The move of method implementations from header files to a separate .cpp
file aligns with best practices for code maintainability and modularity.
Overall, this PR demonstrates good engineering judgment by balancing memory optimization with minimal impact on runtime performance. Further extensive testing would be beneficial to ensure robustness across all possible configurations and use cases within the PX4 Autopilot system.
Since the previous analysis 7 days ago, there has been significant activity in the PX4/PX4-Autopilot repository. Several new pull requests (PRs) have been created, and some notable PRs have been merged or closed. Below is a detailed analysis of the changes.
#23403: ekf2: add terrain/dist_bottom reset deltas (vehicle_local_position/vehicle_global_position)
#23402: ekf2: optical flow adjust jacobian epsilon to avoid numerical issues
#23401: ekf2: optical flow magnitude check compensated
#23400: ekf2: range finder cleanup duplicate logic
#23399: ekf2: filter flow vel (used for flow velocity reset)
#23398: ekf2: track last terrain fuse time and update logic
#23397: Don't shut off throttle in fast descend while still climbing State: Open, created: Created, Summary: Ensures throttle is not completely shut down during fast descent if the vehicle is still climbing. Significance:** Prevents potential stalling during fast descents.
#23396: Implemented protection against flying into terrain during landing State: Open, created: Created, Summary: Adds protection against flying into terrain during landing by maintaining a minimum distance from terrain. Significance: Enhances safety during landing approaches.
#23394: ekf2 stop mag fusion on numerical error State: Open, created: Created, Summary: Stops magnetometer fusion on numerical errors. Significance: Prevents potential issues caused by numerical errors in magnetometer fusion.
#23393: ekf2 consolidate GNSS yaw in gnss_yaw_control.cpp and fix naming (GPS->GNSS) State: Open, created: Created, Summary: Consolidates GNSS yaw control and fixes naming conventions from GPS to GNSS. Significance: Improves clarity and consistency in GNSS yaw control code.
#23395: Fix Save flash by not inlining SubscriptionInterval::copy()
State: Closed, created: Created, closed: Merged by Matthias Grob (MaEtUgR)
Summary: Moves SubscriptionInterval::copy()
to a separate cpp file to save flash memory.
Significance: Saves 17.3 kilobytes of flash memory, optimizing resource usage.
#23392: [1.15] Bugfix Timestamp wrapping when initializing SubscriptionInterval less than the interval time after boot
State: Closed, created: Created, closed: Merged by Matthias Grob (MaEtUgR)
Summary: Fixes timestamp wrapping issue when initializing SubscriptionInterval
shortly after boot.
Significance: Resolves potential issues caused by timestamp wrapping, ensuring reliable operation.
#23390: Update submodule gz to latest Thu Jul 11 00 39 09 UTC 2024. State: Closed, created: Created, closed: Merged by Daniel Agar (dagar) Summary: Updates the gz submodule to the latest version. Significance: Ensures compatibility with the latest gz-sim models.
#23385: FMU-V6XRT release/1.15 backports. State: Closed, created: Created, closed: Merged by Daniel Agar (dagar) Summary: Backports several fixes and enhancements to the FMU-V6XRT platform. Significance: Enhances stability and functionality of the FMU-V6XRT platform.
#23384: Bugfix Timestamp wrapping when initializing SubscriptionInterval less than the interval time after boot.
State: Closed, created: Created, closed: Merged by Daniel Agar (dagar)
Summary: Fixes timestamp wrapping issue when initializing SubscriptionInterval
shortly after boot.
Significance: Resolves potential issues caused by timestamp wrapping, ensuring reliable operation.
#23383: Add SITL airframe for ackermann rover. State: Closed, created: Created, closed: Merged by Daniel Agar (dagar) Summary: Adds a SITL airframe for testing the Ackermann rover model. Significance: Enhances testing capabilities for Ackermann rover models.
#23381:: boards add console build for Cube Orange(+). State:: Closed., created:: Created., closed:: Merged by Daniel Agar (dagar). Summary:: Adds a build variant with serial console enabled for Cube Orange(+) boards. Significance:: Provides an option for developers needing serial console access.
#23380:: drv_hrt allow time differences across timestamp wrap again. State:: Closed., created:: Created., closed:: Not merged. Summary:: Reverts a change that prevented time differences across timestamp wraps. Significance:: Addresses an issue causing failures due to timestamp wrapping.
#23377:: GH Actions MAVROS fix. State:: Closed., created:: Created., closed:: Merged by Daniel Agar (dagar). Summary:: Fixes failing MAVROS tests in GitHub Actions workflows. Significance:: Ensures continuous integration tests pass successfully.
#23375:: [gz-sim] x500_lidar for testing CollisionPrevention. State:: Closed., created:: Created., closed:: Merged by Claudio Chies (Claudio-Chies). Summary:: Adds x500_lidar model for testing collision prevention in gz-sim. Significance:: Enhances simulation capabilities for collision prevention testing.
There has been significant activity in the PX4/PX4-Autopilot repository since the last report. Several new PRs have been created, addressing various enhancements and bug fixes across different modules. Notably, there have been additions related to new hardware support, improvements in existing functionalities, and updates to CI/CD pipelines.
The recently merged PRs include critical bug fixes and enhancements that improve system stability and functionality. The ongoing PRs indicate active development efforts towards expanding hardware compatibility, improving control algorithms, and enhancing developer tools.
Overall, the repository is seeing active contributions that are likely to enhance its robustness and feature set in the near future.
platforms/common/uORB/SubscriptionInterval.cpp
Header and Licensing:
Namespace Usage:
uORB
namespace, which helps in avoiding name conflicts and improves code organization.Function Definitions:
updated()
, update(void *dst)
, and copy(void *dst)
.Code Quality:
hrt_elapsed_time
and hrt_absolute_time
indicates that the code is dealing with high-resolution timestamps, which is appropriate for real-time systems._last_update
ensures that the timestamp does not wrap around incorrectly, showing attention to detail in handling edge cases.Error Handling:
Efficiency:
math::constrain
to limit _last_update
ensures that the value remains within a valid range without excessive checks.src/modules/flight_mode_manager/tasks/Auto/FlightTaskAuto.cpp
Header and Licensing:
Class Definition:
FlightTaskAuto
inherits from FlightTask
, indicating a clear hierarchy and reuse of common functionality.Function Definitions:
activate
, update
, _prepareLandSetpoints
, etc., are logically grouped and named appropriately.Code Quality:
Vector3f
, Vector2f
, and other matrix operations indicates a focus on mathematical correctness.idle
, land
, velocity
, etc.) through a switch-case structure, making it easy to extend or modify.Error Handling:
FLT_EPSILON
for floating-point comparisons shows attention to numerical stability.Efficiency:
_checkEmergencyBraking
ensure safety by monitoring velocity bounds.src/modules/ekf2/EKF/covariance.cpp
Header and Licensing:
Function Definitions:
initialiseCovariance
, predictCovariance
, and constrainStateVariances
are logically grouped and named appropriately.Code Quality:
CONFIG_EKF2_GNSS
, CONFIG_EKF2_BAROMETER
, etc.) through preprocessor directives, making it modular and configurable.Error Handling:
FLT_EPSILON
for floating-point comparisons shows attention to numerical stability.Efficiency:
constrainStateVarLimitRatio
ensure that state variances remain within acceptable limits without excessive checks.boards/cubepilot/cubeorange/nuttx-config/console/defconfig
Header:
Configuration Options:
Code Quality:
msg/AirspeedValidated.msg
Message Definition:
timestamp
, indicated_airspeed_m_s
, etc.Field Descriptions:
Code Quality:
float32
, int8
) ensures efficient memory usage.Validation Flags:
airspeed_sensor_measurement_valid
provide validation flags, enhancing data integrity checks.src/modules/commander/HealthAndArmingChecks/checks/estimatorCheck.cpp
Header and Licensing:
Class Definition:
EstimatorChecks
encapsulates functionality related to estimator health checks.Function Definitions:
Code Quality:
Error Handling:
mavlink_log_critical
) to report errors, enhancing observability during runtime.Efficiency:
src/lib/mathlib/math/filter/FilteredDerivative.hpp
Header and Licensing:
Class Template Definition (FilteredDerivative
)
T
).AlphaFilter<T>
).Member Variables
_alpha_filter
: An instance of the AlphaFilter class used internally for filtering operations._sample_interval
: Stores the interval between samples; initialized to 0.f._previous_sample
: Stores the previous sample value; initialized to 0.f (default constructor)._initialized
: A boolean flag indicating whether the filter has been initialized; initialized to false.Member Functions
= default;
).setParameters(float sample_interval, float time_constant)
: Sets parameters of the alpha filter including sample interval & time constant.reset(const T &sample)
: Resets the filter state using an initial sample value & sets _initialized
flag to false.update(const T &sample)
: Updates the filter state using a new sample value if initialized; otherwise sets _initialized
flag to true without updating filter state in first iteration.const T &getState() const { return _alpha_filter.getState(); }
).Code Quality
Recommendations
Overall these files demonstrate strong adherence towards modern C++ best practices including modularity encapsulation efficient resource management among others while maintaining high readability maintainability standards throughout their respective implementations albeit some minor improvements could be made regarding additional inline documentation where necessary particularly around complex mathematical operations involved therein thereby further enhancing overall comprehensibility ease-of-maintenance thereof going forward respectively accordingly thusly forthwith hereunto heretofore henceforth etcetera ad infinitum et cetera ad nauseam ad libitum ad hoc ad hominem ad astra per aspera ad victoriam ad majorem dei gloriam ad infinitum ad perpetuam memoriam ad vitam aeternam ad vitam aut culpam ad vitam aut culpam et cetera et cetera et cetera et cetera et cetera et cetera et cetera et cetera et cetera et cetera et cetera et cetera et cetera et cetera et cetera et cetera et cetera et cetera et cetera et cetera et cetera et cetera et cetera et cetera et cetera et cetera et cetera et cetera et cetera et cetera et cetera et cetera etcetera etcetera etcetera etcetera etcetera etcetera etcetera etcetera etcetera etcetera etcetera etcetera etcetera etcetera etcetera etcetera etcetera etcetera etcetera etcetera etcetera etcetera etcetera etcetera etcetera etcetera etcetera etcetera etcetera...
Severity: High (3/3)
Rationale
A critical bug where uploading an invalid mission during flight can cause a crash during Return-to-Launch (RTL), posing a significant safety risk.
Next Steps
Severity: High (3/3)
Rationale
The failure of VTOL SITL tests on every pull request is a critical issue that disrupts the CI process, delaying development and integration of new features.
Next Steps
Severity: Medium (2/3)
Rationale
There is evidence of multiple PRs being left open without resolution, indicating a potential decline in team velocity.
Next Steps
Severity: Medium (2/3)
Rationale
The changes in PR #23236 regarding gimbal control logic adjustments suggest potential prolonged disagreements or complexities in achieving consensus on control mechanisms.
Next Steps
Severity: Medium (2/3)
Rationale
The recent updates to EKF2 modules such as innovation sequence monitoring (#23233) and mag spikes preflight errors (#23229) indicate ambiguous specifications that may lead to implementation challenges.
Next Steps