mirror of
https://github.com/moveit/moveit_task_constructor.git
synced 2025-11-04 14:49:57 +08:00
remove CostTransform
If required, this can hopefully be implemented through Wrapper stages soon.
This commit is contained in:
parent
53c0964618
commit
e53d943b75
@ -215,9 +215,6 @@ public:
|
||||
|
||||
using CostTerm = std::function<double(const SubTrajectory&, std::string&)>;
|
||||
using CostTermShort = std::function<double(const SubTrajectory&)>;
|
||||
|
||||
using CostTransform = std::function<double(const double)>;
|
||||
|
||||
/* \brief set method to determine costs for solutions of this stage
|
||||
*
|
||||
* This interface supports only primitive solutions, no containers.
|
||||
@ -231,14 +228,6 @@ public:
|
||||
void setCostTerm(const CostTerm& term);
|
||||
void setCostTerm(const CostTermShort& term);
|
||||
|
||||
/* \brief set CostTransform to be applied to costs of this stage's solution costs
|
||||
*
|
||||
* This interface can be used to modify the cost associated with each solution of this stage/container.
|
||||
* The most common case would be linear weighting `[](double cost){ return constant*cost; }`
|
||||
* but any non-linear transform is obviously possible as well.
|
||||
*/
|
||||
void setCostTransform(const CostTransform& transform);
|
||||
|
||||
const ordered<SolutionBaseConstPtr>& solutions() const;
|
||||
const std::list<SolutionBaseConstPtr>& failures() const;
|
||||
size_t numFailures() const;
|
||||
|
||||
@ -173,7 +173,6 @@ protected:
|
||||
|
||||
// user-configurable cost estimator
|
||||
Stage::CostTerm cost_term_;
|
||||
Stage::CostTransform cost_transform_;
|
||||
|
||||
// The total compute time
|
||||
std::chrono::duration<double> total_compute_time_;
|
||||
|
||||
@ -99,7 +99,6 @@ std::ostream& operator<<(std::ostream& os, const InitStageException& e) {
|
||||
StagePrivate::StagePrivate(Stage* me, const std::string& name)
|
||||
: me_(me)
|
||||
, name_(name)
|
||||
, cost_transform_([](auto x) { return x; })
|
||||
, total_compute_time_{}
|
||||
, parent_(nullptr)
|
||||
, introspection_(nullptr) {}
|
||||
@ -282,8 +281,7 @@ bool StagePrivate::computeCost(SolutionBase& solution) {
|
||||
cost = solution.cost();
|
||||
}
|
||||
|
||||
// all costs are transformed
|
||||
solution.setCost(cost_transform_(cost));
|
||||
solution.setCost(cost);
|
||||
|
||||
return !solution.isFailure();
|
||||
}
|
||||
@ -392,10 +390,6 @@ void Stage::setCostTerm(const CostTermShort& term) {
|
||||
setCostTerm([=](auto&& solution, auto&&) { return term(solution); });
|
||||
}
|
||||
|
||||
void Stage::setCostTransform(const CostTransform& transform) {
|
||||
pimpl()->cost_transform_ = transform;
|
||||
}
|
||||
|
||||
const ordered<SolutionBaseConstPtr>& Stage::solutions() const {
|
||||
return pimpl()->solutions_;
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user