Compare commits

..

3 Commits

Author SHA1 Message Date
Matthias Grob 437148f8f3 Makefile: target to test clang-format on the entire codebase 2022-06-30 16:07:37 +02:00
Matthias Grob 94f8a79c2c files_to_check_code_style: correctly omit folders 2022-06-30 16:07:02 +02:00
Matthias Grob d146405753 Add .clang-format for google style with minimal adaptations 2022-06-30 10:34:53 +02:00
12 changed files with 42 additions and 44 deletions
+13
View File
@@ -0,0 +1,13 @@
# Google C++ style as base
Language: Cpp
BasedOnStyle: Google
# Indentation using tabs
UseTab: ForContinuationAndIndentation
TabWidth: 8
IndentWidth: 8
ContinuationIndentWidth: 8
ConstructorInitializerIndentWidth: 8
AccessModifierOffset: -8
ColumnLimit: 120 # Allow more collumns
+4
View File
@@ -375,6 +375,10 @@ format:
$(call colorecho,'Formatting with astyle')
@"$(SRC_DIR)"/Tools/astyle/check_code_style_all.sh --fix
format_clang:
$(call colorecho,'Formatting with clang-format')
@"$(SRC_DIR)"/Tools/astyle/files_to_check_code_style.sh | xargs clang-format -i -style=file
# Testing
# --------------------------------------------------------------------
.PHONY: tests tests_coverage tests_mission tests_mission_coverage tests_offboard tests_avoidance
+20 -19
View File
@@ -8,23 +8,24 @@ if [ $# -gt 0 ]; then
fi
exec find boards msg src platforms test \
-path msg/templates/urtps -prune -o \
-path platforms/nuttx/NuttX -prune -o \
-path platforms/qurt/dspal -prune -o \
-path src/drivers/uavcan/libuavcan -prune -o \
-path src/drivers/uavcan/uavcan_drivers/kinetis/driver/include/uavcan_kinetis -prune -o \
-path src/drivers/cyphal/libcanard -prune -o \
-path src/lib/crypto/monocypher -prune -o \
-path src/lib/events/libevents -prune -o \
-path src/lib/parameters/uthash -prune -o \
-path src/modules/ekf2/EKF -prune -o \
-path src/modules/gyro_fft/CMSIS_5 -prune -o \
-path src/modules/mavlink/mavlink -prune -o \
-path src/modules/micrortps_bridge/micro-CDR -prune -o \
-path src/modules/micrortps_bridge/microRTPS_client -prune -o \
-path test/mavsdk_tests/catch2 -prune -o \
-path src/lib/crypto/monocypher -prune -o \
-path src/lib/crypto/libtomcrypt -prune -o \
-path src/lib/crypto/libtommath -prune -o \
-path src/modules/microdds_client/Micro-XRCE-DDS-Client -prune -o \
-not -path "msg/templates/urtps/*" \
-not -path "platforms/nuttx/NuttX/*" \
-not -path "platforms/qurt/dspal/*" \
-not -path "src/drivers/gps/devices/*" \
-not -path "src/drivers/uavcan/libuavcan/*" \
-not -path "src/drivers/uavcan/uavcan_drivers/kinetis/driver/include/uavcan_kinetis/*" \
-not -path "src/drivers/cyphal/libcanard/*" \
-not -path "src/lib/crypto/monocypher/*" \
-not -path "src/lib/events/libevents/*" \
-not -path "src/lib/parameters/uthash/*" \
-not -path "src/modules/ekf2/EKF/*" \
-not -path "src/modules/gyro_fft/CMSIS_5/*" \
-not -path "src/modules/mavlink/mavlink/*" \
-not -path "src/modules/micrortps_bridge/micro-CDR/*" \
-not -path "src/modules/micrortps_bridge/microRTPS_client/*" \
-not -path "test/mavsdk_tests/catch2/*" \
-not -path "src/lib/crypto/monocypher/*" \
-not -path "src/lib/crypto/libtomcrypt/*" \
-not -path "src/lib/crypto/libtommath/*" \
-not -path "src/modules/microdds_client/Micro-XRCE-DDS-Client/*" \
-type f \( -name "*.c" -o -name "*.h" -o -name "*.cpp" -o -name "*.hpp" \) | grep $PATTERN
-2
View File
@@ -64,7 +64,5 @@ float32[21] velocity_covariance
uint8 reset_counter
uint8 quality
# TOPICS vehicle_odometry vehicle_mocap_odometry vehicle_visual_odometry
# TOPICS estimator_odometry estimator_visual_odometry_aligned
+1 -3
View File
@@ -208,7 +208,6 @@ struct extVisionSample {
float angVar{}; ///< angular heading variance (rad**2)
VelocityFrame vel_frame = VelocityFrame::BODY_FRAME_FRD;
uint8_t reset_counter{};
uint8_t quality{}; ///< quality indicator between 0 and 100
};
struct dragSample {
@@ -330,14 +329,13 @@ struct parameters {
float range_kin_consistency_gate{1.0f}; ///< gate size used by the range finder kinematic consistency check
// vision position fusion
int32_t ev_quality_minimum{0}; ///< vision minimum acceptable quality integer
float ev_vel_innov_gate{3.0f}; ///< vision velocity fusion innovation consistency gate size (STD)
float ev_pos_innov_gate{5.0f}; ///< vision position fusion innovation consistency gate size (STD)
// optical flow fusion
float flow_noise{0.15f}; ///< observation noise for optical flow LOS rate measurements (rad/sec)
float flow_noise_qual_min{0.5f}; ///< observation noise for optical flow LOS rate measurements when flow sensor quality is at the minimum useable (rad/sec)
int32_t flow_qual_min{1}; ///< minimum acceptable quality integer from the flow sensor
int32_t flow_qual_min{1}; ///< minimum acceptable quality integer from the flow sensor
float flow_innov_gate{3.0f}; ///< optical flow fusion innovation consistency gate size (STD)
// these parameters control the strictness of GPS quality checks used to determine if the GPS is
+1 -1
View File
@@ -201,7 +201,7 @@ void Ekf::controlFusionModes()
void Ekf::controlExternalVisionFusion()
{
// Check for new external vision data
if (_ev_data_ready && _ev_sample_delayed.quality >= _params.ev_quality_minimum) {
if (_ev_data_ready) {
bool reset = false;
-4
View File
@@ -120,7 +120,6 @@ EKF2::EKF2(bool multi_mode, const px4::wq_config_t &config, bool replay_mode):
_param_ekf2_rng_a_igate(_params->range_aid_innov_gate),
_param_ekf2_rng_qlty_t(_params->range_valid_quality_s),
_param_ekf2_rng_k_gate(_params->range_kin_consistency_gate),
_param_ekf2_ev_qmin(_params->ev_quality_minimum),
_param_ekf2_evv_gate(_params->ev_vel_innov_gate),
_param_ekf2_evp_gate(_params->ev_pos_innov_gate),
_param_ekf2_of_n_min(_params->flow_noise),
@@ -1701,9 +1700,6 @@ bool EKF2::UpdateExtVisionSample(ekf2_timestamps_s &ekf2_timestamps, vehicle_odo
// use timestamp from external computer, clocks are synchronized when using MAVROS
ev_data.time_us = ev_odom.timestamp_sample;
ev_data.reset_counter = ev_odom.reset_counter;
ev_data.quality = ev_odom.quality;
if (new_ev_odom) {
_ekf.setExtVisionData(ev_data);
}
+2 -2
View File
@@ -469,8 +469,8 @@ private:
_param_ekf2_rng_k_gate, ///< range finder kinematic consistency gate size (STD)
// vision estimate fusion
(ParamInt<px4::params::EKF2_EV_NOISE_MD>) _param_ekf2_ev_noise_md, ///< determine source of vision observation noise
(ParamExtInt<px4::params::EKF2_EV_QMIN>) _param_ekf2_ev_qmin,
(ParamInt<px4::params::EKF2_EV_NOISE_MD>)
_param_ekf2_ev_noise_md, ///< determine source of vision observation noise
(ParamFloat<px4::params::EKF2_EVP_NOISE>)
_param_ekf2_evp_noise, ///< default position observation noise for exernal vision measurements (m)
(ParamFloat<px4::params::EKF2_EVV_NOISE>)
-10
View File
@@ -721,16 +721,6 @@ PARAM_DEFINE_FLOAT(EKF2_MIN_RNG, 0.1f);
*/
PARAM_DEFINE_INT32(EKF2_EV_NOISE_MD, 0);
/**
* Vision minimum quality
*
* @group EKF2
* @min 0
* @max 100
* @decimal 1
*/
PARAM_DEFINE_INT32(EKF2_EV_QMIN, 0);
/**
* Measurement noise for vision position observations used to lower bound or replace the uncertainty included in the message
*
-1
View File
@@ -1415,7 +1415,6 @@ MavlinkReceiver::handle_message_odometry(mavlink_message_t *msg)
}
odometry.reset_counter = odom.reset_counter;
odometry.quality = odom.quality;
/**
* Supported local frame of reference is MAV_FRAME_LOCAL_NED or MAV_FRAME_LOCAL_FRD
-1
View File
@@ -160,7 +160,6 @@ private:
}
msg.reset_counter = odom.reset_counter;
msg.quality = odom.quality;
mavlink_msg_odometry_send_struct(_mavlink->get_channel(), &msg);