Skip to content

Commit

Permalink
ShipOps: Alt Home Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
lthall committed Oct 29, 2023
1 parent f099655 commit 600be50
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions ArduCopter/mode_ship_ops.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -228,6 +228,10 @@ void ModeShipOperation::run()

const Vector3f &curr_pos = inertial_nav.get_position_neu_cm();
int32_t alt_home_above_origin_cm;

if (!AP::ahrs().get_home().get_alt_cm(Location::AltFrame::ABOVE_ORIGIN, alt_home_above_origin_cm)) {
alt_home_above_origin_cm = 0;
}

// define target location
if (g2.follow.get_target_dist_and_vel_ned(pos_delta_ned, pos_delta_with_ofs_ned, vel_ned)) {
Expand All @@ -239,10 +243,6 @@ void ModeShipOperation::run()
float target_heading_deg = 0.0f;
g2.follow.get_target_heading_deg(target_heading_deg);

if (!AP::ahrs().get_home().get_alt_cm(Location::AltFrame::ABOVE_ORIGIN, alt_home_above_origin_cm)) {
alt_home_above_origin_cm = 0;
}

if (!ship_available) {
// reset ship pos, vel, accel to current value when detected.
ship_pos_ned = pos_with_ofs_ned.topostype();
Expand Down

0 comments on commit 600be50

Please sign in to comment.