Skip to content

Commit

Permalink
Possible fix for clang errors.
Browse files Browse the repository at this point in the history
  • Loading branch information
dinkoosmankovic committed Mar 14, 2024
1 parent e7230fa commit 352226b
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 17 deletions.
9 changes: 2 additions & 7 deletions include/planners/drbt/DRGBT.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,8 @@ namespace planning
~DRGBT();

bool solve() override;
#if defined(__clang__)
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Woverloaded-virtual"
bool checkTerminatingCondition();
#pragma clang diagnostic pop
#endif
void outputPlannerData(const std::string &filename, bool output_states_and_paths = true, bool append_output = false) const override;
bool checkTerminatingCondition(base::State::Status status) override;
void outputPlannerData(const std::string &filename, bool output_states_and_paths = true, bool append_output = false) const override;

protected:
void generateHorizon();
Expand Down
7 changes: 1 addition & 6 deletions include/planners/rbt_star/RGBMTStar.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,7 @@ namespace planning

bool solve() override;

#if defined(__clang__)
#pragma clang diagnostic push
#pragma clang diagnostic ignored "-Woverloaded-virtual"
bool checkTerminatingCondition();
#pragma clang diagnostic pop
#endif
bool checkTerminatingCondition(base::State::Status status) override;
void outputPlannerData(const std::string &filename, bool output_states_and_paths = true, bool append_output = false) const override;

protected:
Expand Down
4 changes: 2 additions & 2 deletions src/planners/drbt/DRGBT.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ bool planning::drbt::DRGBT::solve()
// Planner info and terminating condition
planner_info->setNumIterations(planner_info->getNumIterations() + 1);
planner_info->addIterationTime(getElapsedTime(time_start, std::chrono::steady_clock::now()));
if (checkTerminatingCondition())
if (checkTerminatingCondition(status))
return planner_info->getSuccessState();

std::cout << "----------------------------------------------------------------------------------------\n";
Expand Down Expand Up @@ -988,7 +988,7 @@ bool planning::drbt::DRGBT::checkMotionValidity(int num_checks)
return is_valid;
}

bool planning::drbt::DRGBT::checkTerminatingCondition()
bool planning::drbt::DRGBT::checkTerminatingCondition([[maybe_unused]] base::State::Status status)
{
int t_spline_current = getElapsedTime(time_start, std::chrono::steady_clock::now());
// std::cout << "Time elapsed: " << t_spline_current << " [ms] \n";
Expand Down
4 changes: 2 additions & 2 deletions src/planners/rbt_star/RGBMTStar.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ bool planning::rbt_star::RGBMTStar::solve()
planner_info->addCostConvergence(std::vector<float>(num_states_total - planner_info->getNumStates(), cost_opt));
planner_info->addStateTimes(std::vector<int>(num_states_total - planner_info->getNumStates(), planner_info->getIterationTimes().back()));
planner_info->setNumStates(num_states_total);
if (checkTerminatingCondition())
if (checkTerminatingCondition(status))
return planner_info->getSuccessState();
}
}
Expand Down Expand Up @@ -371,7 +371,7 @@ void planning::rbt_star::RGBMTStar::computePath(std::shared_ptr<base::State> q_c
std::reverse(path.begin(), path.end());
}

bool planning::rbt_star::RGBMTStar::checkTerminatingCondition()
bool planning::rbt_star::RGBMTStar::checkTerminatingCondition([[maybe_unused]] base::State::Status status)
{
if ((getElapsedTime(time_start, std::chrono::steady_clock::now()) >= RGBMTStarConfig::MAX_PLANNING_TIME ||
planner_info->getNumStates() >= RGBMTStarConfig::MAX_NUM_STATES ||
Expand Down

0 comments on commit 352226b

Please sign in to comment.