Beispiel #1
0
from robocup_knowledge import knowledge_loader
common = knowledge_loader.load_knowledge("common")

initial_pose = "initial_pose"
starting_pose = "gpsr_meeting_point"

cupboard = "cabinet"
cupboard_surface = "on_top_of"

table = "dinner_table"
table_surface = "on_top_of"

options = {
    "fries": {
        "food": "fries",
        "drink1": "coke",
        "drink2": "aquarius",
        "difficult1": "fork",
        "difficult2": "spoon",
        "difficult3": "plate"
    },
    "curry": {
        "food": "green_tea",
        "drink1": "cold_brew",
        "drink2": "green_tea",
        "difficult1": "chop_sticks",
        "difficult2": "spoon",
        "difficult3": "bowl"
    }
}
Beispiel #2
0
#!/usr/bin/python

# System
import random

# ROS
import rospy
import smach

# TU/e Robotics
from hmi import TimeoutException
from robocup_knowledge import knowledge_loader

# Knowledge
knowledge = knowledge_loader.load_knowledge("challenge_restaurant")


class TakeOrder(smach.State):
    """ Take an order """
    def __init__(self, robot, location, orders):
        """ Constructor

        :param robot: robot object
        :param location: string indicating the location
        :param orders: Python dict in which the orders will be stored
        :return:
        succeeded: understood correctly
        failed: didn't hear anything or exceeded maximum number of tries
        misunderstood: misunderstood, might try again
        """
        smach.State.__init__(self, outcomes=['succeeded', 'failed'])
Beispiel #3
0
from robocup_knowledge import knowledge_loader
common = knowledge_loader.load_knowledge("common")

not_understood_sentences = [
        "I'm so sorry! Can you please speak louder and slower? And wait for the ping!",
        "I am deeply sorry. Please try again, but wait for the ping!",
        "You and I have communication issues. Speak up!",
        "All this noise is messing with my audio. Try again"
    ]

initial_pose = "hero_home"

grammar_target = "T"

##############################################################################
#
# Actions
#
##############################################################################

grammar = """
T[A] -> C[A] | COURTESY C[A] | C[A] COURTESY | COURTESY C[A] COURTESY

COURTESY -> please | robot please | could you | would you | hero | hero please
C[{"actions": <A1>}] -> VP[A1]
C[{"actions": <A1, A2>}] -> VP[A1] and VP[A2]
C[{"actions": <A1, A2, A3>}] -> VP[A1] VP[A2] and VP[A3]
"""

##############################################################################
#
Beispiel #4
0
import smach
import rospy

# TU/e Robotics
import robot_smach_states as states
import robot_smach_states.util.designators as ds

from robot_skills.classification_result import ClassificationResult
from robocup_knowledge import knowledge_loader

# Challenge serving drinks
from .serve_one_drink import ServeOneDrink
from .sd_states import AskAvailability

# Knowledge
challenge_knowledge = knowledge_loader.load_knowledge("challenge_serving_drinks")
common_knowledge = knowledge_loader.load_knowledge("common")


class CheckInspect(smach.State):
    def __init__(self, designator, *resolve_types):
        super(CheckInspect, self).__init__(outcomes=["true", "false"])
        ds.check_type(designator, *resolve_types)
        self.designator = designator

    def execute(self, userdata=None):
        val = self.designator.resolve() if hasattr(self.designator, "resolve") else self.designator
        if val:
            return "true"
        else:
            return "false"
Beispiel #5
0
# RWC2015 
from robocup_knowledge import knowledge_loader
challenge_speech_recognition_data = knowledge_loader.load_knowledge("challenge_speech_recognition")

spec_questions = challenge_speech_recognition_data.spec 
choices_questions = challenge_speech_recognition_data.choices 

#locations: # TO BE DEFINED IN model.yaml!
starting_point = "initial_pose_door_A"
meeting_point = "gpsr_meeting_point"
gpsr_exit = "exit_door_B1"

# locations inside room used for finding object in room.
rooms_detailed = {  'kitchen':['kitchentable','kitchencounter', 'cupboard'], # fridge and trashbin are no manipulation locations
                    'livingroom':['bar','couchtable','dinnertable','sofa'], # dinnertable and sofa have both two spots
                    'bedroom':['left_bedside_table','right_bedside_table','desk','bed'],# bed has two spots
                    'hallway':['hallwaytable', 'bookcase/shelf1','bookcase/shelf2','bookcase/shelf3','bookcase/shelf4','bookcase/shelf5','bookcase/shelf6','bookcase/shelf7','bookcase/shelf8']} #,'bookcase']} # both locations have multiple spots.

objects_known_recognize = ['pure_milk', 'orange_juice', 'sponge', 'papaya_milk', 'apple', 'tomato_chips', 'lemon', 'toothpaste', 
                 'chocolates', 'bowl', 'beer', 'toilet_paper', 'soap', 'plate', 'pear', 'lotion', 'water', 'cloth', 
                 'green_tea', 'gram_soup', 'bubble_gum', 'bean_sauce', 'barbecue_chips', 'tray', 'coconut_cereals', 
                 'egg_stars', 'honey_chips', 'coco_balls', 'biscuits']

