mirror of
https://gitee.com/xiaohuolufeihua/bizhang_-obav.git
synced 2026-05-21 01:12:11 +00:00
IMU_GYRO_RATEMAX set system default to 400 Hz
- MC default is still 800 Hz
This commit is contained in:
@@ -117,49 +117,49 @@ if [ $AUTOCNF = yes ]
|
|||||||
then
|
then
|
||||||
param set SYS_AUTOSTART $REQUESTED_AUTOSTART
|
param set SYS_AUTOSTART $REQUESTED_AUTOSTART
|
||||||
|
|
||||||
param set BAT_N_CELLS 4
|
|
||||||
|
|
||||||
param set CAL_ACC0_ID 1310988 # 1310988: DRV_IMU_DEVTYPE_SIM, BUS: 1, ADDR: 1, TYPE: SIMULATION
|
param set CAL_ACC0_ID 1310988 # 1310988: DRV_IMU_DEVTYPE_SIM, BUS: 1, ADDR: 1, TYPE: SIMULATION
|
||||||
param set CAL_ACC1_ID 1310996 # 1310996: DRV_IMU_DEVTYPE_SIM, BUS: 2, ADDR: 1, TYPE: SIMULATION
|
|
||||||
param set CAL_ACC2_ID 1311004 # 1311004: DRV_IMU_DEVTYPE_SIM, BUS: 3, ADDR: 1, TYPE: SIMULATION
|
|
||||||
param set CAL_GYRO0_ID 1310988 # 1310988: DRV_IMU_DEVTYPE_SIM, BUS: 1, ADDR: 1, TYPE: SIMULATION
|
param set CAL_GYRO0_ID 1310988 # 1310988: DRV_IMU_DEVTYPE_SIM, BUS: 1, ADDR: 1, TYPE: SIMULATION
|
||||||
|
param set CAL_ACC1_ID 1310996 # 1310996: DRV_IMU_DEVTYPE_SIM, BUS: 2, ADDR: 1, TYPE: SIMULATION
|
||||||
param set CAL_GYRO1_ID 1310996 # 1310996: DRV_IMU_DEVTYPE_SIM, BUS: 2, ADDR: 1, TYPE: SIMULATION
|
param set CAL_GYRO1_ID 1310996 # 1310996: DRV_IMU_DEVTYPE_SIM, BUS: 2, ADDR: 1, TYPE: SIMULATION
|
||||||
|
param set CAL_ACC2_ID 1311004 # 1311004: DRV_IMU_DEVTYPE_SIM, BUS: 3, ADDR: 1, TYPE: SIMULATION
|
||||||
param set CAL_GYRO2_ID 1311004 # 1311004: DRV_IMU_DEVTYPE_SIM, BUS: 3, ADDR: 1, TYPE: SIMULATION
|
param set CAL_GYRO2_ID 1311004 # 1311004: DRV_IMU_DEVTYPE_SIM, BUS: 3, ADDR: 1, TYPE: SIMULATION
|
||||||
|
|
||||||
param set CAL_MAG0_ID 197388
|
param set CAL_MAG0_ID 197388
|
||||||
param set CAL_MAG1_ID 197644
|
param set CAL_MAG1_ID 197644
|
||||||
|
|
||||||
param set CBRK_AIRSPD_CHK 0
|
|
||||||
param set CBRK_SUPPLY_CHK 894281
|
|
||||||
|
|
||||||
# Don't require RC calibration and configuration
|
|
||||||
param set COM_RC_IN_MODE 1
|
|
||||||
|
|
||||||
# Speedup SITL startup
|
|
||||||
param set EKF2_REQ_GPS_H 0.5
|
|
||||||
|
|
||||||
# Multi-EKF
|
|
||||||
param set EKF2_MULTI_IMU 3
|
|
||||||
param set SENS_IMU_MODE 0
|
|
||||||
param set EKF2_MULTI_MAG 2
|
|
||||||
param set SENS_MAG_MODE 0
|
|
||||||
|
|
||||||
# By default log from boot until first disarm.
|
|
||||||
param set SDLOG_MODE 1
|
|
||||||
# enable default, estimator replay and vision/avoidance logging profiles
|
|
||||||
param set SDLOG_PROFILE 131
|
|
||||||
param set SDLOG_DIRS_MAX 7
|
|
||||||
param set SENS_BOARD_ROT 0
|
|
||||||
param set SENS_BOARD_X_OFF 0.000001
|
param set SENS_BOARD_X_OFF 0.000001
|
||||||
param set SENS_DPRES_OFF 0.001
|
param set SENS_DPRES_OFF 0.001
|
||||||
param set SYS_RESTART_TYPE 2
|
|
||||||
|
|
||||||
param set TRIG_INTERFACE 3
|
param set SYS_RESTART_TYPE 2
|
||||||
fi
|
fi
|
||||||
|
|
||||||
param set COM_CPU_MAX -1 # disable check, no CPU load reported on posix yet
|
param set-default BAT_N_CELLS 4
|
||||||
|
|
||||||
# Simulator IMU data provided at 250 Hz
|
param set-default CBRK_AIRSPD_CHK 0
|
||||||
param set IMU_INTEG_RATE 250
|
param set-default CBRK_SUPPLY_CHK 894281
|
||||||
|
|
||||||
|
# disable check, no CPU load reported on posix yet
|
||||||
|
param set-default COM_CPU_MAX -1
|
||||||
|
|
||||||
|
# Don't require RC calibration and configuration
|
||||||
|
param set-default COM_RC_IN_MODE 1
|
||||||
|
|
||||||
|
# Speedup SITL startup
|
||||||
|
param set-default EKF2_REQ_GPS_H 0.5
|
||||||
|
|
||||||
|
# Multi-EKF
|
||||||
|
param set-default EKF2_MULTI_IMU 3
|
||||||
|
param set-default SENS_IMU_MODE 0
|
||||||
|
param set-default EKF2_MULTI_MAG 2
|
||||||
|
param set-default SENS_MAG_MODE 0
|
||||||
|
|
||||||
|
# By default log from boot until first disarm.
|
||||||
|
param set-default SDLOG_MODE 1
|
||||||
|
# enable default, estimator replay and vision/avoidance logging profiles
|
||||||
|
param set-default SDLOG_PROFILE 131
|
||||||
|
param set-default SDLOG_DIRS_MAX 7
|
||||||
|
|
||||||
|
param set-default TRIG_INTERFACE 3
|
||||||
|
|
||||||
# Adapt timeout parameters if simulation runs faster or slower than realtime.
|
# Adapt timeout parameters if simulation runs faster or slower than realtime.
|
||||||
if [ -n "$PX4_SIM_SPEED_FACTOR" ]; then
|
if [ -n "$PX4_SIM_SPEED_FACTOR" ]; then
|
||||||
@@ -206,6 +206,9 @@ then
|
|||||||
param set SYS_AUTOCONFIG 0
|
param set SYS_AUTOCONFIG 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Simulator IMU data provided at 250 Hz
|
||||||
|
param set IMU_INTEG_RATE 250
|
||||||
|
|
||||||
dataman start
|
dataman start
|
||||||
# only start the simulator if not in replay mode, as both control the lockstep time
|
# only start the simulator if not in replay mode, as both control the lockstep time
|
||||||
if ! replay tryapplyparams
|
if ! replay tryapplyparams
|
||||||
|
|||||||
@@ -21,11 +21,8 @@
|
|||||||
set MIXER quad_x
|
set MIXER quad_x
|
||||||
set PWM_OUT 1234
|
set PWM_OUT 1234
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
param set-default IMU_GYRO_CUTOFF 40
|
param set-default IMU_GYRO_CUTOFF 40
|
||||||
param set-default IMU_DGYRO_CUTOFF 20
|
param set-default IMU_DGYRO_CUTOFF 20
|
||||||
param set-default IMU_GYRO_RATEMAX 400
|
|
||||||
|
|
||||||
param set-default MC_ROLLRATE_P 0.18
|
param set-default MC_ROLLRATE_P 0.18
|
||||||
param set-default MC_ROLLRATE_I 0.15
|
param set-default MC_ROLLRATE_I 0.15
|
||||||
|
|||||||
@@ -7,6 +7,8 @@
|
|||||||
|
|
||||||
set VEHICLE_TYPE mc
|
set VEHICLE_TYPE mc
|
||||||
|
|
||||||
|
param set-default IMU_GYRO_RATEMAX 800
|
||||||
|
|
||||||
param set-default NAV_ACC_RAD 2
|
param set-default NAV_ACC_RAD 2
|
||||||
|
|
||||||
param set-default RTL_RETURN_ALT 30
|
param set-default RTL_RETURN_ALT 30
|
||||||
|
|||||||
@@ -7,9 +7,6 @@
|
|||||||
|
|
||||||
set VEHICLE_TYPE vtol
|
set VEHICLE_TYPE vtol
|
||||||
|
|
||||||
# to minimize cpu usage on older boards limit inner loop to 400 Hz
|
|
||||||
param set-default IMU_GYRO_RATEMAX 400
|
|
||||||
|
|
||||||
param set-default MIS_TAKEOFF_ALT 20
|
param set-default MIS_TAKEOFF_ALT 20
|
||||||
param set-default MIS_YAW_TMT 10
|
param set-default MIS_YAW_TMT 10
|
||||||
|
|
||||||
|
|||||||
@@ -2,6 +2,3 @@
|
|||||||
#
|
#
|
||||||
# mRo x21 specific board defaults
|
# mRo x21 specific board defaults
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
|
|
||||||
# to minimize cpu usage on older boards limit inner loop to 400 Hz by default
|
|
||||||
param set-default IMU_GYRO_RATEMAX 400
|
|
||||||
|
|||||||
@@ -21,6 +21,3 @@ then
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
unset BL_FILE
|
unset BL_FILE
|
||||||
|
|
||||||
# to minimize cpu usage on older boards limit inner loop to 400 Hz by default
|
|
||||||
param set-default IMU_GYRO_RATEMAX 400
|
|
||||||
|
|||||||
@@ -21,6 +21,3 @@ then
|
|||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
unset BL_FILE
|
unset BL_FILE
|
||||||
|
|
||||||
# to minimize cpu usage on older boards limit inner loop to 400 Hz by default
|
|
||||||
param set-default IMU_GYRO_RATEMAX 400
|
|
||||||
|
|||||||
@@ -12,7 +12,6 @@ fi
|
|||||||
param set CBRK_SUPPLY_CHK 894281
|
param set CBRK_SUPPLY_CHK 894281
|
||||||
param set SYS_AUTOSTART 4001
|
param set SYS_AUTOSTART 4001
|
||||||
param set MAV_TYPE 2
|
param set MAV_TYPE 2
|
||||||
param set IMU_GYRO_RATEMAX 400
|
|
||||||
|
|
||||||
# Multi-EKF
|
# Multi-EKF
|
||||||
param set EKF2_MULTI_IMU 2
|
param set EKF2_MULTI_IMU 2
|
||||||
|
|||||||
@@ -12,7 +12,6 @@ fi
|
|||||||
param set CBRK_SUPPLY_CHK 894281
|
param set CBRK_SUPPLY_CHK 894281
|
||||||
param set SYS_AUTOSTART 2100
|
param set SYS_AUTOSTART 2100
|
||||||
param set MAV_TYPE 1
|
param set MAV_TYPE 1
|
||||||
param set IMU_GYRO_RATEMAX 400
|
|
||||||
|
|
||||||
# Multi-EKF
|
# Multi-EKF
|
||||||
param set EKF2_MULTI_IMU 2
|
param set EKF2_MULTI_IMU 2
|
||||||
|
|||||||
@@ -12,7 +12,6 @@ fi
|
|||||||
param set CBRK_SUPPLY_CHK 894281
|
param set CBRK_SUPPLY_CHK 894281
|
||||||
param set SYS_AUTOSTART 4001
|
param set SYS_AUTOSTART 4001
|
||||||
param set MAV_TYPE 2
|
param set MAV_TYPE 2
|
||||||
param set IMU_GYRO_RATEMAX 400
|
|
||||||
|
|
||||||
# Multi-EKF
|
# Multi-EKF
|
||||||
param set EKF2_MULTI_IMU 2
|
param set EKF2_MULTI_IMU 2
|
||||||
|
|||||||
@@ -267,10 +267,6 @@ void BMI055_Accelerometer::ConfigureAccel()
|
|||||||
|
|
||||||
void BMI055_Accelerometer::ConfigureSampleRate(int sample_rate)
|
void BMI055_Accelerometer::ConfigureSampleRate(int sample_rate)
|
||||||
{
|
{
|
||||||
if (sample_rate == 0) {
|
|
||||||
sample_rate = 1000; // default to 1000 Hz
|
|
||||||
}
|
|
||||||
|
|
||||||
// round down to nearest FIFO sample dt * SAMPLES_PER_TRANSFER
|
// round down to nearest FIFO sample dt * SAMPLES_PER_TRANSFER
|
||||||
const float min_interval = FIFO_SAMPLE_DT;
|
const float min_interval = FIFO_SAMPLE_DT;
|
||||||
_fifo_empty_interval_us = math::max(roundf((1e6f / (float)sample_rate) / min_interval) * min_interval, min_interval);
|
_fifo_empty_interval_us = math::max(roundf((1e6f / (float)sample_rate) / min_interval) * min_interval, min_interval);
|
||||||
|
|||||||
@@ -265,10 +265,6 @@ void BMI055_Gyroscope::ConfigureGyro()
|
|||||||
|
|
||||||
void BMI055_Gyroscope::ConfigureSampleRate(int sample_rate)
|
void BMI055_Gyroscope::ConfigureSampleRate(int sample_rate)
|
||||||
{
|
{
|
||||||
if (sample_rate == 0) {
|
|
||||||
sample_rate = 1000; // default to 1000 Hz
|
|
||||||
}
|
|
||||||
|
|
||||||
// round down to nearest FIFO sample dt * SAMPLES_PER_TRANSFER
|
// round down to nearest FIFO sample dt * SAMPLES_PER_TRANSFER
|
||||||
const float min_interval = FIFO_SAMPLE_DT;
|
const float min_interval = FIFO_SAMPLE_DT;
|
||||||
_fifo_empty_interval_us = math::max(roundf((1e6f / (float)sample_rate) / min_interval) * min_interval, min_interval);
|
_fifo_empty_interval_us = math::max(roundf((1e6f / (float)sample_rate) / min_interval) * min_interval, min_interval);
|
||||||
|
|||||||
@@ -300,10 +300,6 @@ void BMI088_Accelerometer::ConfigureAccel()
|
|||||||
|
|
||||||
void BMI088_Accelerometer::ConfigureSampleRate(int sample_rate)
|
void BMI088_Accelerometer::ConfigureSampleRate(int sample_rate)
|
||||||
{
|
{
|
||||||
if (sample_rate == 0) {
|
|
||||||
sample_rate = 800; // default to 800 Hz
|
|
||||||
}
|
|
||||||
|
|
||||||
// round down to nearest FIFO sample dt * SAMPLES_PER_TRANSFER
|
// round down to nearest FIFO sample dt * SAMPLES_PER_TRANSFER
|
||||||
const float min_interval = FIFO_SAMPLE_DT;
|
const float min_interval = FIFO_SAMPLE_DT;
|
||||||
_fifo_empty_interval_us = math::max(roundf((1e6f / (float)sample_rate) / min_interval) * min_interval, min_interval);
|
_fifo_empty_interval_us = math::max(roundf((1e6f / (float)sample_rate) / min_interval) * min_interval, min_interval);
|
||||||
|
|||||||
@@ -266,10 +266,6 @@ void BMI088_Gyroscope::ConfigureGyro()
|
|||||||
|
|
||||||
void BMI088_Gyroscope::ConfigureSampleRate(int sample_rate)
|
void BMI088_Gyroscope::ConfigureSampleRate(int sample_rate)
|
||||||
{
|
{
|
||||||
if (sample_rate == 0) {
|
|
||||||
sample_rate = 1000; // default to 1000 Hz
|
|
||||||
}
|
|
||||||
|
|
||||||
// round down to nearest FIFO sample dt * SAMPLES_PER_TRANSFER
|
// round down to nearest FIFO sample dt * SAMPLES_PER_TRANSFER
|
||||||
const float min_interval = FIFO_SAMPLE_DT;
|
const float min_interval = FIFO_SAMPLE_DT;
|
||||||
_fifo_empty_interval_us = math::max(roundf((1e6f / (float)sample_rate) / min_interval) * min_interval, min_interval);
|
_fifo_empty_interval_us = math::max(roundf((1e6f / (float)sample_rate) / min_interval) * min_interval, min_interval);
|
||||||
|
|||||||
@@ -228,10 +228,6 @@ void BMI088_Accelerometer::ConfigureAccel()
|
|||||||
|
|
||||||
void BMI088_Accelerometer::ConfigureSampleRate(int sample_rate)
|
void BMI088_Accelerometer::ConfigureSampleRate(int sample_rate)
|
||||||
{
|
{
|
||||||
if (sample_rate == 0) {
|
|
||||||
sample_rate = 800; // default to 800 Hz
|
|
||||||
}
|
|
||||||
|
|
||||||
// round down to nearest FIFO sample dt * SAMPLES_PER_TRANSFER
|
// round down to nearest FIFO sample dt * SAMPLES_PER_TRANSFER
|
||||||
const float min_interval = FIFO_SAMPLE_DT;
|
const float min_interval = FIFO_SAMPLE_DT;
|
||||||
_fifo_empty_interval_us = math::max(roundf((1e6f / (float)sample_rate) / min_interval) * min_interval, min_interval);
|
_fifo_empty_interval_us = math::max(roundf((1e6f / (float)sample_rate) / min_interval) * min_interval, min_interval);
|
||||||
|
|||||||
@@ -211,10 +211,6 @@ void BMI088_Gyroscope::ConfigureGyro()
|
|||||||
|
|
||||||
void BMI088_Gyroscope::ConfigureSampleRate(int sample_rate)
|
void BMI088_Gyroscope::ConfigureSampleRate(int sample_rate)
|
||||||
{
|
{
|
||||||
if (sample_rate == 0) {
|
|
||||||
sample_rate = 2000; // default to 1000 Hz
|
|
||||||
}
|
|
||||||
|
|
||||||
// round down to nearest FIFO sample dt * SAMPLES_PER_TRANSFER
|
// round down to nearest FIFO sample dt * SAMPLES_PER_TRANSFER
|
||||||
const float min_interval = FIFO_SAMPLE_DT;
|
const float min_interval = FIFO_SAMPLE_DT;
|
||||||
_fifo_empty_interval_us = math::max(roundf((1e6f / (float)sample_rate) / min_interval) * min_interval, min_interval);
|
_fifo_empty_interval_us = math::max(roundf((1e6f / (float)sample_rate) / min_interval) * min_interval, min_interval);
|
||||||
|
|||||||
@@ -335,10 +335,6 @@ void ICM20602::ConfigureGyro()
|
|||||||
|
|
||||||
void ICM20602::ConfigureSampleRate(int sample_rate)
|
void ICM20602::ConfigureSampleRate(int sample_rate)
|
||||||
{
|
{
|
||||||
if (sample_rate == 0) {
|
|
||||||
sample_rate = 800; // default to 800 Hz
|
|
||||||
}
|
|
||||||
|
|
||||||
// round down to nearest FIFO sample dt * SAMPLES_PER_TRANSFER
|
// round down to nearest FIFO sample dt * SAMPLES_PER_TRANSFER
|
||||||
const float min_interval = FIFO_SAMPLE_DT * SAMPLES_PER_TRANSFER;
|
const float min_interval = FIFO_SAMPLE_DT * SAMPLES_PER_TRANSFER;
|
||||||
_fifo_empty_interval_us = math::max(roundf((1e6f / (float)sample_rate) / min_interval) * min_interval, min_interval);
|
_fifo_empty_interval_us = math::max(roundf((1e6f / (float)sample_rate) / min_interval) * min_interval, min_interval);
|
||||||
|
|||||||
@@ -331,10 +331,6 @@ void ICM20608G::ConfigureGyro()
|
|||||||
|
|
||||||
void ICM20608G::ConfigureSampleRate(int sample_rate)
|
void ICM20608G::ConfigureSampleRate(int sample_rate)
|
||||||
{
|
{
|
||||||
if (sample_rate == 0) {
|
|
||||||
sample_rate = 800; // default to 800 Hz
|
|
||||||
}
|
|
||||||
|
|
||||||
// round down to nearest FIFO sample dt * SAMPLES_PER_TRANSFER
|
// round down to nearest FIFO sample dt * SAMPLES_PER_TRANSFER
|
||||||
const float min_interval = FIFO_SAMPLE_DT * SAMPLES_PER_TRANSFER;
|
const float min_interval = FIFO_SAMPLE_DT * SAMPLES_PER_TRANSFER;
|
||||||
_fifo_empty_interval_us = math::max(roundf((1e6f / (float)sample_rate) / min_interval) * min_interval, min_interval);
|
_fifo_empty_interval_us = math::max(roundf((1e6f / (float)sample_rate) / min_interval) * min_interval, min_interval);
|
||||||
|
|||||||
@@ -332,10 +332,6 @@ void ICM20649::ConfigureGyro()
|
|||||||
|
|
||||||
void ICM20649::ConfigureSampleRate(int sample_rate)
|
void ICM20649::ConfigureSampleRate(int sample_rate)
|
||||||
{
|
{
|
||||||
if (sample_rate == 0) {
|
|
||||||
sample_rate = 800; // default to ~800 Hz
|
|
||||||
}
|
|
||||||
|
|
||||||
// round down to nearest FIFO sample dt * SAMPLES_PER_TRANSFER
|
// round down to nearest FIFO sample dt * SAMPLES_PER_TRANSFER
|
||||||
const float min_interval = FIFO_SAMPLE_DT * SAMPLES_PER_TRANSFER;
|
const float min_interval = FIFO_SAMPLE_DT * SAMPLES_PER_TRANSFER;
|
||||||
_fifo_empty_interval_us = math::max(roundf((1e6f / (float)sample_rate) / min_interval) * min_interval, min_interval);
|
_fifo_empty_interval_us = math::max(roundf((1e6f / (float)sample_rate) / min_interval) * min_interval, min_interval);
|
||||||
|
|||||||
@@ -331,10 +331,6 @@ void ICM20689::ConfigureGyro()
|
|||||||
|
|
||||||
void ICM20689::ConfigureSampleRate(int sample_rate)
|
void ICM20689::ConfigureSampleRate(int sample_rate)
|
||||||
{
|
{
|
||||||
if (sample_rate == 0) {
|
|
||||||
sample_rate = 800; // default to 800 Hz
|
|
||||||
}
|
|
||||||
|
|
||||||
// round down to nearest FIFO sample dt * SAMPLES_PER_TRANSFER
|
// round down to nearest FIFO sample dt * SAMPLES_PER_TRANSFER
|
||||||
const float min_interval = FIFO_SAMPLE_DT * SAMPLES_PER_TRANSFER;
|
const float min_interval = FIFO_SAMPLE_DT * SAMPLES_PER_TRANSFER;
|
||||||
_fifo_empty_interval_us = math::max(roundf((1e6f / (float)sample_rate) / min_interval) * min_interval, min_interval);
|
_fifo_empty_interval_us = math::max(roundf((1e6f / (float)sample_rate) / min_interval) * min_interval, min_interval);
|
||||||
|
|||||||
@@ -368,10 +368,6 @@ void ICM20948::ConfigureGyro()
|
|||||||
|
|
||||||
void ICM20948::ConfigureSampleRate(int sample_rate)
|
void ICM20948::ConfigureSampleRate(int sample_rate)
|
||||||
{
|
{
|
||||||
if (sample_rate == 0) {
|
|
||||||
sample_rate = 800; // default to ~800 Hz
|
|
||||||
}
|
|
||||||
|
|
||||||
// round down to nearest FIFO sample dt * SAMPLES_PER_TRANSFER
|
// round down to nearest FIFO sample dt * SAMPLES_PER_TRANSFER
|
||||||
const float min_interval = FIFO_SAMPLE_DT * SAMPLES_PER_TRANSFER;
|
const float min_interval = FIFO_SAMPLE_DT * SAMPLES_PER_TRANSFER;
|
||||||
_fifo_empty_interval_us = math::max(roundf((1e6f / (float)sample_rate) / min_interval) * min_interval, min_interval);
|
_fifo_empty_interval_us = math::max(roundf((1e6f / (float)sample_rate) / min_interval) * min_interval, min_interval);
|
||||||
|
|||||||
@@ -338,10 +338,6 @@ void ICM40609D::ConfigureGyro()
|
|||||||
|
|
||||||
void ICM40609D::ConfigureSampleRate(int sample_rate)
|
void ICM40609D::ConfigureSampleRate(int sample_rate)
|
||||||
{
|
{
|
||||||
if (sample_rate == 0) {
|
|
||||||
sample_rate = 800; // default to 800 Hz
|
|
||||||
}
|
|
||||||
|
|
||||||
// round down to nearest FIFO sample dt
|
// round down to nearest FIFO sample dt
|
||||||
const float min_interval = FIFO_SAMPLE_DT;
|
const float min_interval = FIFO_SAMPLE_DT;
|
||||||
_fifo_empty_interval_us = math::max(roundf((1e6f / (float)sample_rate) / min_interval) * min_interval, min_interval);
|
_fifo_empty_interval_us = math::max(roundf((1e6f / (float)sample_rate) / min_interval) * min_interval, min_interval);
|
||||||
|
|||||||
@@ -339,10 +339,6 @@ void ICM42605::ConfigureGyro()
|
|||||||
|
|
||||||
void ICM42605::ConfigureSampleRate(int sample_rate)
|
void ICM42605::ConfigureSampleRate(int sample_rate)
|
||||||
{
|
{
|
||||||
if (sample_rate == 0) {
|
|
||||||
sample_rate = 800; // default to 800 Hz
|
|
||||||
}
|
|
||||||
|
|
||||||
// round down to nearest FIFO sample dt
|
// round down to nearest FIFO sample dt
|
||||||
const float min_interval = FIFO_SAMPLE_DT;
|
const float min_interval = FIFO_SAMPLE_DT;
|
||||||
_fifo_empty_interval_us = math::max(roundf((1e6f / (float)sample_rate) / min_interval) * min_interval, min_interval);
|
_fifo_empty_interval_us = math::max(roundf((1e6f / (float)sample_rate) / min_interval) * min_interval, min_interval);
|
||||||
|
|||||||
@@ -275,10 +275,6 @@ void ICM42688P::RunImpl()
|
|||||||
|
|
||||||
void ICM42688P::ConfigureSampleRate(int sample_rate)
|
void ICM42688P::ConfigureSampleRate(int sample_rate)
|
||||||
{
|
{
|
||||||
if (sample_rate == 0) {
|
|
||||||
sample_rate = 800; // default to 800 Hz
|
|
||||||
}
|
|
||||||
|
|
||||||
// round down to nearest FIFO sample dt
|
// round down to nearest FIFO sample dt
|
||||||
const float min_interval = FIFO_SAMPLE_DT;
|
const float min_interval = FIFO_SAMPLE_DT;
|
||||||
_fifo_empty_interval_us = math::max(roundf((1e6f / (float)sample_rate) / min_interval) * min_interval, min_interval);
|
_fifo_empty_interval_us = math::max(roundf((1e6f / (float)sample_rate) / min_interval) * min_interval, min_interval);
|
||||||
|
|||||||
@@ -331,10 +331,6 @@ void MPU6000::ConfigureGyro()
|
|||||||
|
|
||||||
void MPU6000::ConfigureSampleRate(int sample_rate)
|
void MPU6000::ConfigureSampleRate(int sample_rate)
|
||||||
{
|
{
|
||||||
if (sample_rate == 0) {
|
|
||||||
sample_rate = 1000; // default to 1000 Hz
|
|
||||||
}
|
|
||||||
|
|
||||||
// round down to nearest FIFO sample dt
|
// round down to nearest FIFO sample dt
|
||||||
const float min_interval = FIFO_SAMPLE_DT * 4; // limit to 2 kHz (500 us interval)
|
const float min_interval = FIFO_SAMPLE_DT * 4; // limit to 2 kHz (500 us interval)
|
||||||
_fifo_empty_interval_us = math::max(roundf((1e6f / (float)sample_rate) / min_interval) * min_interval, min_interval);
|
_fifo_empty_interval_us = math::max(roundf((1e6f / (float)sample_rate) / min_interval) * min_interval, min_interval);
|
||||||
|
|||||||
@@ -331,10 +331,6 @@ void MPU6500::ConfigureGyro()
|
|||||||
|
|
||||||
void MPU6500::ConfigureSampleRate(int sample_rate)
|
void MPU6500::ConfigureSampleRate(int sample_rate)
|
||||||
{
|
{
|
||||||
if (sample_rate == 0) {
|
|
||||||
sample_rate = 800; // default to 800 Hz
|
|
||||||
}
|
|
||||||
|
|
||||||
// round down to nearest FIFO sample dt * SAMPLES_PER_TRANSFER
|
// round down to nearest FIFO sample dt * SAMPLES_PER_TRANSFER
|
||||||
const float min_interval = FIFO_SAMPLE_DT * SAMPLES_PER_TRANSFER;
|
const float min_interval = FIFO_SAMPLE_DT * SAMPLES_PER_TRANSFER;
|
||||||
_fifo_empty_interval_us = math::max(roundf((1e6f / (float)sample_rate) / min_interval) * min_interval, min_interval);
|
_fifo_empty_interval_us = math::max(roundf((1e6f / (float)sample_rate) / min_interval) * min_interval, min_interval);
|
||||||
|
|||||||
@@ -365,10 +365,6 @@ void MPU9250::ConfigureGyro()
|
|||||||
|
|
||||||
void MPU9250::ConfigureSampleRate(int sample_rate)
|
void MPU9250::ConfigureSampleRate(int sample_rate)
|
||||||
{
|
{
|
||||||
if (sample_rate == 0) {
|
|
||||||
sample_rate = 800; // default to 800 Hz
|
|
||||||
}
|
|
||||||
|
|
||||||
// round down to nearest FIFO sample dt * SAMPLES_PER_TRANSFER
|
// round down to nearest FIFO sample dt * SAMPLES_PER_TRANSFER
|
||||||
const float min_interval = FIFO_SAMPLE_DT * SAMPLES_PER_TRANSFER;
|
const float min_interval = FIFO_SAMPLE_DT * SAMPLES_PER_TRANSFER;
|
||||||
_fifo_empty_interval_us = math::max(roundf((1e6f / (float)sample_rate) / min_interval) * min_interval, min_interval);
|
_fifo_empty_interval_us = math::max(roundf((1e6f / (float)sample_rate) / min_interval) * min_interval, min_interval);
|
||||||
|
|||||||
@@ -332,10 +332,6 @@ void MPU9250_I2C::ConfigureGyro()
|
|||||||
|
|
||||||
void MPU9250_I2C::ConfigureSampleRate(int sample_rate)
|
void MPU9250_I2C::ConfigureSampleRate(int sample_rate)
|
||||||
{
|
{
|
||||||
if (sample_rate == 0) {
|
|
||||||
sample_rate = 1000; // default to 1000 Hz
|
|
||||||
}
|
|
||||||
|
|
||||||
// round down to nearest FIFO sample dt * SAMPLES_PER_TRANSFER
|
// round down to nearest FIFO sample dt * SAMPLES_PER_TRANSFER
|
||||||
const float min_interval = FIFO_SAMPLE_DT * SAMPLES_PER_TRANSFER;
|
const float min_interval = FIFO_SAMPLE_DT * SAMPLES_PER_TRANSFER;
|
||||||
_fifo_empty_interval_us = math::max(roundf((1e6f / (float)sample_rate) / min_interval) * min_interval, min_interval);
|
_fifo_empty_interval_us = math::max(roundf((1e6f / (float)sample_rate) / min_interval) * min_interval, min_interval);
|
||||||
|
|||||||
@@ -239,10 +239,6 @@ void LSM9DS1::RunImpl()
|
|||||||
|
|
||||||
void LSM9DS1::ConfigureSampleRate(int sample_rate)
|
void LSM9DS1::ConfigureSampleRate(int sample_rate)
|
||||||
{
|
{
|
||||||
if (sample_rate == 0) {
|
|
||||||
sample_rate = ST_LSM9DS1::LA_ODR;
|
|
||||||
}
|
|
||||||
|
|
||||||
// round down to nearest FIFO sample dt
|
// round down to nearest FIFO sample dt
|
||||||
const float min_interval = FIFO_SAMPLE_DT;
|
const float min_interval = FIFO_SAMPLE_DT;
|
||||||
_fifo_empty_interval_us = math::max(roundf((1e6f / (float)sample_rate) / min_interval) * min_interval, min_interval);
|
_fifo_empty_interval_us = math::max(roundf((1e6f / (float)sample_rate) / min_interval) * min_interval, min_interval);
|
||||||
|
|||||||
@@ -90,8 +90,8 @@ PARAM_DEFINE_FLOAT(IMU_GYRO_CUTOFF, 30.0f);
|
|||||||
*
|
*
|
||||||
* @min 0
|
* @min 0
|
||||||
* @max 2000
|
* @max 2000
|
||||||
* @value 0 0 (no limit)
|
* @value 0 0 (driver minimum)
|
||||||
* @value 50 50 Hz
|
* @value 100 100 Hz
|
||||||
* @value 250 250 Hz
|
* @value 250 250 Hz
|
||||||
* @value 400 400 Hz
|
* @value 400 400 Hz
|
||||||
* @value 1000 1000 Hz
|
* @value 1000 1000 Hz
|
||||||
@@ -100,7 +100,7 @@ PARAM_DEFINE_FLOAT(IMU_GYRO_CUTOFF, 30.0f);
|
|||||||
* @reboot_required true
|
* @reboot_required true
|
||||||
* @group Sensors
|
* @group Sensors
|
||||||
*/
|
*/
|
||||||
PARAM_DEFINE_INT32(IMU_GYRO_RATEMAX, 0);
|
PARAM_DEFINE_INT32(IMU_GYRO_RATEMAX, 400);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Cutoff frequency for angular acceleration (D-Term filter)
|
* Cutoff frequency for angular acceleration (D-Term filter)
|
||||||
|
|||||||
Reference in New Issue
Block a user