consistently use double for costs

This commit is contained in:
Robert Haschke 2018-01-07 16:52:06 +01:00
parent f8952bb712
commit 32314d3532
2 changed files with 5 additions and 5 deletions

View File

@ -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<float>::quiet_NaN()) ||
n->solutions_->processSolutionIDs(s.failed, std::numeric_limits<float>::infinity());
bool changed = n->solutions_->processSolutionIDs(s.solved, std::numeric_limits<double>::quiet_NaN()) ||
n->solutions_->processSolutionIDs(s.failed, std::numeric_limits<double>::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<uint32_t> &ids, float default_cost)
bool RemoteSolutionModel::processSolutionIDs(const std::vector<uint32_t> &ids, double default_cost)
{
// ids are originally ordered by cost, order them by creation order here
std::vector<std::pair<uint32_t, uint32_t>> ids_by_creation;

View File

@ -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<uint32_t>& ids, float default_cost);
bool processSolutionIDs(const std::vector<uint32_t>& ids, double default_cost);
};
}