mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-15 05:03:33 +08:00
Fixed GPS lost issue, fixed accel scale initialization, fixed code style in rate controller
This commit is contained in:
@@ -781,6 +781,8 @@ void *ubx_watchdog_loop(void *args)
|
||||
} else {
|
||||
/* gps healthy */
|
||||
ubx_success_count++;
|
||||
ubx_healthy = true;
|
||||
ubx_fail_count = 0;
|
||||
|
||||
if (!ubx_healthy && ubx_success_count == UBX_HEALTH_SUCCESS_COUNTER_LIMIT) {
|
||||
//printf("[gps] ublox UBX module status ok (baud=%d)\r\n", current_gps_speed);
|
||||
|
||||
@@ -166,18 +166,17 @@ void multirotor_control_rates(const struct vehicle_rates_setpoint_s *rate_sp,
|
||||
if (motor_skip_counter % 2500 == 0) {
|
||||
/* update parameters from storage */
|
||||
parameters_update(&h, &p);
|
||||
printf("p.yawrate_p: %8.4f\n", (double)p.yawrate_p);
|
||||
}
|
||||
|
||||
/* calculate current control outputs */
|
||||
|
||||
/* control pitch (forward) output */
|
||||
float pitch_control = p.attrate_p * deltaT * (rate_sp->pitch-rates[1]);
|
||||
float pitch_control = p.attrate_p * deltaT * (rate_sp->pitch - rates[1]);
|
||||
/* control roll (left/right) output */
|
||||
float roll_control = p.attrate_p * deltaT * (rate_sp->roll-rates[0] );
|
||||
float roll_control = p.attrate_p * deltaT * (rate_sp->roll - rates[0]);
|
||||
|
||||
/* control yaw rate */
|
||||
float yaw_rate_control = p.yawrate_p * deltaT * (rate_sp->yaw-rates[2] );
|
||||
float yaw_rate_control = p.yawrate_p * deltaT * (rate_sp->yaw - rates[2]);
|
||||
|
||||
actuators->control[0] = roll_control;
|
||||
actuators->control[1] = pitch_control;
|
||||
|
||||
@@ -56,9 +56,9 @@ PARAM_DEFINE_FLOAT(SENS_ACC_XOFF, 0.0f);
|
||||
PARAM_DEFINE_FLOAT(SENS_ACC_YOFF, 0.0f);
|
||||
PARAM_DEFINE_FLOAT(SENS_ACC_ZOFF, 0.0f);
|
||||
|
||||
PARAM_DEFINE_FLOAT(SENS_ACC_XSCALE, 0.0f);
|
||||
PARAM_DEFINE_FLOAT(SENS_ACC_YSCALE, 0.0f);
|
||||
PARAM_DEFINE_FLOAT(SENS_ACC_ZSCALE, 0.0f);
|
||||
PARAM_DEFINE_FLOAT(SENS_ACC_XSCALE, 1.0f);
|
||||
PARAM_DEFINE_FLOAT(SENS_ACC_YSCALE, 1.0f);
|
||||
PARAM_DEFINE_FLOAT(SENS_ACC_ZSCALE, 1.0f);
|
||||
|
||||
PARAM_DEFINE_FLOAT(RC1_MIN, 1000.0f);
|
||||
PARAM_DEFINE_FLOAT(RC1_TRIM, 1500.0f);
|
||||
|
||||
@@ -236,11 +236,11 @@ CONFIG_AT24XX_MTD_BLOCKSIZE=256
|
||||
CONFIG_SERIAL_TERMIOS=y
|
||||
CONFIG_SERIAL_CONSOLE_REINIT=y
|
||||
|
||||
CONFIG_USART1_SERIAL_CONSOLE=n
|
||||
CONFIG_USART1_SERIAL_CONSOLE=y
|
||||
CONFIG_USART2_SERIAL_CONSOLE=n
|
||||
CONFIG_USART3_SERIAL_CONSOLE=n
|
||||
CONFIG_UART4_SERIAL_CONSOLE=n
|
||||
CONFIG_UART5_SERIAL_CONSOLE=y
|
||||
CONFIG_UART5_SERIAL_CONSOLE=n
|
||||
CONFIG_USART6_SERIAL_CONSOLE=n
|
||||
|
||||
#Mavlink messages can be bigger than 128
|
||||
|
||||
Reference in New Issue
Block a user