Skip to content

Commit

Permalink
Resolved storePlannerData into a lambda
Browse files Browse the repository at this point in the history
  • Loading branch information
Shobuj-Paul committed Oct 14, 2023
1 parent f27da2a commit ac83266
Showing 1 changed file with 4 additions and 22 deletions.
26 changes: 4 additions & 22 deletions moveit_planners/ompl/ompl_interface/src/ompl_interface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,18 +60,9 @@ OMPLInterface::OMPLInterface(const moveit::core::RobotModelConstPtr& robot_model

store_planner_data_service_ = node_->create_service<std_srvs::srv::Trigger>(
"store_planner_data",
[this](const std::shared_ptr<std_srvs::srv::Trigger::Request>& /* unused */,
[this](const std::shared_ptr<std_srvs::srv::Trigger::Request>& request,
const std::shared_ptr<std_srvs::srv::Trigger::Response>& response) -> void {
bool success = context_manager_.storePlannerData();
response->success = success;
if (success)
{
RCLCPP_INFO(LOGGER, "Stored motion planner data");
}
else
{
RCLCPP_ERROR(LOGGER, "Motion planning graph is empty");
}
storePlannerData(request, response);
});
}

Expand All @@ -91,18 +82,9 @@ OMPLInterface::OMPLInterface(const moveit::core::RobotModelConstPtr& robot_model

store_planner_data_service_ = node_->create_service<std_srvs::srv::Trigger>(
"store_planner_data",
[this](const std::shared_ptr<std_srvs::srv::Trigger::Request>& /* unused */,
[this](const std::shared_ptr<std_srvs::srv::Trigger::Request>& request,
const std::shared_ptr<std_srvs::srv::Trigger::Response>& response) -> void {
bool success = context_manager_.storePlannerData();
response->success = success;
if (success)
{
RCLCPP_INFO(LOGGER, "Stored motion planner data");
}
else
{
RCLCPP_ERROR(LOGGER, "Motion planning graph is empty");
}
storePlannerData(request, response);
});
}

Expand Down

0 comments on commit ac83266

Please sign in to comment.