diff --git a/APMrover2/GCS_Mavlink.cpp b/APMrover2/GCS_Mavlink.cpp index c7c0387785..beda20956d 100644 --- a/APMrover2/GCS_Mavlink.cpp +++ b/APMrover2/GCS_Mavlink.cpp @@ -272,14 +272,6 @@ void Rover::send_pid_tuning(mavlink_channel_t chan) } } -void Rover::send_wheel_encoder(mavlink_channel_t chan) -{ - // send wheel encoder data using rpm message - if (g2.wheel_encoder.enabled(0) || g2.wheel_encoder.enabled(1)) { - mavlink_msg_rpm_send(chan, wheel_encoder_rpm[0], wheel_encoder_rpm[1]); - } -} - void Rover::send_wheel_encoder_distance(mavlink_channel_t chan) { // send wheel encoder data using wheel_distance message diff --git a/APMrover2/Log.cpp b/APMrover2/Log.cpp index 303e10b7bf..6a02061d0b 100644 --- a/APMrover2/Log.cpp +++ b/APMrover2/Log.cpp @@ -313,10 +313,8 @@ struct PACKED log_WheelEncoder { uint64_t time_us; float distance_0; uint8_t quality_0; - float rpm_0; float distance_1; uint8_t quality_1; - float rpm_1; }; // log wheel encoder information @@ -331,10 +329,8 @@ void Rover::Log_Write_WheelEncoder() time_us : AP_HAL::micros64(), distance_0 : g2.wheel_encoder.get_distance(0), quality_0 : (uint8_t)constrain_float(g2.wheel_encoder.get_signal_quality(0), 0.0f, 100.0f), - rpm_0 : wheel_encoder_rpm[0], distance_1 : g2.wheel_encoder.get_distance(1), - quality_1 : (uint8_t)constrain_float(g2.wheel_encoder.get_signal_quality(1), 0.0f, 100.0f), - rpm_1 : wheel_encoder_rpm[1] + quality_1 : (uint8_t)constrain_float(g2.wheel_encoder.get_signal_quality(1), 0.0f, 100.0f) }; logger.WriteBlock(&pkt, sizeof(pkt)); } @@ -370,7 +366,7 @@ const LogStructure Rover::log_structure[] = { { LOG_ERROR_MSG, sizeof(log_Error), "ERR", "QBB", "TimeUS,Subsys,ECode", "s--", "F--" }, { LOG_WHEELENCODER_MSG, sizeof(log_WheelEncoder), - "WENC", "Qfbffbf", "TimeUS,Dist0,Qual0,RPM0,Dist1,Qual1,RPM1", "sm-qm-q", "F0--0--" }, + "WENC", "Qfbfb", "TimeUS,Dist0,Qual0,Dist1,Qual1", "sm-m-", "F0-0-" }, }; void Rover::log_init(void) diff --git a/APMrover2/Rover.h b/APMrover2/Rover.h index b6c43e9ee5..f3e667d289 100644 --- a/APMrover2/Rover.h +++ b/APMrover2/Rover.h @@ -343,7 +343,6 @@ private: float wheel_encoder_last_distance_m[WHEELENCODER_MAX_INSTANCES]; // distance in meters at time of last update to EKF (for reporting to GCS) uint32_t wheel_encoder_last_update_ms[WHEELENCODER_MAX_INSTANCES]; // system time of last ping from each encoder uint32_t wheel_encoder_last_ekf_update_ms; // system time of last encoder data push to EKF - float wheel_encoder_rpm[WHEELENCODER_MAX_INSTANCES]; // for reporting to GCS // True when we are doing motor test bool motor_test; @@ -446,7 +445,6 @@ private: void send_servo_out(mavlink_channel_t chan); void send_pid_tuning(mavlink_channel_t chan); void send_rpm(mavlink_channel_t chan); - void send_wheel_encoder(mavlink_channel_t chan); void send_wheel_encoder_distance(mavlink_channel_t chan); // Log.cpp diff --git a/APMrover2/sensors.cpp b/APMrover2/sensors.cpp index 173a7f2aea..36795e70b4 100644 --- a/APMrover2/sensors.cpp +++ b/APMrover2/sensors.cpp @@ -123,13 +123,6 @@ void Rover::update_wheel_encoder() * posOffset is the XYZ body frame position of the wheel hub (m) */ EKF3.writeWheelOdom(delta_angle, delta_time, wheel_encoder_last_update_ms[i], g2.wheel_encoder.get_pos_offset(i), g2.wheel_encoder.get_wheel_radius(i)); - - // calculate rpm for reporting to GCS - if (is_positive(delta_time)) { - wheel_encoder_rpm[i] = (delta_angle / M_2PI) / (delta_time / 60.0f); - } else { - wheel_encoder_rpm[i] = 0.0f; - } } // record system time update for next iteration