mirror of
https://github.com/moveit/moveit_task_constructor.git
synced 2025-09-27 00:29:13 +08:00
clang-tidy: fix variable/method naming
This commit is contained in:
parent
4f74af8fb7
commit
164ce4eab8
@ -86,7 +86,7 @@ public:
|
||||
ARMED, // disabled state in a Connecting interface that will become re-enabled with a new opposite state
|
||||
PRUNED, // disabled state on a pruned solution branch
|
||||
};
|
||||
static const char* STATUS_COLOR[];
|
||||
static const char* colorForStatus(unsigned int s) { return STATUS_COLOR_[s]; }
|
||||
|
||||
/** InterfaceStates are ordered according to two values:
|
||||
* Depth of interlinked trajectory parts and accumulated trajectory costs along that path.
|
||||
@ -157,6 +157,7 @@ private:
|
||||
inline void setPriority(const Priority& prio) { priority_ = prio; }
|
||||
|
||||
private:
|
||||
static const char* STATUS_COLOR_[];
|
||||
planning_scene::PlanningSceneConstPtr scene_;
|
||||
PropertyMap properties_;
|
||||
/// trajectories which are *timewise before* this state
|
||||
|
@ -1052,6 +1052,7 @@ void FallbacksPrivateConnect::onNewFailure(const Stage& child, const InterfaceSt
|
||||
// ... thus we can use std::next(active_) to find the next child
|
||||
auto next = std::next(active_);
|
||||
|
||||
// NOLINTNEXTLINE(readability-identifier-naming)
|
||||
auto findIteratorFor = [](const InterfaceState* state, const Interface& interface) {
|
||||
auto it = std::find(interface.begin(), interface.end(), state);
|
||||
assert(it != interface.end());
|
||||
@ -1061,9 +1062,9 @@ void FallbacksPrivateConnect::onNewFailure(const Stage& child, const InterfaceSt
|
||||
if (next != children().end()) { // pass job to next child
|
||||
auto next_con = static_cast<ConnectingPrivate*>(const_cast<StagePrivate*>((*next)->pimpl()));
|
||||
auto first_con = static_cast<const ConnectingPrivate*>(children().front()->pimpl());
|
||||
auto fromIt = findIteratorFor(from, *first_con->starts());
|
||||
auto toIt = findIteratorFor(to, *first_con->ends());
|
||||
next_con->pending.insert(std::make_pair(fromIt, toIt));
|
||||
auto from_it = findIteratorFor(from, *first_con->starts());
|
||||
auto to_it = findIteratorFor(to, *first_con->ends());
|
||||
next_con->pending.insert(std::make_pair(from_it, to_it));
|
||||
} else // or report failure to parent
|
||||
parent()->pimpl()->onNewFailure(*me(), from, to);
|
||||
}
|
||||
|
@ -854,12 +854,12 @@ void ConnectingPrivate::compute() {
|
||||
}
|
||||
|
||||
std::ostream& ConnectingPrivate::printPendingPairs(std::ostream& os) const {
|
||||
const char* reset = InterfaceState::STATUS_COLOR[3];
|
||||
const char* reset = InterfaceState::colorForStatus(3);
|
||||
for (const auto& candidate : pending) {
|
||||
size_t first = getIndex(*starts(), candidate.first);
|
||||
size_t second = getIndex(*ends(), candidate.second);
|
||||
os << InterfaceState::STATUS_COLOR[candidate.first->priority().status()] << first << reset << ":"
|
||||
<< InterfaceState::STATUS_COLOR[candidate.second->priority().status()] << second << reset << " ";
|
||||
os << InterfaceState::colorForStatus(candidate.first->priority().status()) << first << reset << ":"
|
||||
<< InterfaceState::colorForStatus(candidate.second->priority().status()) << second << reset << " ";
|
||||
}
|
||||
if (pending.empty())
|
||||
os << "---";
|
||||
|
@ -242,7 +242,7 @@ bool MoveRelative::compute(const InterfaceState& state, planning_scene::Planning
|
||||
// linear+angular are expressed w.r.t. model frame and thus we need left-multiplication
|
||||
linear = frame_pose.linear() * linear;
|
||||
angular = frame_pose.linear() * angular;
|
||||
auto R = Eigen::AngleAxisd(angular_norm, angular);
|
||||
auto R = Eigen::AngleAxisd(angular_norm, angular); // NOLINT(readability-identifier-naming)
|
||||
auto p = ik_pose_world.translation();
|
||||
target_eigen = Eigen::Translation3d(linear + p - R * p) * (R * ik_pose_world);
|
||||
goto COMPUTE;
|
||||
|
@ -167,7 +167,7 @@ std::ostream& operator<<(std::ostream& os, const Interface& interface) {
|
||||
os << istate->priority() << " ";
|
||||
return os;
|
||||
}
|
||||
const char* InterfaceState::STATUS_COLOR[] = {
|
||||
const char* InterfaceState::STATUS_COLOR_[] = {
|
||||
"\033[32m", // ENABLED - green
|
||||
"\033[33m", // ARMED - yellow
|
||||
"\033[31m", // PRUNED - red
|
||||
@ -175,8 +175,8 @@ const char* InterfaceState::STATUS_COLOR[] = {
|
||||
};
|
||||
std::ostream& operator<<(std::ostream& os, const InterfaceState::Priority& prio) {
|
||||
// maps InterfaceState::Status values to output (color-changing) prefix
|
||||
os << InterfaceState::STATUS_COLOR[prio.status()] << prio.depth() << ":" << prio.cost()
|
||||
<< InterfaceState::STATUS_COLOR[3];
|
||||
os << InterfaceState::colorForStatus(prio.status()) << prio.depth() << ":" << prio.cost()
|
||||
<< InterfaceState::colorForStatus(3);
|
||||
return os;
|
||||
}
|
||||
std::ostream& operator<<(std::ostream& os, Interface::Direction dir) {
|
||||
|
@ -225,7 +225,7 @@ TaskViewPrivate::TaskViewPrivate(TaskView* view) : q_ptr(view), exec_action_clie
|
||||
meta_model->setMimeTypes({ factory->mimeType() });
|
||||
tasks_view->setModel(meta_model);
|
||||
QObject::connect(meta_model, SIGNAL(rowsInserted(QModelIndex, int, int)), q_ptr,
|
||||
SLOT(_q_configureInsertedModels(QModelIndex, int, int)));
|
||||
SLOT(configureInsertedModels(QModelIndex, int, int)));
|
||||
|
||||
tasks_view->setSelectionMode(QAbstractItemView::ExtendedSelection);
|
||||
tasks_view->setAcceptDrops(true);
|
||||
@ -261,7 +261,7 @@ void TaskViewPrivate::configureExistingModels() {
|
||||
configureTaskListModel(meta_model->getTaskListModel(meta_model->index(row, 0)).first);
|
||||
}
|
||||
|
||||
void TaskViewPrivate::_q_configureInsertedModels(const QModelIndex& parent, int first, int last) {
|
||||
void TaskViewPrivate::configureInsertedModels(const QModelIndex& parent, int first, int last) {
|
||||
if (parent.isValid() && !parent.parent().isValid()) { // top-level task items inserted
|
||||
int expand = q_ptr->initial_task_expand->getOptionInt();
|
||||
for (int row = first; row <= last; ++row) {
|
||||
|
@ -156,7 +156,7 @@ protected Q_SLOTS:
|
||||
void onOldTaskHandlingChanged();
|
||||
|
||||
private:
|
||||
Q_PRIVATE_SLOT(d_ptr, void _q_configureInsertedModels(QModelIndex, int, int));
|
||||
Q_PRIVATE_SLOT(d_ptr, void configureInsertedModels(QModelIndex, int, int));
|
||||
|
||||
Q_SIGNALS:
|
||||
void oldTaskHandlingChanged(int old_task_handling);
|
||||
|
@ -82,9 +82,8 @@ public:
|
||||
void configureTaskListModel(TaskListModel* model);
|
||||
/// configure all TaskListModels that were already created when TaskView gets instantiated
|
||||
void configureExistingModels();
|
||||
// NOLINTNEXTLINE(readability-identifier-naming)
|
||||
/// configure newly inserted models
|
||||
void _q_configureInsertedModels(const QModelIndex& parent, int first, int last);
|
||||
void configureInsertedModels(const QModelIndex& parent, int first, int last);
|
||||
|
||||
/// unlock locked_display_ if given display is different
|
||||
void lock(TaskDisplay* display);
|
||||
|
@ -238,8 +238,8 @@ int main(int argc, char** argv) {
|
||||
// NOLINTNEXTLINE(clang-analyzer-cplusplus.NewDeleteLeaks)
|
||||
QTimer::singleShot(0, [&]() {
|
||||
::testing::InitGoogleTest(&argc, argv);
|
||||
auto testResult = RUN_ALL_TESTS();
|
||||
app.exit(testResult);
|
||||
auto test_result = RUN_ALL_TESTS();
|
||||
app.exit(test_result);
|
||||
});
|
||||
return app.exec();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user