Skip to content

Commit

Permalink
Plans/TimeProfile: Avoid duplicated code.
Browse files Browse the repository at this point in the history
  • Loading branch information
paulosousadias committed Jun 5, 2016
1 parent 8823965 commit d013651
Showing 1 changed file with 1 addition and 24 deletions.
25 changes: 1 addition & 24 deletions src/DUNE/Plans/TimeProfile.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -256,30 +256,7 @@ namespace DUNE
pos.z = maneuver->z;
pos.z_units = maneuver->z_units;

rstages.getFirstPoint(&pos.lat, &pos.lon);

float distance = distance3D(pos, last_pos);
m_accum_dur->addDuration(distance / speed);

last_pos = pos;

distance += rstages.getDistance(&last_pos.lat, &last_pos.lon);

std::vector<float>::const_iterator itr = rstages.getDistancesBegin();

for (; itr != rstages.getDistancesEnd(); ++itr)
{
// compensate with path controller's eta factor
float travelled = compensate(*itr, speed);
float duration = travelled / speed;

// Update speed profile
m_speed_vec->push_back(SpeedProfile(maneuver, duration));

m_accum_dur->addDuration(duration);
}

return true;
return parseWorkerRowsStages(&rstages, pos, last_pos, speed, maneuver->speed, maneuver->speed_units);
}

bool
Expand Down

0 comments on commit d013651

Please sign in to comment.