mirror of
https://github.com/moveit/moveit_task_constructor.git
synced 2025-09-27 00:29:13 +08:00
Fix more clang-tidy issues
This commit is contained in:
parent
4fa8c10f44
commit
cfcb1f274e
@ -1,6 +1,5 @@
|
|||||||
---
|
---
|
||||||
Checks: '-*,
|
Checks: 'performance-*,
|
||||||
performance-*,
|
|
||||||
llvm-namespace-comment,
|
llvm-namespace-comment,
|
||||||
modernize-redundant-void-arg,
|
modernize-redundant-void-arg,
|
||||||
modernize-use-nullptr,
|
modernize-use-nullptr,
|
||||||
|
@ -462,15 +462,14 @@ void SerialContainer::onNewSolution(const SolutionBase& current) {
|
|||||||
|
|
||||||
// collect (and sort) all solutions spanning from start to end of this container
|
// collect (and sort) all solutions spanning from start to end of this container
|
||||||
ordered<SolutionSequencePtr> sorted;
|
ordered<SolutionSequencePtr> sorted;
|
||||||
SolutionSequence::container_type solution;
|
|
||||||
solution.reserve(children.size());
|
|
||||||
for (auto& in : incoming.solutions) {
|
for (auto& in : incoming.solutions) {
|
||||||
for (auto& out : outgoing.solutions) {
|
for (auto& out : outgoing.solutions) {
|
||||||
InterfaceState::Priority prio = in.second + InterfaceState::Priority(1u, current.cost()) + out.second;
|
InterfaceState::Priority prio = in.second + InterfaceState::Priority(1u, current.cost()) + out.second;
|
||||||
assert(prio.enabled());
|
assert(prio.enabled());
|
||||||
// found a complete solution path connecting start to end?
|
// found a complete solution path connecting start to end?
|
||||||
if (prio.depth() == children.size()) {
|
if (prio.depth() == children.size()) {
|
||||||
assert(solution.empty());
|
SolutionSequence::container_type solution;
|
||||||
|
solution.reserve(children.size());
|
||||||
// insert incoming solutions in reverse order
|
// insert incoming solutions in reverse order
|
||||||
solution.insert(solution.end(), in.first.rbegin(), in.first.rend());
|
solution.insert(solution.end(), in.first.rbegin(), in.first.rend());
|
||||||
// insert current solution
|
// insert current solution
|
||||||
|
@ -74,7 +74,7 @@ bool JointInterpolationPlanner::plan(const planning_scene::PlanningSceneConstPtr
|
|||||||
|
|
||||||
moveit::core::RobotState waypoint(from_state);
|
moveit::core::RobotState waypoint(from_state);
|
||||||
double delta = d < 1e-6 ? 1.0 : props.get<double>("max_step") / d;
|
double delta = d < 1e-6 ? 1.0 : props.get<double>("max_step") / d;
|
||||||
for (double t = delta; t < 1.0; t += delta) {
|
for (double t = delta; t < 1.0; t += delta) { // NOLINT(clang-analyzer-security.FloatLoopCounter)
|
||||||
from_state.interpolate(to_state, t, waypoint);
|
from_state.interpolate(to_state, t, waypoint);
|
||||||
result->addSuffixWayPoint(waypoint, t);
|
result->addSuffixWayPoint(waypoint, t);
|
||||||
|
|
||||||
|
@ -172,12 +172,12 @@ TEST(ContainerBase, positionForInsert) {
|
|||||||
|
|
||||||
/* TODO: remove interface as it returns raw pointers */
|
/* TODO: remove interface as it returns raw pointers */
|
||||||
TEST(ContainerBase, findChild) {
|
TEST(ContainerBase, findChild) {
|
||||||
SerialContainer s, *c2;
|
SerialContainer s;
|
||||||
Stage *a, *b, *c1, *d;
|
Stage *a, *b, *c1, *d;
|
||||||
s.add(Stage::pointer(a = new NamedStage("a")));
|
s.add(Stage::pointer(a = new NamedStage("a")));
|
||||||
s.add(Stage::pointer(b = new NamedStage("b")));
|
s.add(Stage::pointer(b = new NamedStage("b")));
|
||||||
s.add(Stage::pointer(c1 = new NamedStage("c")));
|
s.add(Stage::pointer(c1 = new NamedStage("c")));
|
||||||
auto sub = ContainerBase::pointer(c2 = new SerialContainer("c"));
|
auto sub = ContainerBase::pointer(new SerialContainer("c"));
|
||||||
sub->add(Stage::pointer(d = new NamedStage("d")));
|
sub->add(Stage::pointer(d = new NamedStage("d")));
|
||||||
s.add(std::move(sub));
|
s.add(std::move(sub));
|
||||||
|
|
||||||
@ -678,11 +678,11 @@ TEST(Task, move) {
|
|||||||
MOCK_ID = 0;
|
MOCK_ID = 0;
|
||||||
Task t2 = std::move(t1);
|
Task t2 = std::move(t1);
|
||||||
EXPECT_EQ(t2.stages()->numChildren(), 2u);
|
EXPECT_EQ(t2.stages()->numChildren(), 2u);
|
||||||
EXPECT_EQ(t1.stages()->numChildren(), 0u);
|
EXPECT_EQ(t1.stages()->numChildren(), 0u); // NOLINT(clang-analyzer-cplusplus.Move)
|
||||||
|
|
||||||
t1 = std::move(t2);
|
t1 = std::move(t2);
|
||||||
EXPECT_EQ(t1.stages()->numChildren(), 2u);
|
EXPECT_EQ(t1.stages()->numChildren(), 2u);
|
||||||
EXPECT_EQ(t2.stages()->numChildren(), 0u);
|
EXPECT_EQ(t2.stages()->numChildren(), 0u); // NOLINT(clang-analyzer-cplusplus.Move)
|
||||||
}
|
}
|
||||||
|
|
||||||
TEST(Task, reuse) {
|
TEST(Task, reuse) {
|
||||||
|
@ -64,7 +64,7 @@ class SubPanel : public QWidget
|
|||||||
public:
|
public:
|
||||||
SubPanel(QWidget* parent = nullptr) : QWidget(parent) {}
|
SubPanel(QWidget* parent = nullptr) : QWidget(parent) {}
|
||||||
|
|
||||||
virtual void save(rviz::Config config) {}
|
virtual void save(rviz::Config config) {} // NOLINT(performance-unnecessary-value-param)
|
||||||
virtual void load(const rviz::Config& config) {}
|
virtual void load(const rviz::Config& config) {}
|
||||||
|
|
||||||
Q_SIGNALS:
|
Q_SIGNALS:
|
||||||
|
@ -82,6 +82,7 @@ public:
|
|||||||
void configureTaskListModel(TaskListModel* model);
|
void configureTaskListModel(TaskListModel* model);
|
||||||
/// configure all TaskListModels that were already created when TaskView gets instantiated
|
/// configure all TaskListModels that were already created when TaskView gets instantiated
|
||||||
void configureExistingModels();
|
void configureExistingModels();
|
||||||
|
// NOLINTNEXTLINE(readability-identifier-naming)
|
||||||
/// configure newly inserted models
|
/// configure newly inserted models
|
||||||
void _q_configureInsertedModels(const QModelIndex& parent, int first, int last);
|
void _q_configureInsertedModels(const QModelIndex& parent, int first, int last);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user