Skip to content

Commit

Permalink
Fix segfault at reconfigure of AdmittanceController (#1248)
Browse files Browse the repository at this point in the history
(cherry picked from commit 31f7fbe)
  • Loading branch information
firesurfer authored and mergify[bot] committed Aug 22, 2024
1 parent 85e8fff commit 126ed15
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,17 @@ controller_interface::return_type AdmittanceRule::configure(
{
try
{
// Make sure we destroy the interface first. Otherwise we might run into a segfault
if (kinematics_loader_)
{
kinematics_.reset();
}
kinematics_loader_ =
std::make_shared<pluginlib::ClassLoader<kinematics_interface::KinematicsInterface>>(
parameters_.kinematics.plugin_package, "kinematics_interface::KinematicsInterface");
kinematics_ = std::unique_ptr<kinematics_interface::KinematicsInterface>(
kinematics_loader_->createUnmanagedInstance(parameters_.kinematics.plugin_name));

if (!kinematics_->initialize(
node->get_node_parameters_interface(), parameters_.kinematics.tip))
{
Expand Down

0 comments on commit 126ed15

Please sign in to comment.