Skip to content

Commit

Permalink
Remove any '/' at start of tf_prefix and only add '/' at the end of t…
Browse files Browse the repository at this point in the history
…f_prefix when not there yet
  • Loading branch information
Kees van Teeffelen committed Feb 26, 2024
1 parent 219a121 commit ab1f2c6
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion diff_drive_controller/src/diff_drive_controller.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -378,7 +378,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 + "/";
}
}
}

Expand Down

0 comments on commit ab1f2c6

Please sign in to comment.