Skip to content

Commit

Permalink
ilk pra
Browse files Browse the repository at this point in the history
  • Loading branch information
brkay54 committed Sep 18, 2023
1 parent 8fd87f5 commit 5fd7f12
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 27 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -71,13 +71,6 @@ double getPitchByTraj(
*/
double calcElevationAngle(const TrajectoryPoint & p_from, const TrajectoryPoint & p_to);

/**
* @brief calculate vehicle pose after time delay by moving the vehicle at current velocity and
* acceleration for delayed time
*/
std::pair<double, double> calcDistAndVelAfterTimeDelay(
const double delay_time, const double current_vel, const double current_acc);

/**
* @brief apply linear interpolation to orientation
* @param [in] o_from first orientation
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,26 +117,6 @@ double calcElevationAngle(const TrajectoryPoint & p_from, const TrajectoryPoint
return pitch;
}

std::pair<double, double> calcDistAndVelAfterTimeDelay(
const double delay_time, const double current_vel, const double current_acc)
{
if (delay_time <= 0.0) {
return std::make_pair(0.0, 0.0);
}

// check time to stop
const double time_to_stop = -current_vel / current_acc;

const double delay_time_calculation =
time_to_stop > 0.0 && time_to_stop < delay_time ? time_to_stop : delay_time;
// simple linear prediction
const double vel_after_delay = current_vel + current_acc * delay_time_calculation;
const double running_distance = delay_time_calculation * current_vel + 0.5 * current_acc *
delay_time_calculation *
delay_time_calculation;
return std::make_pair(running_distance, vel_after_delay);
}

double lerp(const double v_from, const double v_to, const double ratio)
{
return v_from + (v_to - v_from) * ratio;
Expand Down

0 comments on commit 5fd7f12

Please sign in to comment.