###############################################
#### GPSR KNOWLEDGE FOR ASKING FOR ACTION: ####
###############################################

#data for speech recognition

objects_known = ['pure milk', 'orange juice', 'sponge', 'papaya milk', 'apple', 'tomato chips', 'lemon', 'toothpaste', 
                 'chocolates', 'bowl', 'beer', 'toilet paper', 'soap', 'plate', 'pear', 'lotion', 'water', 'cloth', 
Beispiel #6
0
import robot_smach_states as states
import rospy
import smach
from challenge_storing_groceries.manipulate_machine import PlaceSingleItem
from robocup_knowledge import knowledge_loader
from robot_smach_states.util.designators.ed_designators import EdEntityDesignator

from pickup_item import PickupItem
from pointing_designator import PointingDesignator
from pointing_detector import PointingDetector

# Load the knowledge
knowledge = knowledge_loader.load_knowledge("challenge_final")


class ChallengeFinal(smach.StateMachine):
    """ State machine for the final challenge """

    def __init__(self, robot):
        """ Constructor
        :param robot: robot object
        """
        smach.StateMachine.__init__(self, outcomes=["Done", "Aborted"])

        # Designators
        furniture_move_designator = PointingDesignator(robot=robot)
        furniture_pick_designator = PointingDesignator(robot=robot)
        furniture_place_designator = PointingDesignator(robot=robot)

        with self:
            # Start challenge
#!/usr/bin/env python

# ROS
import rospy

# TU/e Robotics
from robocup_knowledge.knowledge_loader import load_knowledge

# Main function
if __name__ == "__main__":

    # Launch the ROS node
    rospy.init_node("load_object_types")

    # Load the knowledge
    knowledge = load_knowledge("common")

    # Get all objects from the knowledge
    objects = knowledge.get_objects()

    # Dump all objects on the parameter server
    rospy.set_param("/object_types", objects)
Beispiel #8
0
import robot_smach_states as states
import rospy
import smach
from challenge_storing_groceries.manipulate_machine import PlaceSingleItem
from robocup_knowledge import knowledge_loader
from robot_smach_states.util.designators.ed_designators import EdEntityDesignator

from pickup_item import PickupItem
from pointing_designator import PointingDesignator
from pointing_detector import PointingDetector

# Load the knowledge
knowledge = knowledge_loader.load_knowledge("challenge_final")


class ChallengeFinal(smach.StateMachine):
    """ State machine for the final challenge """
    def __init__(self, robot):
        """ Constructor
        :param robot: robot object
        """
        smach.StateMachine.__init__(self, outcomes=["Done", "Aborted"])

        # Designators
        furniture_move_designator = PointingDesignator(robot=robot)
        furniture_pick_designator = PointingDesignator(robot=robot)
        furniture_place_designator = PointingDesignator(robot=robot)

        with self:
            # Start challenge
            smach.StateMachine.add("START_CHALLENGE",
#!/usr/bin/python

# System
import random

# ROS
import rospy
import smach
# TU/e Robotics
from hmi import TimeoutException
from robocup_knowledge import knowledge_loader

# Knowledge
knowledge = knowledge_loader.load_knowledge("challenge_restaurant")


class TakeOrder(smach.State):
    """ Take an order """

    def __init__(self, robot, location, orders):
        """ Constructor

        :param robot: robot object
        :param location: string indicating the location
        :param orders: Python dict in which the orders will be stored
        :return:
        succeeded: understood correctly
        failed: didn't hear anything or exceeded maximum number of tries
        misunderstood: misunderstood, might try again
        """
        smach.State.__init__(self, outcomes=['succeeded', 'failed'])
Beispiel #10
0
from robocup_knowledge import knowledge_loader
common = knowledge_loader.load_knowledge("common")
spr = knowledge_loader.load_knowledge("challenge_spr")

not_understood_sentences = [
    "I'm so sorry! Can you please speak clearly and fluently? And wait for the ping!",
    "I am deeply sorry. Please try again, but wait for the ping!",
    "You and I have communication issues. Speak clearly!",
    "All this noise is messing with my audio. Try again."
]

initial_pose = "gpsr_meeting_point"
starting_pose = "gpsr_meeting_point"
exit_waypoint = "exit_1_rips"

grammar_target = "T"

##############################################################################
#
# Actions
#
##############################################################################

grammar = """
T[A] -> COURTESY_PREFIX C[A] | C[A]

C[{"actions": <A1>}] -> VP[A1]
C[{"actions": <A1, A2>}] -> VP[A1] and VPT[A2]
C[{"actions": <A1, A2, A3>}] -> VP[A1] VP[A2] and VPT[A3]

VPT -> VP | VPS