Skip to content

Commit

Permalink
Fix segfault at reconfigure of AdmittanceController (ros-controls#1248)
Browse files Browse the repository at this point in the history
  • Loading branch information
firesurfer authored and RobertWilbrandt committed Sep 19, 2024
1 parent 929be94 commit de452f2
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -46,11 +46,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 de452f2

Please sign in to comment.