ROS2-BDI

A planning based Multi-Agent BDI architecture for ROS2


Messages

Belief

Belief.msg
name string
pddl_type uint8
params string[]
value float32
Description Each belief represents either a PDDL instance, a PDDL predicate or a PDDL fluent.
Parameters

name indicates the name of the respective instance, predicate or fluent

pddl_type used to decide whether the belief is a PDDL instance, a PDDL predicate or a PDDL fluent, restricting the range of valid values among three distinct integers, respectively we have:

  • 1 -> INSTANCE_TYPE
  • 2 -> PREDICATE_TYPE
  • 3 -> FLUENT_TYPE

params expresses the arguments of the predicate or fluent in case the belief refers to one of these two types, while it consists of a single element in case of instance belief-type, representing the type of the instance itself (e.g. waypoint, car,..)

value has real meaning just in the case of fluent belief-type, expressing the real number associated with the function instance

Usage
  • The topics agent_id/add_belief and agent_id/del_belief handle Belief messages, respectively representing a belief to be added and a belief to be deleted.
  • The topic agent_id/belief_set outputs messages in the form of BeliefSet, which is simply a list of Belief as expressed here.
  • Each condition withold a belief that needs to be checked.
  • Each desire's value is nonetheless than a targeted list of beliefs that the agent would like to make true.

Condition

Condition.msg
condition_to_check Belief
check string
Description Represents a check to be performed, e.g. before or during the execution of a plan (respectively preconditions or context conditions). The evaluation is going to be performed against the belief set of the agent. Different check operations can be applied depending on the belief-type.
Parameters

condition_to_check is the belief upon which the check needs to be performed

check is a string which accepts exclusively one among the following values {"EX", "T", "F", "EQ", "GR", "LE", "GREQ", "LEQ"}. In order:

  • "EX" stands for 'exists' and it is used to check for the presence of a specific instance-type belief within the belief set
  • "T", "F" respectively stand for 'true' and 'false' and they are used to assess the truth of a certain relation, expressed as a predicate-type belief within the belief set
  • "EQ", "GR", "LE", "GREQ", "LEQ" respectively stand for 'equals', 'greater', 'less', 'greater or equal' and 'less or equal' and they are used to check against the value of a specific fluent-type belief within the belief set. Check always returns false if the latter is not present there.

Usage
  • Can be grouped in a list representing conjunctive (i.e. all must be verified) or disjunctive (i.e. at least one must be verified) expressions. ROS2-BDI uses ConditionsConjunction as a message witholding a list of Condition as literals in conjunction among each other.
  • Can be grouped in a list of list representing DNF expressions. ROS2-BDI uses ConditionsDNF as a message witholding a list of ConditionsConjunction as clauses in disjunction among each other.
  • DNF expressions of Condition (i.e. ConditionsDNF) are currently used to state both the preconditions or the context condition of the plan trying to fulfill a certain desire.

Desire

Desire.msg
name string
value Belief[]
priority float32
deadline float32
precondition ConditionsDNF[]
context ConditionsDNF[]
rollback_belief_add Belief[]
rollback_belief_del Belief[]
Description Represents a target state of the world that the agent might try to make true through the enforcement of a computed plan to advance the current status toward the desired one. Additional properties are applied to express constraints and obligations strictly related to its fullfilment.
Parameters

name is used to identify the desire within the desire set of the agent, hasn't any other implications. An agent cannot have simultaneously two desires with the same name in its desire set.

value list of beliefs that represents the target state of the world that the desire is describing. Fulfilling the desire requires to make all of them true, i.e. meaning that at some point they need to be within the belief set of the agent in order to consider the desire fulfilled.

priority real value in the [0-1] range expressing the priority for the desire: the higher it is, the more important is to fulfilled the desire as soon as possible.

deadline desired deadline for the desire to be fulfilled in. Currently relative to the plan execution and not absolute (global).

