mirror of
https://github.com/moveit/moveit_task_constructor.git
synced 2025-11-04 14:49:57 +08:00
establish struct cost pattern
for costs with multiple parameters, this option-style is more useful than verbose getter/setter. There is nothing to hide here.
This commit is contained in:
parent
f9ba302728
commit
cf0e4e3b01
@ -8,15 +8,14 @@ namespace cost {
|
|||||||
|
|
||||||
/// These structures all implement the Stage::CostTerm API and can be configured via Stage::setCostTerm()
|
/// These structures all implement the Stage::CostTerm API and can be configured via Stage::setCostTerm()
|
||||||
/// add a constant cost to each solution
|
/// add a constant cost to each solution
|
||||||
class ConstantCost
|
struct ConstantCost
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
ConstantCost(double cost) : cost_(cost) {}
|
ConstantCost(double c) : cost(c) {}
|
||||||
|
|
||||||
double operator()(const SubTrajectory&) { return cost_; }
|
double operator()(const SubTrajectory&, std::string& /* unused */) const { return cost; }
|
||||||
|
|
||||||
private:
|
double cost;
|
||||||
double cost_;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/// execution duration of the whole trajectory
|
/// execution duration of the whole trajectory
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user