Class DomainExpertClient

Inheritance Relationships

Base Type

Class Documentation

class DomainExpertClient : public plansys2::DomainExpertInterface

DomainExpertClient requests changes or gets information to/from the DomainExpertNode.

Any node can create a DomainExpertClient object to requests changes to the DomainExpertNode, or to get information from it. It presents the same interface of the DomainExpert, and hides the complexity of using services.

Public Functions

DomainExpertClient()

Create a new DomainExpertClient.

virtual std::string getName()

Get the domain name.

Returns

A string containing the domain name.

virtual std::vector<std::string> getTypes()

Get the predicates existing in the domain.

Returns

The vector containing the name of the predicates.

virtual std::vector<std::string> getConstants(const std::string &type)

Get the details of a constants existing for a type.

Parameters

predicate[in] The name of the type.

Returns

A list of constants names for the passed type

virtual std::vector<plansys2::Predicate> getPredicates()

Get the predicates existing in the domain.

Returns

The vector containing the name of the predicates.

virtual std::optional<plansys2::Predicate> getPredicate(const std::string &predicate)

Get the details of a predicate existing in the domain.

Parameters

predicate[in] The name of the predicate.

Returns

A Predicate object containing the predicate name and its parameters (name and type). If the predicate does not exist, the value returned has not value.

virtual std::vector<plansys2::Function> getFunctions()

Get the functions existing in the domain.

Returns

The vector containing the name of the functions.

virtual std::optional<plansys2::Function> getFunction(const std::string &function)

Get the details of a function existing in the domain.

Parameters

function[in] The name of the function.

Returns

A Function object containing the function name and its parameters (name and type). If the function does not exist, the value returned has not value.

virtual std::vector<std::string> getActions()

Get the regular actions existing in the domain.

Returns

The vector containing the names of the actions.

virtual plansys2_msgs::msg::Action::SharedPtr getAction(const std::string &action, const std::vector<std::string> &params = {})

Get the details of a regular action existing in the domain.

Parameters

action[in] The name of the action.

Returns

An Action object containing the action name, parameters, requirements and effects. If the action does not exist, the value returned has not value.

virtual std::vector<std::string> getDurativeActions()

Get the temporal actions existing in the domain.

Returns

The vector containing the names of the actions.

virtual plansys2_msgs::msg::DurativeAction::SharedPtr getDurativeAction(const std::string &action, const std::vector<std::string> &params = {})

Get the details of a durative action existing in the domain.

Parameters

action[in] The name of the action.

Returns

A Durative Action object containing the action name, parameters, requirements and effects. If the action does not exist, the value returned has not value.

virtual std::string getDomain()

Get the current domain, ready to be saved to file, or to initialize another domain.

Returns

A string containing the domain.