62 save_geometry_service_ =
context_->moveit_cpp_->getNode()->create_service<moveit_msgs::srv::SaveGeometryToFile>(
63 SAVE_GEOMETRY_TO_FILE_SERVICE_NAME,
64 [
this](
const std::shared_ptr<moveit_msgs::srv::SaveGeometryToFile::Request>& req,
65 const std::shared_ptr<moveit_msgs::srv::SaveGeometryToFile::Response>& res) {
66 std::ofstream file(req->file_path_and_name);
69 RCLCPP_ERROR(getLogger(),
"Unable to open file %s for saving CollisionObjects",
70 req->file_path_and_name.c_str());
75 locked_ps->saveGeometryToStream(file);