Class EntityDeleter

Inheritance Relationships

Base Type

  • public rclcpp::Node

Class Documentation

class EntityDeleter : public rclcpp::Node

A ROS 2 node for deleting entities from a Gazebo simulation.

Public Functions

EntityDeleter()

Default constructor. Initializes the node and delete entity client.

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

Constructor that accepts an external delete service client.

Parameters:

client[in] Shared pointer to the delete entity service client.

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

Deletes an entity from the simulation.

Parameters:
  • entity_name[in] Name of the entity.

  • entity_id[in] ID of the entity.

  • entity_type[in] Type of the entity.

Returns:

True if the entity was deleted successfully, false otherwise.

Protected Attributes

rclcpp::Client<ros_gz_interfaces::srv::DeleteEntity>::SharedPtr client_

Client used to call the delete entity service.