Skip to content

Commit

Permalink
Added Behaviour to interact with Pepper Robot
Browse files Browse the repository at this point in the history
  • Loading branch information
awaistahir29 committed Dec 17, 2022
1 parent 75c6a93 commit bca761f
Show file tree
Hide file tree
Showing 16 changed files with 1,300 additions and 0 deletions.
28 changes: 28 additions & 0 deletions FinalAssignment1.pml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<?xml version="1.0" encoding="UTF-8" ?>
<Package name="FinalAssignment1" format_version="4">
<Manifest src="manifest.xml" />
<BehaviorDescriptions>
<BehaviorDescription name="behavior" src="behavior_1" xar="behavior.xar" />
</BehaviorDescriptions>
<Dialogs>
<Dialog name="ExampleDialog" src="behavior_1/ExampleDialog/ExampleDialog.dlg" />
<Dialog name="Start" src="Start/Start.dlg" />
<Dialog name="move" src="move/move.dlg" />
<Dialog name="PoseAsking" src="PoseAsking/PoseAsking.dlg" />
<Dialog name="Startt" src="Startt/Startt.dlg" />
<Dialog name="Intro" src="Intro/Intro.dlg" />
</Dialogs>
<Resources />
<Topics>
<Topic name="ExampleDialog_enu" src="behavior_1/ExampleDialog/ExampleDialog_enu.top" topicName="ExampleDialog" language="en_US" />
<Topic name="Start_enu" src="Start/Start_enu.top" topicName="Start" language="en_US" />
<Topic name="move_enu" src="move/move_enu.top" topicName="move" language="en_US" />
<Topic name="PoseAsking_enu" src="PoseAsking/PoseAsking_enu.top" topicName="PoseAsking" language="en_US" />
<Topic name="Startt_enu" src="Startt/Startt_enu.top" topicName="Start" language="en_US" />
<Topic name="Intro_enu" src="Intro/Intro_enu.top" topicName="Intro" language="en_US" />
</Topics>
<IgnoredPaths />
<Translations auto-fill="en_US">
<Translation name="translation_en_US" src="translations/translation_en_US.ts" language="en_US" />
</Translations>
</Package>
2 changes: 2 additions & 0 deletions Intro/Intro.dlg
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
multilanguage:Intro
enu:Intro_enu.top
19 changes: 19 additions & 0 deletions Intro/Intro_enu.top
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
topic: ~Intro()
language: enu

# Defining extra concepts out of words or group of words
#concept:(hello) [hello hi hey "good morning" greetings]

# Catching inputs and triggering outputs
#u:(e:onStart) $onStopped=1

# Replying to speech
#u:(~hello) ~hello
u:([hello hi "hi Pepper" "Good Morning" "Morning"]) ["hello awais" "hi awais" hey "good morning awais"]

u:(["how are you" "Is everything okay"]) ["Great, thanks, good to see you" "Very good, thanks, good to see you" "all good, thanks, good to see you again"]

# Saying to Leave
u:(["I should leave" "I am tired" "I think I am tired and I should leave"]) ["Yes, It was a busy perhaps full of enjoyment day let me take you to the door" "Let me take you to the door"]

u:(["okay" ok fine "why not"])["But, before leeaving let me capture this moment with my high resolution camera"] $front=1
2 changes: 2 additions & 0 deletions PoseAsking/PoseAsking.dlg
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
multilanguage:PoseAsking
enu:PoseAsking_enu.top
15 changes: 15 additions & 0 deletions PoseAsking/PoseAsking_enu.top
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
topic: ~PoseAsking()
language: enu

# Defining extra concepts out of words or group of words
#concept:(hello) [hello hi hey "good morning" greetings]

# Catching inputs and triggering outputs
#u:(e:onStart) $onStopped=1

# Replying to speech
#u:(~hello) ~hello

u:([wait "pose"]) ["Awais, Which pose do you like?"]
u:([front]) ["Okay, let me take position"] $pose=1

2 changes: 2 additions & 0 deletions Start/Start.dlg
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
multilanguage:Start
enu:Start_enu.top
21 changes: 21 additions & 0 deletions Start/Start_enu.top
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
topic: ~Start()
language: enu

# Defining extra concepts out of words or group of words
#concept:(hello) [hello hi hey "good morning" greetings]

# Catching inputs and triggering outputs
#u:(e:onStart) $onStopped=1

# Replying to speech
#u:(~hello) ~hello

# Starting Conversation
u:([hello hi "hi Pepper" "Good Morning" "Morning"]) ["hello awais" "hi awais" hey "good morning awais"]

u:(["how are you" "Is everything okay"]) ["Great, thanks, good to see you" "Very good, thanks, good to see you" "all good, thanks, good to see you again"]

# Saying to Leave
u:(["I should leave" "I am tired" "I think I am tired and I should leave"]) ["Yes, It was a busy perhaps full of enjoyment day let me take you to the door" "Let me take you to the door"]

