Program Listing for File delete_entity.hpp

Return to documentation for file (include/ros_gz_sim/delete_entity.hpp)

// Copyright 2025 Open Source Robotics Foundation, Inc.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.


#ifndef ROS_GZ_SIM__DELETE_ENTITY_HPP_
#define ROS_GZ_SIM__DELETE_ENTITY_HPP_

#include <memory>
#include <string>

#include <rclcpp/rclcpp.hpp>
#include <ros_gz_interfaces/msg/entity.hpp>
#include <ros_gz_interfaces/srv/delete_entity.hpp>

class EntityDeleter : public rclcpp::Node {
public:
  EntityDeleter();

  explicit EntityDeleter(
    rclcpp::Client<ros_gz_interfaces::srv::DeleteEntity>::SharedPtr client);

  bool delete_entity(
    const std::string & entity_name, int entity_id,
    int entity_type);

protected:
  rclcpp::Client<ros_gz_interfaces::srv::DeleteEntity>::SharedPtr client_;
};

#endif  // ROS_GZ_SIM__DELETE_ENTITY_HPP_