diff --git a/ArduCopter/Attitude.cpp b/ArduCopter/Attitude.cpp index c0304da8db6..d769067bbd3 100644 --- a/ArduCopter/Attitude.cpp +++ b/ArduCopter/Attitude.cpp @@ -42,7 +42,7 @@ void Copter::update_throttle_hover() } // do not update while climbing or descending - if (!is_zero(pos_control->get_vel_desired_NEU_cms().z)) { + if (!is_zero(pos_control->get_vel_desired_NEU_ms().z)) { return; } diff --git a/ArduCopter/Log.cpp b/ArduCopter/Log.cpp index ddab8476327..71a2f5fc8a7 100644 --- a/ArduCopter/Log.cpp +++ b/ArduCopter/Log.cpp @@ -68,7 +68,7 @@ void Copter::Log_Write_Control_Tuning() #endif terr_alt : terr_alt, target_climb_rate : int16_t(target_climb_rate_ms * 100.0), - climb_rate : int16_t(pos_control->get_vel_estimate_NEU_cms().z) // float -> int16_t + climb_rate : int16_t(pos_control->get_vel_estimate_NEU_ms().z * 100.0) // float -> int16_t }; logger.WriteBlock(&pkt, sizeof(pkt)); } diff --git a/ArduCopter/land_detector.cpp b/ArduCopter/land_detector.cpp index 1bb0992e4a6..389b0b7ec77 100644 --- a/ArduCopter/land_detector.cpp +++ b/ArduCopter/land_detector.cpp @@ -86,7 +86,7 @@ void Copter::update_land_detector() #if MODE_AUTOROTATE_ENABLED || (flightmode->mode_number() == Mode::Number::AUTOROTATE && motors->get_below_land_min_coll()) #endif - || ((!get_force_flying() || landing) && motors->limit.throttle_lower && pos_control->get_vel_desired_NEU_cms().z < 0.0f); + || ((!get_force_flying() || landing) && motors->limit.throttle_lower && pos_control->get_vel_desired_NEU_ms().z < 0.0f); bool throttle_mix_at_min = true; #else // check that the average throttle output is near minimum (less than 12.5% hover throttle) @@ -309,7 +309,7 @@ void Copter::update_throttle_mix() const bool accel_moving = (land_accel_ef_filter.get().length() > LAND_CHECK_ACCEL_MOVING); // check for requested descent - bool descent_not_demanded = pos_control->get_vel_desired_NEU_cms().z >= 0.0f; + bool descent_not_demanded = pos_control->get_vel_desired_NEU_ms().z >= 0.0f; // check if landing const bool landing = flightmode->is_landing(); diff --git a/ArduCopter/mode_auto.cpp b/ArduCopter/mode_auto.cpp index 4ce0540a25e..7eb1ff14847 100644 --- a/ArduCopter/mode_auto.cpp +++ b/ArduCopter/mode_auto.cpp @@ -1454,7 +1454,7 @@ void PayloadPlace::run() case State::Ascent_Start: copter.flightmode->land_run_horizontal_control(); // update altitude target and call position controller - pos_control->land_at_climb_rate_cms(0.0, false); + pos_control->land_at_climb_rate_ms(0.0, false); break; case State::Ascent: case State::Done: @@ -1533,9 +1533,9 @@ Location ModeAuto::loc_from_cmd(const AP_Mission::Mission_Command& cmd, const Lo if (ret.alt == 0) { // set to default_loc's altitude but in command's alt frame // note that this may use the terrain database - int32_t default_alt_cm; - if (default_loc.get_alt_cm(ret.get_alt_frame(), default_alt_cm)) { - ret.set_alt_cm(default_alt_cm, ret.get_alt_frame()); + float default_alt_m; + if (default_loc.get_alt_m(ret.get_alt_frame(), default_alt_m)) { + ret.set_alt_m(default_alt_m, ret.get_alt_frame()); } else { // default to default_loc's altitude and frame ret.copy_alt_from(default_loc); diff --git a/ArduCopter/mode_circle.cpp b/ArduCopter/mode_circle.cpp index 3d8b8e6bc35..73ddf2cecd0 100644 --- a/ArduCopter/mode_circle.cpp +++ b/ArduCopter/mode_circle.cpp @@ -30,7 +30,7 @@ bool ModeCircle::init(bool ignore_checks) return false; } // point at the ground: - circle_center.set_alt_cm(0, Location::AltFrame::ABOVE_TERRAIN); + circle_center.set_alt_m(0, Location::AltFrame::ABOVE_TERRAIN); AP_Mount *s = AP_Mount::get_singleton(); s->set_roi_target(circle_center); } diff --git a/ArduCopter/mode_loiter.cpp b/ArduCopter/mode_loiter.cpp index 7117a8a3a9d..c2ec5f0ef67 100644 --- a/ArduCopter/mode_loiter.cpp +++ b/ArduCopter/mode_loiter.cpp @@ -47,7 +47,7 @@ bool ModeLoiter::do_precision_loiter() return false; // don't move on the ground } // if the pilot *really* wants to move the vehicle, let them.... - if (loiter_nav->get_pilot_desired_acceleration_NE_cmss().length() > 50.0f) { + if (loiter_nav->get_pilot_desired_acceleration_NE_mss().length() > 0.5) { return false; } if (!copter.precland.target_acquired()) {