mirror of
https://github.com/moveit/moveit_task_constructor.git
synced 2025-11-04 14:49:57 +08:00
setCostTermShort(nullptr) must not set a valid function
This commit is contained in:
parent
a0975e3afc
commit
939f0b7256
@ -356,7 +356,10 @@ void Stage::setCostTerm(const CostTerm& term) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void Stage::setCostTerm(const CostTermShort& term) {
|
void Stage::setCostTerm(const CostTermShort& term) {
|
||||||
|
if (term)
|
||||||
setCostTerm([=](auto&& solution, auto&&) { return term(solution); });
|
setCostTerm([=](auto&& solution, auto&&) { return term(solution); });
|
||||||
|
else
|
||||||
|
pimpl()->cost_term_ = nullptr;
|
||||||
}
|
}
|
||||||
|
|
||||||
const ordered<SolutionBaseConstPtr>& Stage::solutions() const {
|
const ordered<SolutionBaseConstPtr>& Stage::solutions() const {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user