Skip to content

Commit

Permalink
Merge pull request moveit#3397 from v4hn/pr-werror-on-debian-testing
Browse files Browse the repository at this point in the history
Address deprecation warnings in Debian bookworm
  • Loading branch information
v4hn committed Apr 11, 2023
2 parents fd069d6 + 45349f7 commit 740412a
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,6 @@ class AllowedCollisionMatrix
/** @brief Construct the structure from a message representation */
AllowedCollisionMatrix(const moveit_msgs::AllowedCollisionMatrix& msg);

/** @brief Copy constructor */
AllowedCollisionMatrix(const AllowedCollisionMatrix& acm) = default;

/** @brief Get the type of the allowed collision between two elements.
* Return true if the entry is included in the collision matrix. Return false if the entry is not found.
* @param name1 name of first element
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -551,7 +551,7 @@ class NearestNeighborsGNAT : public NearestNeighbors<_T>
std::vector<int> permutation(children_.size());
for (unsigned int i = 0; i < permutation.size(); ++i)
permutation[i] = i;
std::random_shuffle(permutation.begin(), permutation.end());
std::shuffle(permutation.begin(), permutation.end(), std::default_random_engine{});

for (unsigned int i = 0; i < children_.size(); ++i)
if (permutation[i] >= 0)
Expand Down Expand Up @@ -605,7 +605,7 @@ class NearestNeighborsGNAT : public NearestNeighbors<_T>
std::vector<int> permutation(children_.size());
for (unsigned int i = 0; i < permutation.size(); ++i)
permutation[i] = i;
std::random_shuffle(permutation.begin(), permutation.end());
std::shuffle(permutation.begin(), permutation.end(), std::default_random_engine{});

for (unsigned int i = 0; i < children_.size(); ++i)
if (permutation[i] >= 0)
Expand Down
11 changes: 10 additions & 1 deletion moveit_setup_assistant/src/tools/collision_linear_model.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,16 @@ bool SortFilterProxyModel::lessThan(const QModelIndex& src_left, const QModelInd
if (value_left == value_right)
continue;

bool smaller = (value_left < value_right);
bool smaller{};
switch (value_left.type())
{
case QVariant::Int:
smaller = value_left.toInt() < value_right.toInt();
break;
default:
smaller = value_left.toString() < value_right.toString();
break;
}
if (sort_orders_[i] == Qt::DescendingOrder)
smaller = !smaller;
return smaller;
Expand Down
4 changes: 2 additions & 2 deletions moveit_setup_assistant/src/widgets/simulation_widget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -223,8 +223,8 @@ void SimulationWidget::openURDF()
QString editor = qgetenv("EDITOR");
if (editor.isEmpty())
editor = "xdg-open";
auto command = QString("%1 %2").arg(editor, config_data_->urdf_path_.c_str());
if (!QProcess::startDetached(command))
QStringList args{ QString::fromStdString(config_data_->urdf_path_) };
if (!QProcess::startDetached(editor, args))
QMessageBox::warning(this, "URDF Editor", tr("Failed to open editor: <pre>%1</pre>").arg(editor));
}

Expand Down

0 comments on commit 740412a

Please sign in to comment.