diff --git a/diff_drive_controller/src/diff_drive_controller.cpp b/diff_drive_controller/src/diff_drive_controller.cpp index c8032e5dc5..4d81be3e8a 100644 --- a/diff_drive_controller/src/diff_drive_controller.cpp +++ b/diff_drive_controller/src/diff_drive_controller.cpp @@ -411,7 +411,15 @@ controller_interface::CallbackReturn DiffDriveController::on_configure( } else { - tf_prefix = tf_prefix + "/"; + // Make sure prefix does not start with '/' and always ends with '/' + if (tf_prefix.front() == '/') + { + tf_prefix.erase(0,1); + } + if (tf_prefix.back() != '/') + { + tf_prefix = tf_prefix + "/"; + } } }