Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions moveit_ros/moveit_servo/include/moveit_servo/servo.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -229,6 +229,9 @@ class Servo
std::atomic<double> collision_velocity_scale_ = 1.0;
std::unique_ptr<CollisionMonitor> collision_monitor_;

// Plugin loader
std::unique_ptr<pluginlib::ClassLoader<online_signal_smoothing::SmoothingBaseClass>> smoother_loader_;
Comment on lines +232 to +233
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi Bijou, long time no see. Thanks for fixing this, it's been annoying for too long.

I don't think it needs to be a unique_ptr? But I'll still approve the PR either way.

Suggested change
// Plugin loader
std::unique_ptr<pluginlib::ClassLoader<online_signal_smoothing::SmoothingBaseClass>> smoother_loader_;
// Plugin loader
pluginlib::ClassLoader<online_signal_smoothing::SmoothingBaseClass> smoother_loader_;


// Pointer to the (optional) smoothing plugin.
pluginlib::UniquePtr<online_signal_smoothing::SmoothingBaseClass> smoother_ = nullptr;

Expand Down
4 changes: 2 additions & 2 deletions moveit_ros/moveit_servo/src/servo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -139,9 +139,9 @@ void Servo::setSmoothingPlugin()
// Load the smoothing plugin
try
{
pluginlib::ClassLoader<online_signal_smoothing::SmoothingBaseClass> smoothing_loader(
smoother_loader_ = std::make_unique<pluginlib::ClassLoader<online_signal_smoothing::SmoothingBaseClass>>(
"moveit_core", "online_signal_smoothing::SmoothingBaseClass");
smoother_ = smoothing_loader.createUniqueInstance(servo_params_.smoothing_filter_plugin_name);
smoother_ = smoother_loader_->createUniqueInstance(servo_params_.smoothing_filter_plugin_name);
}
catch (pluginlib::PluginlibException& ex)
{
Expand Down
Loading