From 32314d3532f084a9b66de9bd6e9aa203329d6f48 Mon Sep 17 00:00:00 2001 From: Robert Haschke Date: Sun, 7 Jan 2018 16:52:06 +0100 Subject: [PATCH] consistently use double for costs --- .../motion_planning_tasks/src/remote_task_model.cpp | 6 +++--- visualization/motion_planning_tasks/src/remote_task_model.h | 4 ++-- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/visualization/motion_planning_tasks/src/remote_task_model.cpp b/visualization/motion_planning_tasks/src/remote_task_model.cpp index 403877c9..9fb07226 100644 --- a/visualization/motion_planning_tasks/src/remote_task_model.cpp +++ b/visualization/motion_planning_tasks/src/remote_task_model.cpp @@ -278,8 +278,8 @@ void RemoteTaskModel::processStageStatistics(const moveit_task_constructor_msgs: } Node *n = it->second; - bool changed = n->solutions_->processSolutionIDs(s.solved, std::numeric_limits::quiet_NaN()) || - n->solutions_->processSolutionIDs(s.failed, std::numeric_limits::infinity()); + bool changed = n->solutions_->processSolutionIDs(s.solved, std::numeric_limits::quiet_NaN()) || + n->solutions_->processSolutionIDs(s.failed, std::numeric_limits::infinity()); // emit notify about model changes when node was already visited if (changed && (n->node_flags_ & WAS_VISITED)) { QModelIndex idx = index(n); @@ -525,7 +525,7 @@ void RemoteSolutionModel::sortInternal() } // process solution ids received in stage statistics -bool RemoteSolutionModel::processSolutionIDs(const std::vector &ids, float default_cost) +bool RemoteSolutionModel::processSolutionIDs(const std::vector &ids, double default_cost) { // ids are originally ordered by cost, order them by creation order here std::vector> ids_by_creation; diff --git a/visualization/motion_planning_tasks/src/remote_task_model.h b/visualization/motion_planning_tasks/src/remote_task_model.h index 729dd734..7e47c4c1 100644 --- a/visualization/motion_planning_tasks/src/remote_task_model.h +++ b/visualization/motion_planning_tasks/src/remote_task_model.h @@ -95,7 +95,7 @@ class RemoteSolutionModel : public QAbstractTableModel { Q_OBJECT struct Data { uint32_t id; - float cost; // nan if unknown, inf if failed + double cost; // nan if unknown, inf if failed QString name; uint32_t creation_rank; // rank, ordered by creation uint32_t cost_rank; // rank, ordering by cost @@ -130,7 +130,7 @@ public: void sort(int column, Qt::SortOrder order); void setData(uint32_t id, float cost, const QString &name); - bool processSolutionIDs(const std::vector& ids, float default_cost); + bool processSolutionIDs(const std::vector& ids, double default_cost); }; }