mirror of
https://github.com/moveit/moveit_task_constructor.git
synced 2025-11-04 14:49:57 +08:00
satisfy clang-tidy & -Werror -Wall -Wextra
This commit is contained in:
parent
924e733a42
commit
9d53987e53
@ -118,7 +118,7 @@ class PathLength : public TrajectoryCostTerm
|
|||||||
public:
|
public:
|
||||||
PathLength() = default;
|
PathLength() = default;
|
||||||
PathLength(std::vector<std::string> j) : joints{ std::move(j) } {};
|
PathLength(std::vector<std::string> j) : joints{ std::move(j) } {};
|
||||||
double operator()(const SubTrajectory&, std::string&) const override;
|
double operator()(const SubTrajectory& s, std::string& comment) const override;
|
||||||
|
|
||||||
std::vector<std::string> joints;
|
std::vector<std::string> joints;
|
||||||
};
|
};
|
||||||
|
|||||||
@ -30,9 +30,9 @@ struct PredefinedCosts : CostTerm
|
|||||||
return cost_;
|
return cost_;
|
||||||
}
|
}
|
||||||
|
|
||||||
double operator()(const SubTrajectory& s, std::string& comment) const override { return cost(); }
|
double operator()(const SubTrajectory& /*s*/, std::string& /*comment*/) const override { return cost(); }
|
||||||
double operator()(const SolutionSequence& s, std::string& comment) const override { return cost(); }
|
double operator()(const SolutionSequence& /*s*/, std::string& /*comment*/) const override { return cost(); }
|
||||||
double operator()(const WrappedSolution& s, std::string& comment) const override { return cost(); }
|
double operator()(const WrappedSolution& /*s*/, std::string& /*comment*/) const override { return cost(); }
|
||||||
};
|
};
|
||||||
|
|
||||||
/** Generator creating solutions with given costs */
|
/** Generator creating solutions with given costs */
|
||||||
@ -197,9 +197,9 @@ TEST_F(Pruning, PropagatorFailure) {
|
|||||||
add(task, new ForwardMockup({ INF }));
|
add(task, new ForwardMockup({ INF }));
|
||||||
|
|
||||||
EXPECT_FALSE(task.plan());
|
EXPECT_FALSE(task.plan());
|
||||||
ASSERT_EQ(task.solutions().size(), 0);
|
ASSERT_EQ(task.solutions().size(), 0u);
|
||||||
// ForwardMockup fails, so the backward stage should never compute
|
// ForwardMockup fails, so the backward stage should never compute
|
||||||
EXPECT_EQ(back->calls_, 0);
|
EXPECT_EQ(back->calls_, 0u);
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_F(Pruning, PruningMultiForward) {
|
TEST_F(Pruning, PruningMultiForward) {
|
||||||
@ -215,7 +215,7 @@ TEST_F(Pruning, PruningMultiForward) {
|
|||||||
|
|
||||||
// the second (infeasible) solution in the last stage must not disable
|
// the second (infeasible) solution in the last stage must not disable
|
||||||
// the earlier partial solution just because they share stage solutions
|
// the earlier partial solution just because they share stage solutions
|
||||||
ASSERT_EQ(task.solutions().size(), 1);
|
ASSERT_EQ(task.solutions().size(), 1u);
|
||||||
EXPECT_EQ((*task.solutions().begin())->cost(), 0u);
|
EXPECT_EQ((*task.solutions().begin())->cost(), 0u);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -273,7 +273,7 @@ TEST_F(Pruning, PropagateIntoContainer) {
|
|||||||
|
|
||||||
// the failure in the backward stage (outside the container)
|
// the failure in the backward stage (outside the container)
|
||||||
// should prune the expected computation of con inside the container
|
// should prune the expected computation of con inside the container
|
||||||
EXPECT_EQ(con->calls_, 0);
|
EXPECT_EQ(con->calls_, 0u);
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_F(Pruning, PropagateFromContainerPull) {
|
TEST_F(Pruning, PropagateFromContainerPull) {
|
||||||
@ -288,7 +288,7 @@ TEST_F(Pruning, PropagateFromContainerPull) {
|
|||||||
EXPECT_FALSE(task.plan());
|
EXPECT_FALSE(task.plan());
|
||||||
|
|
||||||
// the failure inside the container should prune computing of back
|
// the failure inside the container should prune computing of back
|
||||||
EXPECT_EQ(back->calls_, 0);
|
EXPECT_EQ(back->calls_, 0u);
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_F(Pruning, PropagateFromContainerPush) {
|
TEST_F(Pruning, PropagateFromContainerPush) {
|
||||||
@ -302,7 +302,7 @@ TEST_F(Pruning, PropagateFromContainerPush) {
|
|||||||
EXPECT_FALSE(task.plan());
|
EXPECT_FALSE(task.plan());
|
||||||
|
|
||||||
// the failure inside container should prune computing of con
|
// the failure inside container should prune computing of con
|
||||||
EXPECT_EQ(con->calls_, 0);
|
EXPECT_EQ(con->calls_, 0u);
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST_F(Pruning, PropagateFromParallelContainerMultiplePaths) {
|
TEST_F(Pruning, PropagateFromParallelContainerMultiplePaths) {
|
||||||
@ -318,5 +318,5 @@ TEST_F(Pruning, PropagateFromParallelContainerMultiplePaths) {
|
|||||||
EXPECT_TRUE(task.plan());
|
EXPECT_TRUE(task.plan());
|
||||||
|
|
||||||
// the failure in one branch of Alternatives must not prune computing back
|
// the failure in one branch of Alternatives must not prune computing back
|
||||||
EXPECT_EQ(back->calls_, 1);
|
EXPECT_EQ(back->calls_, 1u);
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user