@@ -110,7 +110,7 @@ bool controller_name_compare(const controller_manager::ControllerSpec & a, const
110
110
* \return true if interface has a controller name as prefix, false otherwise.
111
111
*/
112
112
bool is_interface_a_chained_interface (
113
- const std::string interface_name,
113
+ const std::string & interface_name,
114
114
const std::vector<controller_manager::ControllerSpec> & controllers,
115
115
controller_manager::ControllersListIterator & following_controller_it)
116
116
{
@@ -316,7 +316,7 @@ controller_interface::return_type evaluate_switch_result(
316
316
{
317
317
std::string list = std::accumulate (
318
318
std::next (deactivate_list.begin ()), deactivate_list.end (), deactivate_list.front (),
319
- [](std::string a, std::string b) { return a + " " + b; });
319
+ [](const std::string & a, const std::string & b) { return a + " " + b; });
320
320
const std::string info_msg =
321
321
fmt::format (FMT_COMPILE (" Deactivated controllers: [ {} ]" ), list);
322
322
message += " \n " + info_msg;
@@ -326,7 +326,7 @@ controller_interface::return_type evaluate_switch_result(
326
326
{
327
327
std::string list = std::accumulate (
328
328
std::next (activate_list.begin ()), activate_list.end (), activate_list.front (),
329
- [](std::string a, std::string b) { return a + " " + b; });
329
+ [](const std::string & a, const std::string & b) { return a + " " + b; });
330
330
const std::string info_msg =
331
331
fmt::format (FMT_COMPILE (" Activated controllers: [ {} ]" ), list);
332
332
message += " \n " + info_msg;
@@ -1195,7 +1195,7 @@ controller_interface::return_type ControllerManager::configure_controller(
1195
1195
{
1196
1196
std::string cmd_itfs_str = std::accumulate (
1197
1197
std::next (cmd_itfs.begin ()), cmd_itfs.end (), cmd_itfs.front (),
1198
- [](std::string a, std::string b) { return a + " , " + b; });
1198
+ [](const std::string & a, const std::string & b) { return a + " , " + b; });
1199
1199
RCLCPP_ERROR (
1200
1200
get_logger (),
1201
1201
" The command interfaces of the controller '%s' are not unique. Please make sure that the "
@@ -1209,7 +1209,7 @@ controller_interface::return_type ControllerManager::configure_controller(
1209
1209
{
1210
1210
std::string state_itfs_str = std::accumulate (
1211
1211
std::next (state_itfs.begin ()), state_itfs.end (), state_itfs.front (),
1212
- [](std::string a, std::string b) { return a + " , " + b; });
1212
+ [](const std::string & a, const std::string & b) { return a + " , " + b; });
1213
1213
RCLCPP_ERROR (
1214
1214
get_logger (),
1215
1215
" The state interfaces of the controller '%s' are not unique. Please make sure that the state "
@@ -1852,9 +1852,10 @@ controller_interface::return_type ControllerManager::switch_controller_cb(
1852
1852
switch_params_.timeout = timeout.to_chrono <std::chrono::nanoseconds>();
1853
1853
}
1854
1854
switch_params_.do_switch = true ;
1855
+
1855
1856
// wait until switch is finished
1856
1857
RCLCPP_DEBUG (get_logger (), " Requested atomic controller switch from realtime loop" );
1857
- std::unique_lock<std::mutex> switch_params_guard (switch_params_.mutex , std::defer_lock );
1858
+ std::unique_lock<std::mutex> switch_params_guard (switch_params_.mutex );
1858
1859
if (!switch_params_.cv .wait_for (
1859
1860
switch_params_guard, switch_params_.timeout , [this ] { return !switch_params_.do_switch ; }))
1860
1861
{
0 commit comments