Skip to content

Commit 0e992ef

Browse files
committed
Address review comment
1 parent a68f4fe commit 0e992ef

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

doc/examples/motion_planning_api/src/motion_planning_api_tutorial.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -110,9 +110,11 @@ int main(int argc, char** argv)
110110
{
111111
RCLCPP_FATAL(LOGGER, "Exception while creating planning plugin loader %s", ex.what());
112112
}
113+
114+
const auto& planner_name = planner_plugin_names.at(0);
113115
try
114116
{
115-
planner_instance.reset(planner_plugin_loader->createUnmanagedInstance(planner_plugin_names.at(0)));
117+
planner_instance.reset(planner_plugin_loader->createUnmanagedInstance(planner_name));
116118
if (!planner_instance->initialize(robot_model, motion_planning_api_tutorial_node,
117119
motion_planning_api_tutorial_node->get_namespace()))
118120
RCLCPP_FATAL(LOGGER, "Could not initialize planner instance");
@@ -124,8 +126,8 @@ int main(int argc, char** argv)
124126
std::stringstream ss;
125127
for (const auto& cls : classes)
126128
ss << cls << " ";
127-
RCLCPP_ERROR(LOGGER, "Exception while loading planner '%s': %s\nAvailable plugins: %s",
128-
planner_plugin_names.at(0).c_str(), ex.what(), ss.str().c_str());
129+
RCLCPP_ERROR(LOGGER, "Exception while loading planner '%s': %s\nAvailable plugins: %s", planner_name.c_str(),
130+
ex.what(), ss.str().c_str());
129131
}
130132

131133
moveit::planning_interface::MoveGroupInterface move_group(motion_planning_api_tutorial_node, PLANNING_GROUP);

0 commit comments

Comments
 (0)