From f1a997ea86507247c1f83fd4d1ab281724c0fa32 Mon Sep 17 00:00:00 2001 From: Alex Mitrevski Date: Mon, 23 Mar 2020 06:35:26 +0100 Subject: [PATCH 1/8] [rosplan_interface/default_domain] Domain adaptations for issue #228 * Adapted the domain for the LAMA planner * Added some predicates and types from the ontology * Added two more pick and place versions and defined action contexts * Added a hand-over action --- .../config/default_domain.pddl | 224 ++++++++++++------ 1 file changed, 145 insertions(+), 79 deletions(-) diff --git a/mdr_planning/mdr_rosplan_interface/config/default_domain.pddl b/mdr_planning/mdr_rosplan_interface/config/default_domain.pddl index 5b5a3a549..029adad32 100644 --- a/mdr_planning/mdr_rosplan_interface/config/default_domain.pddl +++ b/mdr_planning/mdr_rosplan_interface/config/default_domain.pddl @@ -1,118 +1,184 @@ (define (domain default-domestic-domain) - (:requirements :strips :typing :fluents :disjunctive-preconditions :durative-actions) + (:requirements :strips :typing :equality) (:types - waypoint - object - category - robot - door - plane - person + Thing + Waypoint + Object - Thing + Furniture - Object + Category + Robot + Door + Plane + Person + NamedPose + GraspingStrategy + Context ) + (:constants pick_from_plane pick_from_container place_on_plane place_in_container - Context) + (:predicates - (robot_name ?bot - robot) - (object_category ?obj - object ?cat - category) - (robot_at ?bot - robot ?wp - waypoint) - (door_at ?door - door ?wp - waypoint) - (object_at ?obj - object ?wp - waypoint) - (plane_at ?plane - plane ?wp - waypoint) - (door_open ?door - door) - (belongs_to ?plane - plane ?obj - object) - (unexplored ?plane - plane) - (explored ?plane - plane) - (on ?obj - object ?plane - plane) - (in ?obj - object ?source - object) - (holding ?bot - robot ?obj - object) - (empty_gripper ?bot - robot) - (known ?person - person) - (unknown ?person - person) + (robotName ?Robot - Robot) + (objectCategory ?Object0 - Object ?Object1 - Object) + (robotAt ?Robot - Robot ?Waypoint - Waypoint) + (doorAt ?Door - Door ?Waypoint - Waypoint) + (objectAt ?Object - Object ?Waypoint - Waypoint) + (furnitureAt ?Furniture - Furniture ?Waypoint - Waypoint) + (planeAt ?Plane - Plane ?Waypoint - Waypoint) + (personAt ?Person - Person ?Waypoint - Waypoint) + (doorOpen ?Door - Door) + (belongsTo ?Plane - Plane ?Object - Object) + (unexplored ?Plane - Plane) + (explored ?Plane - Plane) + (on ?Object - Object ?Plane - Plane) + (in ?Object0 - Object ?Object1 - Object) + (in ?Object - Object ?Furniture - Furniture) + (holding ?Robot - Robot ?Object - Object) + (holding ?Person - Person ?Object - Object) + (emptyGripper ?Robot - Robot) + (known ?Person - Person) + (unknown ?Person - Person) + + (canPlaceOn ?Object - Object ?Plane - Plane) + (defaultStoringLocation ?Object - Object ?Furniture - Furniture) + (likelyLocation ?Object - Object ?Furniture - Furniture) + (locatedAt ?Object - Object ?Location - Location) + (hasDoor ?Furniture - Furniture) + (above ?Object0 - Object ?Object1 - Object) + (below ?Object0 - Object ?Object1 - Object) + (onTopOf ?Object0 - Object ?Object1 - Object) + (inside ?Object0 - Object ?Object1 - Object) + (toTheLeftOf ?Object0 - Object ?Object1 - Object) + (toTheRightOf ?Object0 - Object ?Object1 - Object) + (isAtNamedPose ?Thing - Thing ?NamedPose - NamedPose) + (isAtLocation ?NamedPose - NamedPose ?Location - Location) + (preferredGraspingStrategy ?Object - Object ?GraspingStrategy - GraspingStrategy) + ) + + (:action MoveBase + :parameters (?Robot - Robot ?Waypoint0 ?Waypoint1 - Waypoint) + :precondition (and + (robotAt ?Robot ?Waypoint0) + ) + :effect (and + (not (robotAt ?Robot ?Waypoint0)) + (robotAt ?Robot ?Waypoint1) + ) + ) + + (:action Open + :parameters (?Door - Door ?Robot - Robot ?Waypoint - Waypoint) + :precondition (and + (doorAt ?Door ?Waypoint) + (robotAt ?Robot ?Waypoint) + ) + :effect (and + (doorOpen ?Door) + ) + ) + + (:action PerceivePlane + :parameters (?Plane - Plane ?Robot - Robot ?Waypoint - Waypoint) + :precondition (and + (robotAt ?Robot ?Waypoint) + (planeAt ?Plane ?Waypoint) + (unexplored ?Plane) + ) + :effect (and + (not (unexplored ?Plane)) + (explored ?Plane) + ) ) - (:durative-action move_base - :parameters (?bot - robot ?from ?to - waypoint) - :duration ( = ?duration 10) - :condition (and - (at start (robot_at ?bot ?from)) + (:action Pick + :parameters (?Object - Object ?Plane - Plane ?Robot - Robot ?Waypoint - Waypoint ?Context - Context) + :precondition (and + (= ?Context pick_from_plane) + (robotAt ?Robot ?Waypoint) + (planeAt ?Plane ?Waypoint) + (explored ?Plane) + (on ?Object ?Plane) + (emptyGripper ?Robot) ) :effect (and - (at start (not (robot_at ?bot ?from))) - (at end (robot_at ?bot ?to)) + (not (on ?Object ?Plane)) + (not (emptyGripper ?Robot)) + (holding ?Robot ?Object) ) ) - (:durative-action open_cupboard - :parameters (?cupboard - door ?bot - robot ?c - waypoint) - :duration ( = ?duration 10) - :condition (and - (at start (door_at ?cupboard ?c)) - (at start (robot_at ?bot ?c)) + (:action Pick + :parameters (?Object - Object ?Furniture - Furniture ?Robot - Robot ?Waypoint - Waypoint ?Context - Context) + :precondition (and + (= ?Context pick_from_container) + (robotAt ?Robot ?Waypoint) + (furnitureAt ?Furniture ?Waypoint) + (in ?Object ?Furniture) + (emptyGripper ?Robot) ) :effect (and - (at end (door_open ?cupboard)) + (not (in ?Object ?Furniture)) + (not (emptyGripper ?Robot)) + (holding ?Robot ?Object) ) ) - (:durative-action perceive_plane - :parameters (?plane - plane ?bot - robot ?wp - waypoint) - :duration ( = ?duration 10) - :condition (and - (at start (robot_at ?bot ?wp)) - (at start (plane_at ?plane ?wp)) - (at start (unexplored ?plane)) + (:action Place + :parameters (?Object - Object ?Plane - Plane ?Robot - Robot ?Waypoint - Waypoint ?Context - Context) + :precondition (and + (= ?Context place_on_plane) + (robotAt ?Robot ?Waypoint) + (planeAt ?Plane ?Waypoint) + (holding ?Robot ?Object) ) :effect (and - (at start (not (unexplored ?plane))) - (at end (explored ?plane)) + (not (holding ?Robot ?Object)) + (emptyGripper ?Robot) + (on ?Object ?Plane) ) ) - (:durative-action pickup - :parameters (?obj - object ?plane - plane ?bot - robot ?wp - waypoint) - :duration ( = ?duration 10) - :condition (and - (at start (robot_at ?bot ?wp)) - (at start (plane_at ?plane ?wp)) - (at start (explored ?plane)) - (at start (on ?obj ?plane)) - (at start (empty_gripper ?bot)) + (:action Place + :parameters (?Object - Object ?Furniture - Furniture ?Robot - Robot ?Waypoint - Waypoint ?Context - Context) + :precondition (and + (= ?Context place_in_container) + (robotAt ?Robot ?Waypoint) + (furnitureAt ?Furniture ?Waypoint) + (holding ?Robot ?Object) ) :effect (and - (at start (not (on ?obj ?plane))) - (at start (not (empty_gripper ?bot))) - (at end (holding ?bot ?obj)) + (not (holding ?Robot ?Object)) + (emptyGripper ?Robot) + (in ?Object ?Furniture) ) ) - (:durative-action place - :parameters (?obj - object ?plane - plane ?bot - robot ?wp - waypoint) - :duration ( = ?duration 10) - :condition (and - (at start (robot_at ?bot ?wp)) - (at start (plane_at ?plane ?wp)) - (at start (holding ?bot ?obj)) + (:action Throw + :parameters (?Object0 ?Object1 - Object ?Robot - Robot ?Waypoint - Waypoint) + :precondition (and + (robotAt ?Robot ?Waypoint) + (objectAt ?Object1 ?Waypoint) + (holding ?Robot ?Object0) ) :effect (and - (at start (not (holding ?bot ?obj))) - (at start (empty_gripper ?bot)) - (at end (on ?obj ?plane)) + (not (holding ?Robot ?Object0)) + (emptyGripper ?Robot) + (in ?Object0 ?Object1) ) ) - (:durative-action throw - :parameters (?obj - object ?dest_obj - object ?bot - robot ?wp - waypoint) - :duration ( = ?duration 10) - :condition (and - (at start (robot_at ?bot ?wp)) - (at start (object_at ?dest_obj ?wp)) - (at start (holding ?bot ?obj)) + (:action HandOver + :parameters (?Object - Object ?Robot - Robot ?Person - Person ?Waypoint - Waypoint) + :precondition (and + (robotAt ?Robot ?Waypoint) + (personAt ?Person ?Waypoint) + (holding ?Robot ?Object) ) :effect (and - (at start (not (holding ?bot ?obj))) - (at start (empty_gripper ?bot)) - (at end (in ?obj ?dest_obj)) + (not (holding ?Robot ?Object)) + (holding ?Person ?Object) ) ) ) From 7e83582d35ad2e5d7923997b0265010da11055cd Mon Sep 17 00:00:00 2001 From: Alex Mitrevski Date: Sat, 4 Jul 2020 11:09:41 +0200 Subject: [PATCH 2/8] [rosplan_interface/default_domain.pddl] Added a Location class --- .../mdr_rosplan_interface/config/default_domain.pddl | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/mdr_planning/mdr_rosplan_interface/config/default_domain.pddl b/mdr_planning/mdr_rosplan_interface/config/default_domain.pddl index 029adad32..41a07ffc8 100644 --- a/mdr_planning/mdr_rosplan_interface/config/default_domain.pddl +++ b/mdr_planning/mdr_rosplan_interface/config/default_domain.pddl @@ -4,8 +4,9 @@ (:types Thing - Waypoint Object - Thing + Location - Thing + Waypoint - Location Furniture - Object Category Robot @@ -58,13 +59,13 @@ ) (:action MoveBase - :parameters (?Robot - Robot ?Waypoint0 ?Waypoint1 - Waypoint) + :parameters (?Robot - Robot ?Location0 ?Location1 - Location) :precondition (and - (robotAt ?Robot ?Waypoint0) + (robotAt ?Robot ?Location0) ) :effect (and - (not (robotAt ?Robot ?Waypoint0)) - (robotAt ?Robot ?Waypoint1) + (not (robotAt ?Robot ?Location0)) + (robotAt ?Robot ?Location1) ) ) From dc5775c0751717251c3560e13d41e16e0d8cd083 Mon Sep 17 00:00:00 2001 From: Alex Mitrevski Date: Mon, 10 Jan 2022 18:07:39 +0100 Subject: [PATCH 3/8] [rosplan_interface/rosplan.launch] Updated args for launching LAMA correctly --- .../mdr_rosplan_interface/ros/launch/rosplan.launch | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/mdr_planning/mdr_rosplan_interface/ros/launch/rosplan.launch b/mdr_planning/mdr_rosplan_interface/ros/launch/rosplan.launch index ce1d5c695..a7ca96a3a 100644 --- a/mdr_planning/mdr_rosplan_interface/ros/launch/rosplan.launch +++ b/mdr_planning/mdr_rosplan_interface/ros/launch/rosplan.launch @@ -2,11 +2,11 @@ - + - - + + From 93f22780954867bf27c4375362a4a52d9d526618 Mon Sep 17 00:00:00 2001 From: Alex Mitrevski Date: Mon, 10 Jan 2022 20:09:43 +0100 Subject: [PATCH 4/8] [rosplan_interface/rosplan.launch] Added additional params for instantiating an ontology interface This is in accordance with https://github.com/b-it-bots/mas_knowledge_base/pull/42 --- mdr_planning/mdr_rosplan_interface/ros/launch/rosplan.launch | 2 ++ 1 file changed, 2 insertions(+) diff --git a/mdr_planning/mdr_rosplan_interface/ros/launch/rosplan.launch b/mdr_planning/mdr_rosplan_interface/ros/launch/rosplan.launch index a7ca96a3a..b7e984653 100644 --- a/mdr_planning/mdr_rosplan_interface/ros/launch/rosplan.launch +++ b/mdr_planning/mdr_rosplan_interface/ros/launch/rosplan.launch @@ -11,6 +11,8 @@ + + From 562cc3e274bc8b4bd88b403a8a20355cefa1c15e Mon Sep 17 00:00:00 2001 From: Alex Mitrevski Date: Fri, 29 Apr 2022 16:13:56 +0200 Subject: [PATCH 5/8] [mdr_rosplan_interface/action_client_base] Updated feedback msg The type of the status field has changed in the upstream ROSPlan (instead of a string, it's now a status integer field as defined in the message) --- .../ros/src/mdr_rosplan_interface/action_client_base.py | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/mdr_planning/mdr_rosplan_interface/ros/src/mdr_rosplan_interface/action_client_base.py b/mdr_planning/mdr_rosplan_interface/ros/src/mdr_rosplan_interface/action_client_base.py index 4f49656a4..9222aced5 100644 --- a/mdr_planning/mdr_rosplan_interface/ros/src/mdr_rosplan_interface/action_client_base.py +++ b/mdr_planning/mdr_rosplan_interface/ros/src/mdr_rosplan_interface/action_client_base.py @@ -15,9 +15,6 @@ class ActionClientBase(object): ''' def __init__(self): - self.action_success_msg = 'action achieved' - self.action_failure_msg = 'action failed' - # unique action ID self.action_id = -1 @@ -87,9 +84,9 @@ def send_action_feedback(self, success): msg = plan_dispatch_msgs.ActionFeedback() msg.action_id = self.action_id if success: - msg.status = self.action_success_msg + msg.status = plan_dispatch_msgs.ActionFeedback.ACTION_SUCCEEDED_TO_GOAL_STATE else: - msg.status = self.action_failure_msg + msg.status = plan_dispatch_msgs.ActionFeedback.ACTION_FAILED action_name_kvp = diag_msgs.KeyValue() action_name_kvp.key = 'action_name' From 2c0eba0089c6599217b1e6f862695061384ccb7f Mon Sep 17 00:00:00 2001 From: Alex Mitrevski Date: Fri, 29 Apr 2022 16:16:36 +0200 Subject: [PATCH 6/8] [find_object_action] Updated ontology initialisation The initialisation has been updated according to the changes in the ontology interface (introduced with commit 9889e057c03b1c159e9ce12967f69e0da2388f0d in https://github.com/b-it-bots/mas_knowledge_base/tree/devel) --- .../ros/scripts/find_object_action | 4 ++++ .../ros/src/mdr_find_object_action/action_states.py | 10 ++++++++-- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/mdr_planning/mdr_actions/mdr_perception_actions/mdr_find_object_action/ros/scripts/find_object_action b/mdr_planning/mdr_actions/mdr_perception_actions/mdr_find_object_action/ros/scripts/find_object_action index 048aa6ad1..b3880e13c 100755 --- a/mdr_planning/mdr_actions/mdr_perception_actions/mdr_find_object_action/ros/scripts/find_object_action +++ b/mdr_planning/mdr_actions/mdr_perception_actions/mdr_find_object_action/ros/scripts/find_object_action @@ -21,6 +21,8 @@ class FindObjectServer(object): ''' def __init__(self): ontology_url = rospy.get_param('~ontology_url', '') + ontology_base_url = rospy.get_param('~ontology_base_url', '') + ontology_entity_delimiter = rospy.get_param('~ontology_entity_delimiter', '') ontology_class_prefix = rospy.get_param('~ontology_class_prefix', '') retry_count_on_failure = int(rospy.get_param('~retry_count_on_failure', 0)) timeout_s = float(rospy.get_param('~timeout_s', 120.)) @@ -32,6 +34,8 @@ class FindObjectServer(object): rospy.loginfo('[find_object] Initialising state machine') self.action_sm = FindObjectSM(ontology_url=ontology_url, + ontology_base_url=ontology_base_url, + ontology_entity_delimiter=ontology_entity_delimiter, ontology_class_prefix=ontology_class_prefix, number_of_retries=retry_count_on_failure, timeout=timeout_s) diff --git a/mdr_planning/mdr_actions/mdr_perception_actions/mdr_find_object_action/ros/src/mdr_find_object_action/action_states.py b/mdr_planning/mdr_actions/mdr_perception_actions/mdr_find_object_action/ros/src/mdr_find_object_action/action_states.py index d4a67adbb..cc170c9bf 100644 --- a/mdr_planning/mdr_actions/mdr_perception_actions/mdr_find_object_action/ros/src/mdr_find_object_action/action_states.py +++ b/mdr_planning/mdr_actions/mdr_perception_actions/mdr_find_object_action/ros/src/mdr_find_object_action/action_states.py @@ -8,12 +8,16 @@ class FindObjectSM(ActionSMBase): def __init__(self, ontology_url, + ontology_base_url, + ontology_entity_delimiter, ontology_class_prefix, number_of_retries=0, timeout=120., max_recovery_attempts=1): super(FindObjectSM, self).__init__('FindObject', [], max_recovery_attempts) self.ontology_url = ontology_url + self.ontology_base_url = ontology_base_url + self.ontology_entity_delimiter = ontology_entity_delimiter self.ontology_class_prefix = ontology_class_prefix self.number_of_retries = number_of_retries self.timeout = timeout @@ -23,8 +27,10 @@ def __init__(self, ontology_url, def init(self): try: rospy.loginfo('[find_object] Creating an interface client for ontology %s', self.ontology_url) - self.ontology_interface = DomesticOntologyInterface(self.ontology_url, - self.ontology_class_prefix) + self.ontology_interface = DomesticOntologyInterface(ontology_file=self.ontology_url, + base_url=self.ontology_base_url, + entity_delimiter=self.ontology_entity_delimiter, + class_prefix=self.ontology_class_prefix) except Exception as exc: rospy.logerr('[find_object] Could not create an ontology interface client: %s', exc) From c5a7eba930b5248406555e1cc76577d559e26742 Mon Sep 17 00:00:00 2001 From: Alex Mitrevski Date: Fri, 29 Apr 2022 16:27:40 +0200 Subject: [PATCH 7/8] [find_object/launch] Use GO2019 ontology by default This is currently the only ontology we have with some assertions, so it's best for running tests --- .../mdr_find_object_action/ros/launch/find_object.launch | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/mdr_planning/mdr_actions/mdr_perception_actions/mdr_find_object_action/ros/launch/find_object.launch b/mdr_planning/mdr_actions/mdr_perception_actions/mdr_find_object_action/ros/launch/find_object.launch index fd8ed0c7e..2de5b9a36 100644 --- a/mdr_planning/mdr_actions/mdr_perception_actions/mdr_find_object_action/ros/launch/find_object.launch +++ b/mdr_planning/mdr_actions/mdr_perception_actions/mdr_find_object_action/ros/launch/find_object.launch @@ -1,7 +1,9 @@ - + + + From cc77a3a4f542721733334cd21a8871f7a3eb204b Mon Sep 17 00:00:00 2001 From: Alex Mitrevski Date: Mon, 2 May 2022 17:10:38 +0200 Subject: [PATCH 8/8] [.github/CODEOWNERS] rm Patrick and pullpanda; add Minh --- .github/CODEOWNERS | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index f6cd137f8..11aeb5e64 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -1,7 +1,4 @@ # Default owners for everything in the repo. # Unless a later match takes precedence, they will be requested for review # when someone opens a pull request. -* @argenos @alex-mitrevski @PatrickNa @b-it-bots/pullpanda-junior @b-it-bots/pullpanda-senior - -mdr_perception @minhnh -mdr_navigation @argenos +* @argenos @alex-mitrevski @minhnh