precondition list of conditions that must be satisfied before the execution of any plan trying to fulfill the desire

context list of conditions that must be satisfied during the execution of any plan trying to fulfill the desire

rollback_belief_add list of beliefs to be added to the belief set of the agent to restore internal status in case of abortion of any plan trying to fulfill the desire

rollback_belief_del list of beliefs to be removed from the belief set of the agent to restore internal status in case of abortion of any plan trying to fulfill the desire

Usage
  • The topics agent_id/add_desire and agent_id/del_desire handle Desire messages, respectively representing a desire to be added and a desire to be deleted.
  • The topic agent_id/desire_set outputs messages in the form of DesireSet, which is simply a list of Desire as expressed here.
  • Each BDIPlan and BDIPlanExecutionInfo message contains the target desire they're trying to fulfill through the enforcement of their actions.

Plan

BDIPlan.msg
target Desire
actions plansys2_msgs/PlanItem[]
precondition ConditionsDNF[]
context ConditionsDNF[]
Description Static representation of a plan which either needs to be triggered or aborted.
Parameters

target the desire that the plan should fulfill through its enforcement

actions list of actions as represented within the PlanSys2 framework (time, action, duration), so that it can then be easily fed to its Executor

precondition list of conditions that must be satisfied before the execution of the plan

context list of conditions that must be satisfied during the execution of the plan

Usage
  • The service agent_id/plan_execution requires a static plan to be specified in the request compliant to the BDIPlan interface as expressed here. A trigger or abort operation is coupled with it and sent to the ROS2-BDI Plan Director which will process it.

Plan Execution

BDIPlanExecutionInfo.msg
target Desire
actions BDIActionExecutionInfo[]
current_time float32
estimated_deadline float32
status uint8
Description Dynamic representation of a currently running plan with info regarding its current execution status.
Parameters

target the desire that the plan should fulfill through its enforcement

actions a list of the currently running actions packed with data related to their execution status

current_time current time of execution relative to the plan start (init as 0.0).

estimated_deadline estimated deadline for the plan execution

status simple integer coding the current status of the plan:
- 0: RUNNING
- 1: ABORTED
- 2: SUCCESSFUL

Usage
  • The topic agent_id/plan_execution_info regularly post information regarding the currently running plan execution via a BDIPlanExecutionInfo message type.

Action Execution

BDIActionExecutionInfo.msg
index uint16
name string
args string[]
planned_start float32
actual_start float32
exec_time float32
duration float32
progress float32
Description Dynamic representation of a currently running action within a plan execution.
Parameters

index index representing the action position within the original list of actions in the static plan representation for the currently running one

name arguments of the action in execution

args arguments for the action in execution

planned_start states the planned time relative to the plan execution start for the action to start

actual_start states the actual time relative to the plan execution start when the action started

exec_time states the current time relative to the action execution start

duration represents the estimated duration for the action execution

progress indicates in the [0-1] range the current percentage of completion for the action execution

Usage
  • Encapsulated as a list of currently running actions in the executing property of a BDIPlanExecutionInfo message.

Event Listener Rule

Event Listener Rule
condition ConditionsDNF
reactive_rules ReactiveRule[]
Reactive Rule
set "belief" | "desire"
operation "ADD" | "DEL"
value Belief | Desire
Description Contains condition -> belief/desire updates to be made at run time when the condition is verified, enforcing belief revision or option generation function rules.
Parameters

condition Logical expression which needs to be satisfied when checked against the belief set of the agent in order to apply the reactive rules

reactive_rules List of updates to be performed in the form: target set ("belief" | "desire"), update ("ADD" | "DEL") and value (belief or desire item to be added or deleted). Value must be compliant to the target set, otherwise rule will not be considered, since it's bad formatted.

Usage
  • Encapsulated as a list, the agent's Event Listener node constantly checks them whenever a new Belief Set update notification arrives, enforcing any update rule if the respective condition is satisfied.