mirror of
https://github.com/moveit/moveit_task_constructor.git
synced 2025-11-04 14:49:57 +08:00
consistently use double for costs
This commit is contained in:
parent
f8952bb712
commit
32314d3532
@ -278,8 +278,8 @@ void RemoteTaskModel::processStageStatistics(const moveit_task_constructor_msgs:
|
|||||||
}
|
}
|
||||||
Node *n = it->second;
|
Node *n = it->second;
|
||||||
|
|
||||||
bool changed = n->solutions_->processSolutionIDs(s.solved, std::numeric_limits<float>::quiet_NaN()) ||
|
bool changed = n->solutions_->processSolutionIDs(s.solved, std::numeric_limits<double>::quiet_NaN()) ||
|
||||||
n->solutions_->processSolutionIDs(s.failed, std::numeric_limits<float>::infinity());
|
n->solutions_->processSolutionIDs(s.failed, std::numeric_limits<double>::infinity());
|
||||||
// emit notify about model changes when node was already visited
|
// emit notify about model changes when node was already visited
|
||||||
if (changed && (n->node_flags_ & WAS_VISITED)) {
|
if (changed && (n->node_flags_ & WAS_VISITED)) {
|
||||||
QModelIndex idx = index(n);
|
QModelIndex idx = index(n);
|
||||||
@ -525,7 +525,7 @@ void RemoteSolutionModel::sortInternal()
|
|||||||
}
|
}
|
||||||
|
|
||||||
// process solution ids received in stage statistics
|
// 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
|
// ids are originally ordered by cost, order them by creation order here
|
||||||
std::vector<std::pair<uint32_t, uint32_t>> ids_by_creation;
|
std::vector<std::pair<uint32_t, uint32_t>> ids_by_creation;
|
||||||
|
|||||||
@ -95,7 +95,7 @@ class RemoteSolutionModel : public QAbstractTableModel {
|
|||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
struct Data {
|
struct Data {
|
||||||
uint32_t id;
|
uint32_t id;
|
||||||
float cost; // nan if unknown, inf if failed
|
double cost; // nan if unknown, inf if failed
|
||||||
QString name;
|
QString name;
|
||||||
uint32_t creation_rank; // rank, ordered by creation
|
uint32_t creation_rank; // rank, ordered by creation
|
||||||
uint32_t cost_rank; // rank, ordering by cost
|
uint32_t cost_rank; // rank, ordering by cost
|
||||||
@ -130,7 +130,7 @@ public:
|
|||||||
void sort(int column, Qt::SortOrder order);
|
void sort(int column, Qt::SortOrder order);
|
||||||
|
|
||||||
void setData(uint32_t id, float cost, const QString &name);
|
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);
|
||||||
};
|
};
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user