Skip to content

Commit

Permalink
Fix segfault at reconfigure of AdmittanceController (#1248)
Browse files Browse the repository at this point in the history
  • Loading branch information
firesurfer authored Aug 22, 2024
1 parent 4ab22a5 commit 31f7fbe
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 31f7fbe

Please sign in to comment.