├── app ├── .gitignore ├── src │ ├── main │ │ ├── res │ │ │ ├── raw │ │ │ │ ├── dance.pmt │ │ │ │ ├── dog_sound.ogg │ │ │ │ ├── greetings_dynamic.top │ │ │ │ ├── variable.top │ │ │ │ ├── elephant_sound.ogg │ │ │ │ ├── greetings.top │ │ │ │ ├── mimic_animal.top │ │ │ │ ├── execute.top │ │ │ │ ├── common.top │ │ │ │ ├── move_tutorials.top │ │ │ │ ├── talk_tutorials.top │ │ │ │ └── smart_tutorials.top │ │ │ ├── drawable │ │ │ │ ├── sbr_logo.png │ │ │ │ ├── empty_divider_big.xml │ │ │ │ ├── empty_divider_tutorials.xml │ │ │ │ ├── basic_level_shape.xml │ │ │ │ ├── advanced_level_shape.xml │ │ │ │ ├── button_shape_pressed.xml │ │ │ │ ├── button_shape_selected.xml │ │ │ │ ├── switch_level_shape.xml │ │ │ │ ├── button_shape_disabled.xml │ │ │ │ ├── button_shape_unselected.xml │ │ │ │ ├── navigation_background_selector.xml │ │ │ │ ├── ic_add.xml │ │ │ │ ├── ic_baseline_arrow_back.xml │ │ │ │ ├── ic_check.xml │ │ │ │ ├── ic_baseline_close.xml │ │ │ │ ├── ic_delete.xml │ │ │ │ ├── category_selector.xml │ │ │ │ ├── button_background_selector.xml │ │ │ │ ├── ic_move.xml │ │ │ │ ├── ic_talk.xml │ │ │ │ ├── ic_icons_cute_anon_unknown.xml │ │ │ │ ├── ic_icons_cute_anon_neutral.xml │ │ │ │ ├── ic_icons_cute_anon_smile.xml │ │ │ │ ├── ic_icons_cute_anon_sad.xml │ │ │ │ ├── ic_img_icon_pepper.xml │ │ │ │ ├── ic_icons_cute_anon_joyful.xml │ │ │ │ ├── ic_icons_cute_anon_anger.xml │ │ │ │ └── ic_img_icon_humanmen.xml │ │ │ ├── font │ │ │ │ ├── open_sans_bold.ttf │ │ │ │ ├── open_sans_semibold.ttf │ │ │ │ └── open_sans_light_italic.ttf │ │ │ ├── mipmap-hdpi │ │ │ │ └── ic_app_icon.png │ │ │ ├── mipmap-mdpi │ │ │ │ └── ic_app_icon.png │ │ │ ├── mipmap-xhdpi │ │ │ │ └── ic_app_icon.png │ │ │ ├── mipmap-xxhdpi │ │ │ │ └── ic_app_icon.png │ │ │ ├── mipmap-xxxhdpi │ │ │ │ └── ic_app_icon.png │ │ │ ├── values │ │ │ │ ├── plurals.xml │ │ │ │ ├── attrs_bilateral_switch.xml │ │ │ │ ├── dimens.xml │ │ │ │ ├── colors.xml │ │ │ │ ├── styles.xml │ │ │ │ └── strings.xml │ │ │ ├── color │ │ │ │ ├── navigation_tint_selector.xml │ │ │ │ └── button_text_color_selector.xml │ │ │ ├── values-w820dp │ │ │ │ └── dimens.xml │ │ │ └── layout │ │ │ │ ├── layout_error_log_view.xml │ │ │ │ ├── layout_info_log_view.xml │ │ │ │ ├── conversation_layout.xml │ │ │ │ ├── greeting_layout.xml │ │ │ │ ├── layout_human_input_view.xml │ │ │ │ ├── layout_robot_output_view.xml │ │ │ │ ├── activity_splash_screen.xml │ │ │ │ ├── activity_detect_humans_with_localization_tutorial.xml │ │ │ │ ├── activity_look_at_tutorial.xml │ │ │ │ ├── tutorial_layout.xml │ │ │ │ ├── activity_autonomous_abilities_tutorial.xml │ │ │ │ ├── activity_enforce_tablet_reachability_tutorial.xml │ │ │ │ ├── activity_emotion_tutorial.xml │ │ │ │ ├── human_info_layout.xml │ │ │ │ ├── activity_people_characteristics_tutorial.xml │ │ │ │ ├── activity_take_picture_tutorial.xml │ │ │ │ ├── activity_follow_human_tutorial.xml │ │ │ │ ├── activity_chat_locale_tutorial.xml │ │ │ │ ├── activity_exploration_map_representation_tutorial.xml │ │ │ │ ├── activity_categories.xml │ │ │ │ ├── activity_dynamic_concepts_tutorial.xml │ │ │ │ ├── bilateral_switch.xml │ │ │ │ ├── activity_go_to_world_tutorial.xml │ │ │ │ ├── tutorial_toolbar.xml │ │ │ │ └── activity_qi_chat_variables_tutorial.xml │ │ ├── ic_app_icon-web.png │ │ ├── assets │ │ │ ├── hello-ja.top │ │ │ ├── hello-en.top │ │ │ └── robot │ │ │ │ └── robotsdk.xml │ │ ├── java │ │ │ └── com │ │ │ │ └── softbankrobotics │ │ │ │ └── qisdktutorials │ │ │ │ ├── ui │ │ │ │ ├── conversation │ │ │ │ │ ├── ConversationItem.kt │ │ │ │ │ ├── ConversationItemType.kt │ │ │ │ │ ├── ConversationViewHolder.kt │ │ │ │ │ ├── ConversationView.kt │ │ │ │ │ ├── ConversationBinder.kt │ │ │ │ │ └── ConversationAdapter.kt │ │ │ │ ├── bilateralswitch │ │ │ │ │ ├── OnCheckedChangeListener.java │ │ │ │ │ └── RoundedLayout.kt │ │ │ │ ├── tutorials │ │ │ │ │ ├── perceptions │ │ │ │ │ │ ├── emotiondetection │ │ │ │ │ │ │ ├── BasicEmotion.kt │ │ │ │ │ │ │ ├── OnBasicEmotionChangedListener.kt │ │ │ │ │ │ │ └── EmotionTutorialActivity.kt │ │ │ │ │ │ ├── humanawareness │ │ │ │ │ │ │ ├── HumanInfoAdapter.kt │ │ │ │ │ │ │ ├── HumanInfo.kt │ │ │ │ │ │ │ └── HumanInfoViewHolder.kt │ │ │ │ │ │ └── touch │ │ │ │ │ │ │ └── TouchTutorialActivity.kt │ │ │ │ │ ├── conversation │ │ │ │ │ │ ├── dynamicconcepts │ │ │ │ │ │ │ ├── OnGreetingRemovedListener.kt │ │ │ │ │ │ │ ├── GreetingViewHolder.kt │ │ │ │ │ │ │ └── GreetingAdapter.kt │ │ │ │ │ │ ├── qichatbot │ │ │ │ │ │ │ └── QiChatbotTutorialActivity.kt │ │ │ │ │ │ ├── listen │ │ │ │ │ │ │ └── ListenTutorialActivity.kt │ │ │ │ │ │ └── qichatvariables │ │ │ │ │ │ │ └── QiChatVariablesTutorialActivity.kt │ │ │ │ │ ├── gettingstarted │ │ │ │ │ │ └── HelloHumanTutorialActivity.kt │ │ │ │ │ ├── TutorialActivity.kt │ │ │ │ │ └── motion │ │ │ │ │ │ ├── trajectory │ │ │ │ │ │ └── TrajectoryTutorialActivity.kt │ │ │ │ │ │ ├── gotoframe │ │ │ │ │ │ └── GoToTutorialActivity.kt │ │ │ │ │ │ ├── animate │ │ │ │ │ │ └── AnimateTutorialActivity.kt │ │ │ │ │ │ └── animationlabels │ │ │ │ │ │ └── AnimationLabelActivity.kt │ │ │ │ ├── categories │ │ │ │ │ ├── OnTutorialClickedListener.kt │ │ │ │ │ ├── CategoriesContract.kt │ │ │ │ │ ├── TutorialViewHolder.kt │ │ │ │ │ ├── CategoriesPresenter.kt │ │ │ │ │ └── TutorialAdapter.kt │ │ │ │ ├── splashscreen │ │ │ │ │ └── SplashScreenActivity.kt │ │ │ │ └── tutorialtoolbar │ │ │ │ │ └── TutorialToolbar.kt │ │ │ │ ├── model │ │ │ │ └── data │ │ │ │ │ ├── TutorialLevel.kt │ │ │ │ │ ├── TutorialCategory.kt │ │ │ │ │ ├── Tutorial.kt │ │ │ │ │ └── TutorialId.kt │ │ │ │ └── utils │ │ │ │ ├── Constants.kt │ │ │ │ └── KeyboardUtils.kt │ │ └── AndroidManifest.xml │ ├── test │ │ └── java │ │ │ └── com │ │ │ └── softbankrobotics │ │ │ └── qisdktutorials │ │ │ └── ExampleUnitTest.java │ └── androidTest │ │ └── java │ │ └── com │ │ └── softbankrobotics │ │ └── qisdktutorials │ │ └── ExampleInstrumentedTest.java ├── proguard-rules.pro └── build.gradle ├── settings.gradle ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── README.md ├── gradle.properties ├── COPYING.txt ├── LICENSE.txt ├── gradlew.bat └── .gitignore /app/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /settings.gradle: -------------------------------------------------------------------------------- 1 | include ':app' 2 | -------------------------------------------------------------------------------- /app/src/main/res/raw/dance.pmt: -------------------------------------------------------------------------------- 1 | [["Composed", ["Holonomic", ["Line", [1.000000000, 0.000000000]], 0, 2.82]],1] -------------------------------------------------------------------------------- /app/src/main/ic_app_icon-web.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldebaran/qisdk-tutorials/HEAD/app/src/main/ic_app_icon-web.png -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldebaran/qisdk-tutorials/HEAD/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /app/src/main/assets/hello-ja.top: -------------------------------------------------------------------------------- 1 | topic: ~hello() 2 | 3 | proposal: %start 会話を始めるためには、スタート、と言ってください! 4 | 5 | u:(こんにちは) こんにちは 6 | -------------------------------------------------------------------------------- /app/src/main/res/raw/dog_sound.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldebaran/qisdk-tutorials/HEAD/app/src/main/res/raw/dog_sound.ogg -------------------------------------------------------------------------------- /app/src/main/res/raw/greetings_dynamic.top: -------------------------------------------------------------------------------- 1 | topic: ~greetings_dynamic() 2 | 3 | dynamic: greetings 4 | 5 | u:(~greetings) ~greetings -------------------------------------------------------------------------------- /app/src/main/assets/hello-en.top: -------------------------------------------------------------------------------- 1 | topic: ~hello() 2 | 3 | proposal: %start Say hello to start the discussion. 4 | 5 | u:(hello) hello 6 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/sbr_logo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldebaran/qisdk-tutorials/HEAD/app/src/main/res/drawable/sbr_logo.png -------------------------------------------------------------------------------- /app/src/main/res/raw/variable.top: -------------------------------------------------------------------------------- 1 | topic: ~variable() 2 | 3 | proposal: %read ^first["My robot is $var" "There is no value, type one"] 4 | -------------------------------------------------------------------------------- /app/src/main/res/font/open_sans_bold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldebaran/qisdk-tutorials/HEAD/app/src/main/res/font/open_sans_bold.ttf -------------------------------------------------------------------------------- /app/src/main/res/raw/elephant_sound.ogg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldebaran/qisdk-tutorials/HEAD/app/src/main/res/raw/elephant_sound.ogg -------------------------------------------------------------------------------- /app/src/main/res/raw/greetings.top: -------------------------------------------------------------------------------- 1 | topic: ~greetings() 2 | 3 | concept:(hello) [hello hi hey "good morning"] 4 | 5 | u:(~hello) ~hello 6 | -------------------------------------------------------------------------------- /app/src/main/assets/robot/robotsdk.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /app/src/main/res/font/open_sans_semibold.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldebaran/qisdk-tutorials/HEAD/app/src/main/res/font/open_sans_semibold.ttf -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/ic_app_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldebaran/qisdk-tutorials/HEAD/app/src/main/res/mipmap-hdpi/ic_app_icon.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-mdpi/ic_app_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldebaran/qisdk-tutorials/HEAD/app/src/main/res/mipmap-mdpi/ic_app_icon.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/ic_app_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldebaran/qisdk-tutorials/HEAD/app/src/main/res/mipmap-xhdpi/ic_app_icon.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/ic_app_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldebaran/qisdk-tutorials/HEAD/app/src/main/res/mipmap-xxhdpi/ic_app_icon.png -------------------------------------------------------------------------------- /app/src/main/res/font/open_sans_light_italic.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldebaran/qisdk-tutorials/HEAD/app/src/main/res/font/open_sans_light_italic.ttf -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxxhdpi/ic_app_icon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/aldebaran/qisdk-tutorials/HEAD/app/src/main/res/mipmap-xxxhdpi/ic_app_icon.png -------------------------------------------------------------------------------- /app/src/main/res/drawable/empty_divider_big.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/empty_divider_tutorials.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | -------------------------------------------------------------------------------- /app/src/main/res/raw/mimic_animal.top: -------------------------------------------------------------------------------- 1 | topic: ~mimic_animal() 2 | 3 | proposal: %mimic_proposal Say dog or elephant 4 | u1: (dog) OK, I've reached the dog bookmark %dog_mimic 5 | u1: (elephant) OK, I've reached the elephant bookmark %elephant_mimic 6 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/basic_level_shape.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/advanced_level_shape.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/button_shape_pressed.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/button_shape_selected.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Wed Oct 03 15:37:34 CEST 2018 2 | distributionBase=GRADLE_USER_HOME 3 | distributionPath=wrapper/dists 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | distributionUrl=https\://services.gradle.org/distributions/gradle-6.1.1-all.zip 7 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/switch_level_shape.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 6 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/button_shape_disabled.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /app/src/main/res/values/plurals.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | Age: %1$d year 6 | Age: %1$d years 7 | 8 | -------------------------------------------------------------------------------- /app/src/main/res/values/attrs_bilateral_switch.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | -------------------------------------------------------------------------------- /app/src/main/res/color/navigation_tint_selector.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | 8 | -------------------------------------------------------------------------------- /app/src/main/java/com/softbankrobotics/qisdktutorials/ui/conversation/ConversationItem.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2018 Softbank Robotics Europe 3 | * See COPYING for the license 4 | */ 5 | 6 | package com.softbankrobotics.qisdktutorials.ui.conversation 7 | 8 | internal class ConversationItem(val text: String, val type: ConversationItemType) 9 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/button_shape_unselected.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/navigation_background_selector.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | 8 | -------------------------------------------------------------------------------- /app/src/main/res/raw/execute.top: -------------------------------------------------------------------------------- 1 | topic: ~execute() 2 | # Defining extra concepts out of words or group of words 3 | concept:(execute) [execute executor] 4 | 5 | # Replying to speech 6 | proposal: %execute_proposal I can launch actions during a topic. Say 'execute' or 'executor' to test it. 7 | u:(~execute) I've reached the execute ^execute(myExecutor) and now I continue. -------------------------------------------------------------------------------- /app/src/main/res/raw/common.top: -------------------------------------------------------------------------------- 1 | topic: ~common() 2 | 3 | concept:(talk) ["let's talk"] 4 | concept:(move) ["let's move"] 5 | concept:(smart) ["{let's} be smart"] 6 | 7 | concept:(basic) [basic] 8 | concept:(advanced) [advanced] 9 | 10 | u:(~talk) OK %talk 11 | u:(~move) OK %move 12 | u:(~smart) OK %smart 13 | u:(~basic) OK %basic 14 | u:(~advanced) OK %advanced 15 | -------------------------------------------------------------------------------- /app/src/main/java/com/softbankrobotics/qisdktutorials/model/data/TutorialLevel.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2018 Softbank Robotics Europe 3 | * See COPYING for the license 4 | */ 5 | 6 | package com.softbankrobotics.qisdktutorials.model.data 7 | 8 | /** 9 | * Represents a tutorial level. 10 | */ 11 | enum class TutorialLevel { 12 | BASIC, 13 | ADVANCED 14 | } 15 | -------------------------------------------------------------------------------- /app/src/main/java/com/softbankrobotics/qisdktutorials/ui/bilateralswitch/OnCheckedChangeListener.java: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2018 Softbank Robotics Europe 3 | * See COPYING for the license 4 | */ 5 | 6 | package com.softbankrobotics.qisdktutorials.ui.bilateralswitch; 7 | 8 | 9 | public interface OnCheckedChangeListener { 10 | void onCheckedChanged(boolean isChecked); 11 | } 12 | -------------------------------------------------------------------------------- /app/src/main/java/com/softbankrobotics/qisdktutorials/model/data/TutorialCategory.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2018 Softbank Robotics Europe 3 | * See COPYING for the license 4 | */ 5 | 6 | package com.softbankrobotics.qisdktutorials.model.data 7 | 8 | /** 9 | * Represents a tutorial category. 10 | */ 11 | enum class TutorialCategory { 12 | TALK, 13 | MOVE, 14 | SMART 15 | } 16 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_add.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/values-w820dp/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 64dp 6 | 7 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_baseline_arrow_back.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_check.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_baseline_close.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_delete.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | 10 | -------------------------------------------------------------------------------- /app/src/main/java/com/softbankrobotics/qisdktutorials/ui/conversation/ConversationItemType.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2018 Softbank Robotics Europe 3 | * See COPYING for the license 4 | */ 5 | 6 | package com.softbankrobotics.qisdktutorials.ui.conversation 7 | 8 | /** 9 | * Represent a conversation item type. 10 | */ 11 | enum class ConversationItemType { 12 | INFO_LOG, 13 | ERROR_LOG, 14 | ROBOT_OUTPUT, 15 | HUMAN_INPUT 16 | } 17 | -------------------------------------------------------------------------------- /app/src/main/res/layout/layout_error_log_view.xml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /app/src/main/res/layout/layout_info_log_view.xml: -------------------------------------------------------------------------------- 1 | 2 | -------------------------------------------------------------------------------- /app/src/main/res/values/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 16dp 4 | 16dp 5 | 6 | 24sp 7 | 2dp 8 | 7dp 9 | 10dp 10 | 11 | -------------------------------------------------------------------------------- /app/src/main/java/com/softbankrobotics/qisdktutorials/utils/Constants.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2018 Softbank Robotics Europe 3 | * See COPYING for the license 4 | */ 5 | 6 | package com.softbankrobotics.qisdktutorials.utils 7 | 8 | interface Constants { 9 | 10 | interface Intent { 11 | companion object { 12 | const val TUTORIAL_NAME_KEY = "TUTORIAL_NAME_KEY" 13 | const val TUTORIAL_LEVEL_KEY = "TUTORIAL_LEVEL_KEY" 14 | } 15 | } 16 | } 17 | -------------------------------------------------------------------------------- /app/src/main/java/com/softbankrobotics/qisdktutorials/ui/tutorials/perceptions/emotiondetection/BasicEmotion.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2018 Softbank Robotics Europe 3 | * See COPYING for the license 4 | */ 5 | 6 | package com.softbankrobotics.qisdktutorials.ui.tutorials.perceptions.emotiondetection 7 | 8 | /** 9 | * Represent a basic emotion. 10 | */ 11 | enum class BasicEmotion { 12 | UNKNOWN, 13 | NEUTRAL, 14 | CONTENT, 15 | JOYFUL, 16 | SAD, 17 | ANGRY 18 | } 19 | -------------------------------------------------------------------------------- /app/src/main/java/com/softbankrobotics/qisdktutorials/ui/tutorials/perceptions/emotiondetection/OnBasicEmotionChangedListener.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2018 Softbank Robotics Europe 3 | * See COPYING for the license 4 | */ 5 | 6 | package com.softbankrobotics.qisdktutorials.ui.tutorials.perceptions.emotiondetection 7 | 8 | /** 9 | * Listener used to notify when the basic emotion changes. 10 | */ 11 | interface OnBasicEmotionChangedListener { 12 | fun onBasicEmotionChanged(basicEmotion: BasicEmotion) 13 | } 14 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/category_selector.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | 10 | 12 | -------------------------------------------------------------------------------- /app/src/test/java/com/softbankrobotics/qisdktutorials/ExampleUnitTest.java: -------------------------------------------------------------------------------- 1 | package com.softbankrobotics.qisdktutorials; 2 | 3 | import org.junit.Test; 4 | 5 | import static org.junit.Assert.*; 6 | 7 | /** 8 | * Example local unit test, which will execute on the development machine (host). 9 | * 10 | * @see Testing documentation 11 | */ 12 | public class ExampleUnitTest { 13 | @Test 14 | public void addition_isCorrect() throws Exception { 15 | assertEquals(4, 2 + 2); 16 | } 17 | } -------------------------------------------------------------------------------- /app/src/main/java/com/softbankrobotics/qisdktutorials/ui/tutorials/conversation/dynamicconcepts/OnGreetingRemovedListener.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2018 Softbank Robotics Europe 3 | * See COPYING for the license 4 | */ 5 | 6 | package com.softbankrobotics.qisdktutorials.ui.tutorials.conversation.dynamicconcepts 7 | 8 | /** 9 | * The listener used to handle a greeting removal. 10 | */ 11 | internal interface OnGreetingRemovedListener { 12 | /** 13 | * Called when a greeting is removed. 14 | * @param greeting the greeting 15 | */ 16 | fun onGreetingRemoved(greeting: String) 17 | } 18 | -------------------------------------------------------------------------------- /app/src/main/java/com/softbankrobotics/qisdktutorials/model/data/Tutorial.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2018 Softbank Robotics Europe 3 | * See COPYING for the license 4 | */ 5 | 6 | package com.softbankrobotics.qisdktutorials.model.data 7 | 8 | import androidx.annotation.StringRes 9 | 10 | /** 11 | * Represents a tutorial. 12 | */ 13 | data class Tutorial(val id: TutorialId, @param:StringRes @field:StringRes @get:StringRes val nameResId: Int, 14 | val qiChatbotId: String, val tutorialLevel: TutorialLevel) { 15 | var isSelected: Boolean = false 16 | var isEnabled: Boolean = true 17 | } 18 | -------------------------------------------------------------------------------- /app/src/main/java/com/softbankrobotics/qisdktutorials/ui/categories/OnTutorialClickedListener.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2018 Softbank Robotics Europe 3 | * See COPYING for the license 4 | */ 5 | 6 | package com.softbankrobotics.qisdktutorials.ui.categories 7 | 8 | import com.softbankrobotics.qisdktutorials.model.data.Tutorial 9 | 10 | /** 11 | * The listener used to handle a click on a tutorial. 12 | */ 13 | internal interface OnTutorialClickedListener { 14 | /** 15 | * Called when a tutorial is clicked. 16 | * @param tutorial the selected tutorial 17 | */ 18 | fun onTutorialClicked(tutorial: Tutorial) 19 | } 20 | -------------------------------------------------------------------------------- /app/src/main/res/color/button_text_color_selector.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | 10 | 15 | 17 | -------------------------------------------------------------------------------- /app/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # By default, the flags in this file are appended to flags specified 3 | # in /home/adrien.kvaternik/Android/Sdk/tools/proguard/proguard-android.txt 4 | # You can edit the include path and order by changing the proguardFiles 5 | # directive in build.gradle. 6 | # 7 | # For more details, see 8 | # http://developer.android.com/guide/developing/tools/proguard.html 9 | 10 | # Add any project specific keep options here: 11 | 12 | # If your project uses WebView with JS, uncomment the following 13 | # and specify the fully qualified class name to the JavaScript interface 14 | # class: 15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 16 | # public *; 17 | #} 18 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/button_background_selector.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 6 | 10 | 15 | 17 | -------------------------------------------------------------------------------- /app/src/main/java/com/softbankrobotics/qisdktutorials/ui/conversation/ConversationViewHolder.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2018 Softbank Robotics Europe 3 | * See COPYING for the license 4 | */ 5 | 6 | package com.softbankrobotics.qisdktutorials.ui.conversation 7 | 8 | import androidx.recyclerview.widget.RecyclerView 9 | import android.view.View 10 | 11 | import kotlinx.android.synthetic.main.layout_info_log_view.view.* 12 | 13 | /** 14 | * View holder for the conversation view. 15 | */ 16 | internal class ConversationViewHolder(itemView: View) : RecyclerView.ViewHolder(itemView) { 17 | 18 | /** 19 | * Bind the text to the view. 20 | * @param text the text 21 | */ 22 | fun bind(text: String) { 23 | itemView.textview.text = text 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /app/src/main/java/com/softbankrobotics/qisdktutorials/utils/KeyboardUtils.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2018 Softbank Robotics Europe 3 | * See COPYING for the license 4 | */ 5 | 6 | package com.softbankrobotics.qisdktutorials.utils 7 | 8 | import android.app.Activity 9 | import android.content.Context 10 | import android.view.inputmethod.InputMethodManager 11 | 12 | /** 13 | * Utilities for keyboard management. 14 | */ 15 | object KeyboardUtils { 16 | 17 | fun hideKeyboard(activity: Activity) { 18 | val view = activity.currentFocus 19 | if (view != null) { 20 | val imm = activity.getSystemService(Context.INPUT_METHOD_SERVICE) as InputMethodManager 21 | imm.hideSoftInputFromWindow(view.windowToken, 0) 22 | } 23 | } 24 | } 25 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # QiSDK Tutorials 2 | 3 | **QiSDK Tutorials** is an Android application for Pepper the robot. 4 | It was developed using the QiSDK (https://qisdk.softbankrobotics.com). 5 | 6 | This application provides an easy access to the tutorial sample codes. 7 | 8 | Any Android developer wanting to create an 9 | application for Pepper should go through these tutorials. 10 | 11 | They cover Pepper main functionalities and show both the basic and 12 | advanced tools provided by QiSDK. 13 | 14 | ## Minimum configuration 15 | 16 | * Pepper 1.9. 17 | * API level 3. 18 | 19 | ## Additional resources 20 | 21 | A step-by-step guide for these tutorials is available 22 | in the official [Pepper SDK for Android site](https://qisdk.softbankrobotics.com). 23 | 24 | ## License 25 | 26 | See the [COPYING](COPYING) file for the license. 27 | -------------------------------------------------------------------------------- /app/src/main/res/raw/move_tutorials.top: -------------------------------------------------------------------------------- 1 | topic: ~move_tutorials() 2 | 3 | concept:(mimic) ["{Mimic} animals"] 4 | concept:(trajectory) ["Step forward"] 5 | concept:(goto) ["Understanding GoTo"] 6 | concept:(lookat) ["Understanding LookAt"] 7 | concept:(freeframes) ["{Mastering} FreeFrames"] 8 | concept:(attachedframe) ["{Mastering} AttachedFrame"] 9 | concept:(animationlabel) ["{Mastering} Animation labels"] 10 | 11 | u: ("~mimic $level==basic") ^endDiscuss(animation) 12 | u: ("~trajectory $level==basic") ^endDiscuss(trajectory) 13 | u: ("~goto $level==advanced") ^endDiscuss(goto) 14 | u: ("~lookat $level==advanced") ^endDiscuss(lookat) 15 | u: ("~freeframes $level==advanced") ^endDiscuss(goto_world) 16 | u: ("~attachedframe $level==advanced") ^endDiscuss(follow) 17 | u: ("~animationlabel $level==advanced") ^endDiscuss(animation_label) -------------------------------------------------------------------------------- /app/src/main/java/com/softbankrobotics/qisdktutorials/model/data/TutorialId.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2018 Softbank Robotics Europe 3 | * See COPYING for the license 4 | */ 5 | 6 | package com.softbankrobotics.qisdktutorials.model.data 7 | 8 | /** 9 | * Represents a tutorial identifier. 10 | */ 11 | enum class TutorialId { 12 | SAY, 13 | QICHATBOT, 14 | LISTEN, 15 | ANIMATION, 16 | GOTO, 17 | LOOKAT, 18 | CHARACTERISTICS, 19 | TOUCH, 20 | BOOKMARK, 21 | EXECUTE, 22 | DYNAMIC_CONCEPT, 23 | QICHAT_VARIABLE, 24 | GOTO_WORLD, 25 | ATTACHED_FRAME, 26 | AUTONOMOUS_ABILITIES, 27 | TRAJECTORY, 28 | EMOTION, 29 | ENFORCE_TABLET_REACHABILITY, 30 | TAKE_PICTURE, 31 | ANIMATION_LABEL, 32 | DETECT_HUMANS_WITH_LOCALIZATION, 33 | CHAT_LOCALE, 34 | EXTEND_MAP 35 | } 36 | -------------------------------------------------------------------------------- /gradle.properties: -------------------------------------------------------------------------------- 1 | # Project-wide Gradle settings. 2 | 3 | # IDE (e.g. Android Studio) users: 4 | # Gradle settings configured through the IDE *will override* 5 | # any settings specified in this file. 6 | 7 | # For more details on how to configure your build environment visit 8 | # http://www.gradle.org/docs/current/userguide/build_environment.html 9 | 10 | # Specifies the JVM arguments used for the daemon process. 11 | # The setting is particularly useful for tweaking memory settings. 12 | android.enableJetifier=true 13 | android.useAndroidX=true 14 | org.gradle.jvmargs=-Xmx1536m 15 | 16 | # When configured, Gradle will run in incubating parallel mode. 17 | # This option should only be used with decoupled projects. More details, visit 18 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects 19 | # org.gradle.parallel=true 20 | 21 | VERSION_CODE=12 22 | VERSION_NAME=1.5.1 23 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_move.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | -------------------------------------------------------------------------------- /app/src/main/res/raw/talk_tutorials.top: -------------------------------------------------------------------------------- 1 | topic: ~talk_tutorials() 2 | 3 | concept:(hello) ["Hello human"] 4 | concept:(qichatbot) ["Listen and reply"] 5 | concept:(listen) ["Catch {few} words"] 6 | concept:(bookmark) ["{Mastering} bookmark"] 7 | concept:(execute) ["{Mastering} execute"] 8 | concept:(dynamicconcept) ["{Mastering} dynamic concept"] 9 | concept:(qichatvariable) ["{Mastering} QiChat variable"] 10 | concept:(chatlocale) ["{Mastering} Chat locale"] 11 | 12 | u: ("~hello $level==basic") ^endDiscuss(hello) 13 | u: ("~qichatbot $level==basic") ^endDiscuss(qichatbot) 14 | u: ("~listen $level==basic") ^endDiscuss(listen) 15 | u: ("~bookmark $level==advanced") ^endDiscuss(bookmark) 16 | u: ("~execute $level==advanced") ^endDiscuss(execute) 17 | u: ("~dynamicconcept $level==advanced") ^endDiscuss(dynamic_concept) 18 | u: ("~qichatvariable $level==advanced") ^endDiscuss(qichat_variable) 19 | u: ("~chatlocale $level==advanced") ^endDiscuss(chat_locale) 20 | 21 | -------------------------------------------------------------------------------- /app/src/androidTest/java/com/softbankrobotics/qisdktutorials/ExampleInstrumentedTest.java: -------------------------------------------------------------------------------- 1 | package com.softbankrobotics.qisdktutorials; 2 | 3 | import android.content.Context; 4 | import androidx.test.platform.app.InstrumentationRegistry; 5 | import androidx.test.ext.junit.runners.AndroidJUnit4; 6 | 7 | import org.junit.Test; 8 | import org.junit.runner.RunWith; 9 | 10 | import static org.junit.Assert.*; 11 | 12 | /** 13 | * Instrumentation test, which will execute on an Android device. 14 | * 15 | * @see Testing documentation 16 | */ 17 | @RunWith(AndroidJUnit4.class) 18 | public class ExampleInstrumentedTest { 19 | @Test 20 | public void useAppContext() throws Exception { 21 | // Context of the app under test. 22 | Context appContext = InstrumentationRegistry.getTargetContext(); 23 | 24 | assertEquals("com.softbankrobotics.qisdktutorial", appContext.getPackageName()); 25 | } 26 | } 27 | -------------------------------------------------------------------------------- /app/src/main/java/com/softbankrobotics/qisdktutorials/ui/tutorials/conversation/dynamicconcepts/GreetingViewHolder.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2018 Softbank Robotics Europe 3 | * See COPYING for the license 4 | */ 5 | 6 | package com.softbankrobotics.qisdktutorials.ui.tutorials.conversation.dynamicconcepts 7 | 8 | import androidx.recyclerview.widget.RecyclerView 9 | import android.view.View 10 | import kotlinx.android.synthetic.main.greeting_layout.view.* 11 | 12 | /** 13 | * The view holder to show a greeting. 14 | */ 15 | internal class GreetingViewHolder(itemView: View, private val onGreetingRemovedListener: OnGreetingRemovedListener?) : RecyclerView.ViewHolder(itemView) { 16 | 17 | /** 18 | * Binds a tutorial to the views. 19 | * @param greeting the greeting 20 | */ 21 | fun bind(greeting: String) { 22 | itemView.greeting_textview.text = greeting 23 | itemView.delete_button.setOnClickListener { onGreetingRemovedListener?.onGreetingRemoved(greeting) } 24 | } 25 | } 26 | -------------------------------------------------------------------------------- /app/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | @color/sayable_blue 4 | @color/non_sayable_blue 5 | @color/advanced_orange 6 | 7 | #c5f7b2 8 | #fce4ec 9 | #f44336 10 | 11 | #00e676 12 | #ff9100 13 | 14 | #1bbde2 15 | #2e86d0 16 | 17 | #4caf50 18 | #1b5e20 19 | 20 | #888888 21 | #fafafa 22 | #e0e0e0 23 | #f5f5f5 24 | #9e9e9e 25 | 26 | -------------------------------------------------------------------------------- /app/src/main/res/raw/smart_tutorials.top: -------------------------------------------------------------------------------- 1 | topic: ~smart_tutorials() 2 | 3 | concept:(human) ["{Mastering} HumanAwareness {"and Human"}" "Mastering Human"] 4 | concept:(touch) ["React {when} touched"] 5 | concept:(picture) ["Take {a} picture"] 6 | concept:(abilities) ["{hold release} autonomous abilities"] 7 | concept:(emotion) ["Mastering Emotion {detection}" "emotion detection"] 8 | concept:(tabletreachability) ["{Enforce} tablet reachability"] 9 | concept:(detect_humans_with_localization) ["Detect humans {"with localization"}" localization] 10 | concept:(extend_map) ["Extend {a} map"] 11 | 12 | u: ("~touch $level==basic") ^endDiscuss(touch) 13 | u: ("~abilities $level==basic") ^endDiscuss(autonomous) 14 | u: ("~picture $level==basic") ^endDiscuss(picture) 15 | u: ("~tabletreachability $level==basic") ^endDiscuss(enforce_tablet_reachability) 16 | u: ("~human $level==advanced") ^endDiscuss(people_characteristics) 17 | u: ("~emotion $level==advanced") ^endDiscuss(emotion) 18 | u: ("~detect_humans_with_localization $level==advanced") ^endDiscuss(detect_humans_with_localization) 19 | u: ("~extend_map $level==advanced") ^endDiscuss(extend_map) 20 | -------------------------------------------------------------------------------- /app/src/main/res/layout/conversation_layout.xml: -------------------------------------------------------------------------------- 1 | 2 | 7 | 8 | 12 | 13 | 24 | 25 | -------------------------------------------------------------------------------- /app/src/main/res/layout/greeting_layout.xml: -------------------------------------------------------------------------------- 1 | 2 | 12 | 13 | 19 | 20 | 28 | 29 | -------------------------------------------------------------------------------- /app/src/main/res/layout/layout_human_input_view.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 19 | 20 | 25 | 26 | 31 | 32 | -------------------------------------------------------------------------------- /app/src/main/res/layout/layout_robot_output_view.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 14 | 15 | 20 | 21 | 31 | 32 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_splash_screen.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 24 | 25 | -------------------------------------------------------------------------------- /app/src/main/java/com/softbankrobotics/qisdktutorials/ui/tutorials/perceptions/humanawareness/HumanInfoAdapter.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2018 Softbank Robotics Europe 3 | * See COPYING for the license 4 | */ 5 | 6 | package com.softbankrobotics.qisdktutorials.ui.tutorials.perceptions.humanawareness 7 | 8 | import androidx.recyclerview.widget.RecyclerView 9 | import android.view.LayoutInflater 10 | import android.view.ViewGroup 11 | 12 | import com.softbankrobotics.qisdktutorials.R 13 | 14 | import java.util.ArrayList 15 | 16 | /** 17 | * The adapter used to show humans information. 18 | */ 19 | internal class HumanInfoAdapter : RecyclerView.Adapter() { 20 | 21 | private var humanInfoList: List = ArrayList() 22 | 23 | override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): HumanInfoViewHolder { 24 | val view = LayoutInflater.from(parent.context).inflate(R.layout.human_info_layout, parent, false) 25 | return HumanInfoViewHolder(view) 26 | } 27 | 28 | override fun onBindViewHolder(holder: HumanInfoViewHolder, position: Int) { 29 | val humanInfo = humanInfoList[position] 30 | holder.bind(humanInfo) 31 | } 32 | 33 | override fun getItemCount() = humanInfoList.size 34 | 35 | fun updateList(humanInfoList: List) { 36 | this.humanInfoList = humanInfoList 37 | notifyDataSetChanged() 38 | } 39 | } 40 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/ic_talk.xml: -------------------------------------------------------------------------------- 1 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /COPYING.txt: -------------------------------------------------------------------------------- 1 | 2 | Copyright (c) 2018, Softbank Robotics Europe 3 | All rights reserved. 4 | 5 | 6 | Redistribution and use in source and binary forms, with or without 7 | modification, are permitted provided that the following conditions are met: 8 | * Redistributions of source code must retain the above copyright 9 | notice, this list of conditions and the following disclaimer. 10 | * Redistributions in binary form must reproduce the above copyright 11 | notice, this list of conditions and the following disclaimer in the 12 | documentation and/or other materials provided with the distribution. 13 | * Neither the name of the Softbank Robotics nor the 14 | names of its contributors may be used to endorse or promote products 15 | derived from this software without specific prior written permission. 16 | 17 | 18 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 19 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 20 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 21 | DISCLAIMED. IN NO EVENT SHALL Softbank Robotics BE LIABLE FOR ANY 22 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 23 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 24 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 25 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 26 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 27 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 28 | -------------------------------------------------------------------------------- /LICENSE.txt: -------------------------------------------------------------------------------- 1 | Copyright (c) 2017, SoftBank Robotics Europe SAS 2 | All rights reserved. 3 | 4 | Redistribution and use in source and binary forms, with or without 5 | modification, are permitted provided that the following conditions are met: 6 | * Redistributions of source code must retain the above copyright 7 | notice, this list of conditions and the following disclaimer. 8 | * Redistributions in binary form must reproduce the above copyright 9 | notice, this list of conditions and the following disclaimer in the 10 | documentation and/or other materials provided with the distribution. 11 | * Neither the name of the SoftBank Robotics Europe SAS nor the 12 | names of its contributors may be used to endorse or promote products 13 | derived from this software without specific prior written permission. 14 | 15 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 16 | ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 17 | WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 18 | DISCLAIMED. IN NO EVENT SHALL SoftBank Robotics Europe SAS BE LIABLE FOR ANY 19 | DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES 20 | (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; 21 | LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND 22 | ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 23 | (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS 24 | SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -------------------------------------------------------------------------------- /app/src/main/java/com/softbankrobotics/qisdktutorials/ui/tutorials/perceptions/humanawareness/HumanInfo.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2018 Softbank Robotics Europe 3 | * See COPYING for the license 4 | */ 5 | 6 | package com.softbankrobotics.qisdktutorials.ui.tutorials.perceptions.humanawareness 7 | 8 | import android.graphics.Bitmap 9 | 10 | import com.aldebaran.qi.sdk.`object`.human.AttentionState 11 | import com.aldebaran.qi.sdk.`object`.human.EngagementIntentionState 12 | import com.aldebaran.qi.sdk.`object`.human.ExcitementState 13 | import com.aldebaran.qi.sdk.`object`.human.Gender 14 | import com.aldebaran.qi.sdk.`object`.human.PleasureState 15 | import com.aldebaran.qi.sdk.`object`.human.SmileState 16 | 17 | /** 18 | * Represents the human information. 19 | */ 20 | data class HumanInfo(val age: Int, val gender: Gender, val pleasureState: PleasureState, 21 | val excitementState: ExcitementState, val engagementIntentionState: EngagementIntentionState, 22 | val smileState: SmileState, val attentionState: AttentionState, val distance: Double, var facePicture: Bitmap? = null) { 23 | 24 | /** 25 | * To clear the memory before setting a new bitmap 26 | * [https://developer.android.com/reference/android/graphics/Bitmap.html#recycle()](https://developer.android.com/reference/android/graphics/Bitmap.html#recycle()) 27 | */ 28 | fun clearMemory() { 29 | facePicture?.takeUnless { it.isRecycled } 30 | ?.let { 31 | it.recycle() 32 | facePicture = it 33 | facePicture = null 34 | } 35 | } 36 | 37 | } 38 | -------------------------------------------------------------------------------- /app/src/main/java/com/softbankrobotics/qisdktutorials/ui/splashscreen/SplashScreenActivity.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2018 Softbank Robotics Europe 3 | * See COPYING for the license 4 | */ 5 | 6 | package com.softbankrobotics.qisdktutorials.ui.splashscreen 7 | 8 | import android.content.Intent 9 | import android.os.Bundle 10 | 11 | import com.aldebaran.qi.sdk.design.activity.RobotActivity 12 | import com.aldebaran.qi.sdk.design.activity.conversationstatus.SpeechBarDisplayStrategy 13 | import com.softbankrobotics.qisdktutorials.R 14 | import com.softbankrobotics.qisdktutorials.ui.categories.CategoriesActivity 15 | 16 | import java.util.Timer 17 | import java.util.TimerTask 18 | 19 | /** 20 | * The splashscreen activity. 21 | */ 22 | class SplashScreenActivity : RobotActivity() { 23 | 24 | private var timer: Timer? = null 25 | 26 | override fun onCreate(savedInstanceState: Bundle?) { 27 | super.onCreate(savedInstanceState) 28 | 29 | setSpeechBarDisplayStrategy(SpeechBarDisplayStrategy.OVERLAY) 30 | setContentView(R.layout.activity_splash_screen) 31 | } 32 | 33 | override fun onResume() { 34 | super.onResume() 35 | 36 | timer = Timer() 37 | timer?.schedule(object : TimerTask() { 38 | override fun run() { 39 | goToCategories() 40 | } 41 | }, 1500) 42 | } 43 | 44 | override fun onPause() { 45 | timer?.cancel() 46 | super.onPause() 47 | } 48 | 49 | private fun goToCategories() { 50 | val intent = Intent(this, CategoriesActivity::class.java) 51 | startActivity(intent) 52 | 53 | finish() 54 | } 55 | } 56 | -------------------------------------------------------------------------------- /app/src/main/java/com/softbankrobotics/qisdktutorials/ui/categories/CategoriesContract.kt: -------------------------------------------------------------------------------- 1 | /* 2 | * Copyright (C) 2018 Softbank Robotics Europe 3 | * See COPYING for the license 4 | */ 5 | 6 | package com.softbankrobotics.qisdktutorials.ui.categories 7 | 8 | import android.content.Context 9 | 10 | import com.softbankrobotics.qisdktutorials.model.data.Tutorial 11 | import com.softbankrobotics.qisdktutorials.model.data.TutorialCategory 12 | import com.softbankrobotics.qisdktutorials.model.data.TutorialLevel 13 | 14 | /** 15 | * Contract for the categories. 16 | */ 17 | internal interface CategoriesContract { 18 | 19 | interface View { 20 | fun showTutorials(tutorials: List) 21 | fun selectTutorial(tutorial: Tutorial) 22 | fun goToTutorial(tutorial: Tutorial) 23 | fun selectCategory(category: TutorialCategory) 24 | fun selectLevel(level: TutorialLevel) 25 | } 26 | 27 | interface Presenter { 28 | fun bind(view: View) 29 | fun unbind() 30 | fun loadTutorials(category: TutorialCategory) 31 | fun loadTutorials(level: TutorialLevel) 32 | fun goToTutorialForQiChatbotId(tutorialQiChatbotId: String) 33 | fun goToTutorial(tutorial: Tutorial) 34 | } 35 | 36 | interface Robot { 37 | fun register(activity: CategoriesActivity) 38 | fun unregister(activity: CategoriesActivity) 39 | fun stopDiscussion(tutorial: Tutorial) 40 | fun selectTopic(category: TutorialCategory) 41 | fun selectLevel(level: TutorialLevel) 42 | } 43 | 44 | interface Router { 45 | fun goToTutorial(tutorial: Tutorial, context: Context) 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_detect_humans_with_localization_tutorial.xml: -------------------------------------------------------------------------------- 1 | 2 | 8 | 9 | 16 | 17 | 32 | 33 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_look_at_tutorial.xml: -------------------------------------------------------------------------------- 1 | 2 | 11 | 12 | 16 | 17 | 29 | 30 |