u:(["okay" ok fine "why not"])["But, before leeaving let me capture this moment with my high resolution camera"]
2 changes: 2 additions & 0 deletions Startt/Startt.dlg
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
multilanguage:Startt
enu:Startt_enu.top
21 changes: 21 additions & 0 deletions Startt/Startt_enu.top
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
topic: ~Start()
language: enu

# Defining extra concepts out of words or group of words
#concept:(hello) [hello hi hey "good morning" greetings]

# Catching inputs and triggering outputs
#u:(e:onStart) $onStopped=1

# Replying to speech
#u:(~hello) ~hello

# Starting Conversation
u:([hello hi "hi Pepper" "Good Morning" "Morning"]) ["hello awais" "hi awais" hey "good morning awais"]

u:(["how are you" "Is everything okay"]) ["Great, thanks, good to see you" "Very good, thanks, good to see you" "all good, thanks, good to see you again"]

# Saying to Leave
u:(["I should leave" "I am tired" "I think I am tired and I should leave"]) ["Yes, It was a busy perhaps full of enjoyment day let me take you to the door" "Let me take you to the door"]

u:(["okay" ok fine "why not"])["But, before leeaving let me capture this moment with my high resolution camera"]
2 changes: 2 additions & 0 deletions behavior_1/ExampleDialog/ExampleDialog.dlg
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
multilanguage:ExampleDialog
enu:ExampleDialog_enu.top
70 changes: 70 additions & 0 deletions behavior_1/ExampleDialog/ExampleDialog_enu.top
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
topic: ~ExampleDialog()
language: enu

# Defining needed concepts, keywords or sentences corresponding to a concept.
concept:(yes) [yes "all right" sure "why not" ok certainly "very well" yep yea definitely amen]
concept:(no) [no nope "don't want" "no way" never "not at all"]
concept:(how) ["how are you" howdy "what's up" "how do you feel"]
concept:(happy) [ok fine great happy blessed "all right" glad "not bad"]
concept:(sad) [sad miserable bad unhappy tired]
concept:(repeat) [repeat understand]
concept:(thx) ["thank you" thanks gracias "much obliged" merci]
concept:(hello) [hello hi hey "good morning" greetings]
concept:(bye) [bye goodbye "bye bye" "tata" "see you" adios cheerio "so long" farewell "have a nice day"]


# Start/Wait animation, Goto.
# If User expresses a word or a sentence found in the concept "hello",
# the robot starts Hey_1 animation, answers a random value defined in concept "hello"
# and waits for the end of the animation before going to the label how. Label is expressed this way: %howAreYou
u:(~hello) ^start(animations/Stand/Gestures/Hey_1) ~hello ^wait(animations/Stand/Gestures/Hey_1) ^gotoReactivate(howAreYou)


# Tag animation.
# If User asks how the robot feels, it starts a random animation being tagged "myself",
# answers and go to the label %howAreYou
u:(~how) ^startTag(myself) I'm fine, thank you. And you, ^gotoReactivate(howAreYou)


# %Label.
# The robot asks how the user feels. 3 kind of answers are expected
# Expressed by concept, user can be happy, sad or ask the robot to repeat the question.
proposal: %howAreYou ^startTag(show) how are you today?
u1:(~happy) I'm glad you are fine! ^gotoReactivate(favoriteColor)
u1:(~sad) Oh, I feel sorry for you. ^nextProposal
u1:(~repeat) I'll repeat for you. ^sameProposal

# Output slot stimulation.
# If User is sad (known from previous question), the robot proposes to play a game.
# If User accepts, it will stimulate the "playAGame" punctual diagram output.
proposal: If you feel like talking about it, don't hesitate. ^nextProposal
proposal: %playAGame Do you want to play a game?
u1:(~yes) Let's play $playAGame=1
u1:(~no) Ok, anytime.


# Variables.
# the robot asks User for his prefered color between blue and red.
# this illustrate variables stored in $1 using '_' character.
proposal: %favoriteColor And what is your favorite color between Blue and Red ?
u1:(violet) Violet is my prefered color too ! ^gotoReactivate(playAGame)
u1:(_[blue red]) $1 is a very nice color and my prefered is violet. ^gotoReactivate(playAGame)
u1:(_[green yellow pink orange purple white black]) $1 is a nice color. ^sameProposal


# On any proposal if user asks to repeat, say again the same proposal.
u:(~repeat) I'll repeat for you. ^sameProposal

# Being polite, the robot always answers accordingly to thankfull sentences.
u:(~thx) You're welcome


# Exiting.
# Answering to Goodbye and exiting the dialog box, stimulating the onStopped output slot.
u:(~bye) ~bye $onStopped=1


# Responding to events.
# Here, if the left foot bumper is pressed, the robot starts an animation,
# say a text and waits for the end of the animation.
u:(e:LeftBumperPressed) ^start(animations/Stand/Gestures/YouKnowWhat_1) My left foot bumped into something! ^wait(animations/Stand/Gestures/YouKnowWhat_1)
Loading

0 comments on commit bca761f

Please sign in to comment.